Hacker News new | ask | show | jobs
by wollw 4886 days ago
It's probably safer to use:

    #!/usr/bin/env bash
Assuming env is installed (I believe I had to install a package on OpenBSD to use it) this will find the first instance of bash in the PATH.
1 comments

How do you know env is in /usr/bin rather than in /bin or /usr/local/bin? I'm just curious...
You don't, but I've run into more problems with bash being in unexpected places than env.
Right on, thanks.
Good question. I've used systems, e.g. AIX, where env(1) was in /bin.