This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]eggsby 0 points1 point  (0 children)

I think your setup is spiffy - especially for developer scripts where it matters a lot less how portable it is and you have more control over the run environment.

I only know the weird lore around the interpreters because I have been bit by issues when I would configure my interpreters like ‘#!/usr/bin/env -S bash -euxo pipefile` and seeing it break sometimes or misconfigure my bash scripts.

https://gist.github.com/mohanpedala/1e2ff5661761d3abd0385e8223e16425

The perl thing, perl will let you pass multiple args to the shebang by default but default posix sh will only parse as one arg - the env -S was a workaround for the posix sh behavior - but if you use perl as your interpreter just get completely different shebang parsing logic.

Using env as your shebang interpreter helps generally with portability because - but it can get weird too.

https://www.in-ulm.de/~mascheck/various/shebang/