#66 bashisms in arm-image-installer
Opened 2 months ago by zuh0. Modified 2 months ago

I noticed arm-image-installer's shebang was to /bin/sh and ran shellcheck on the script and it found a bunch of bashisms.
Here is a list of them on the current master branch (669bbf7bc) in the format line_number: problem:

  • 129: The surrounding quotes actually unquote this. Remove or escape them.
  • 175: In POSIX sh, read -p is undefined.
  • 176: Quote parameters to tr to prevent glob expansion.
  • 176: Quote parameters to tr to prevent glob expansion.
  • 188: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
  • 270: In POSIX sh, read -p is undefined.
  • 271: Quote parameters to tr to prevent glob expansion.
  • 271: Quote parameters to tr to prevent glob expansion.
  • 277: In POSIX sh, &> is undefined.
  • 279: Quote this to prevent word splitting.
  • 279: In POSIX sh, &> is undefined.
  • 350: In POSIX sh, standalone ((..)) is undefined.
  • 350: In POSIX sh, ++ is undefined.
  • 362: In POSIX sh, standalone ((..)) is undefined.
  • 362: In POSIX sh, ++ is undefined.
  • 381: In POSIX sh, &> is undefined.
  • 387: In POSIX sh, standalone ((..)) is undefined.
  • 387: In POSIX sh, ++ is undefined.
  • 396: In POSIX sh, &> is undefined.
  • 405: In POSIX sh, &> is undefined.
  • 406: In POSIX sh, &> is undefined.
  • 409: In POSIX sh, &> is undefined.
  • 410: In POSIX sh, &> is undefined.
  • 422: In POSIX sh, brace expansion is undefined.
  • 422: In POSIX sh, &> is undefined.
  • 423: In POSIX sh, &> is undefined.
  • 436: In POSIX sh, &> is undefined.
  • 441: In POSIX sh, &> is undefined.
  • 470: In POSIX sh, [[ ]] is undefined.
  • 484: Quote parameters to tr to prevent glob expansion.
  • 484: Quote parameters to tr to prevent glob expansion.
  • 488: Quote parameters to tr to prevent glob expansion.
  • 488: Quote parameters to tr to prevent glob expansion.
  • 511: In POSIX sh, &> is undefined.
  • 515: In POSIX sh, &> is undefined.
  • 535: In POSIX sh, [[ ]] is undefined.
  • 571: In POSIX sh, &> is undefined.
  • 573: In POSIX sh, &> is undefined.
  • 575: In POSIX sh, &> is undefined.
  • 586: The surrounding quotes actually unquote this. Remove or escape them.

Login to comment on this ticket.

Metadata