android-udev-rules icon indicating copy to clipboard operation
android-udev-rules copied to clipboard

`#!/usr/bin/env` should be avoided except when needed

Open kurahaupo opened this issue 2 years ago • 0 comments

https://github.com/M0Rf30/android-udev-rules/blob/6ceb4ccee158abddf7ab3b6f091c1264a648863d/install.sh#L1

Unnecessary implicit trust of the caller's environment:

  1. the #! line is untrustworthy; and
  2. the PATH=/usr/bin:/bin line is missing.

There is a widespread myth that #!/usr/bin/env whatever is "more portable" than #!/path/to/whatever, but this particular project is only useful for Linux PC's where /bin/sh is universally available (as it is on nearly every Unix system in existence).

Meanwhile this extraneous use of env contributes to normalizing it in the minds of people who don't understand its problems and limitations.

See https://burnthewhich.github.io/shbangenv/shbangenv

kurahaupo avatar Jul 06 '22 08:07 kurahaupo