News for hackers. Stuff that matters.
Re:A surprise with how ' ' handles its program argument in p... by hulitu on Thursday November 20, 2025 @02:10AM (#45989824)
> Anything other than ”#!/usr/bin/env bash” is doomed to fail at some time.

if you have /usr/bin/env

Re:A surprise with how ' ' handles its program argument in p... by kreetx on Thursday November 20, 2025 @04:44AM (#45990873)
/usr/bin/env (and /bin/sh) are part of POSIX, that is why the above shebang is the recommended way to start a shell.
Re:A surprise with how ' ' handles its program argument in p... by SAI_Peregrinus on Thursday November 20, 2025 @11:38AM (#45994542)
/bin/sh is NOT required by POSIX, they explicitly warn that it may not exist[1].

> Applications should note that the standard PATH to the shell cannot be assumed to be either /bin/sh or /usr/bin/sh, and should be determined by interrogation of the PATH returned by getconf PATH , ensuring that the returned pathname is an absolute pathname and not a shell built-in.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/

Re:A surprise with how ' ' handles its program argument in p... by saghm on Thursday November 20, 2025 @07:22AM (#45991859)
I don't know if this is still a thing, but I distinctly remember when playing around with NixOS years ago that `env` was the only thing in /usr/bin, which I assumed was pretty much exactly for this reason.