Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
wollw
· 13y ago · 0 comments
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.
Comments
[–]
atsaloli
13y ago
How do you know env is in /usr/bin rather than in /bin or /usr/local/bin? I'm just curious...
[–]
wollw
OP
13y ago
You don't, but I've run into more problems with bash being in unexpected places than env.
[–]
atsaloli
13y ago
Right on, thanks.
[–]
ralph
13y ago
Good question. I've used systems, e.g. AIX, where env(1) was in /bin.