News for hackers. Stuff that matters.
Re:Shell Style Guide by mitchty on Tuesday May 15, 2018 @11:03AM (#17074444)
> I really don't like the `/usr/bin/env bash` approach (it came from the ruby world I think?). It's less portable than /bin/bash in my experience - I've been in environments, usually older ones, where it doesn't work at all.

Its not a ruby thing, its the way you're supposed to write portable scripts where the location of the executable might not be predetermined. Lets say you're on a distribution where bash is in /usr/bin/bash instead of /bin/bash. Well you'll be modifying the shebang line to either do /usr/bin/env bash or pointing it to that spot.

What old systems didn't it work on? I've used everything from SunOS, Irix, HPUX, AiX, Solaris, Linux, bsd's, anything claiming to be posix has to support that.

Re:Shell Style Guide by h1d on Tuesday May 15, 2018 @06:15PM (#17078380)
Funny that if env is such a crucial part of the OS, why isn't it in /bin?