Hacker News new | ask | show | jobs
by ffsm8 733 days ago
> /usr/bin/env is already an abstraction).

Isn't that path and the behavior of the binary defined by POSIX though? I thought it's as stable as you can get.

That's why it's usually recommended that you use /use/bin/env bash vs /bin/bash in the shebang, as the latter isn't defined by POSIX

2 comments

> Isn't that path and the behavior of the binary defined by POSIX though? I thought it's as stable as you can get.

I don't see anything about the path being defined. Certainly possible I missed it, though.

I'm not able to check right now but I vaguely recall that I've used a system in the past with env in a location other than /usr/bin.

Yes, env is an abstraction for the sake of portability, but if you're setting up custom indirections then portability probably isn't much of a concern.