Y
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
atsaloli
4886 days ago
How do you know env is in /usr/bin rather than in /bin or /usr/local/bin? I'm just curious...
link
wollw
4886 days ago
You don't, but I've run into more problems with bash being in unexpected places than env.
link
atsaloli
4885 days ago
Right on, thanks.
link
ralph
4885 days ago
Good question. I've used systems, e.g. AIX, where env(1) was in /bin.
link