[GTALUG] Hashbang syntax in bash script [was: Watching a network folder: is there a smart way of doing this?\

Jamon Camisso jamon.camisso at utoronto.ca
Thu Mar 2 08:39:49 EST 2017


On 01/03/17 20:53, Scott Elcomb via talk wrote:
> On Wed, Mar 1, 2017 at 5:41 AM, William Park via talk <talk at gtalug.org> wrote:
>> If you know /bin/bash is the right location, then use /bin/bash.  If
>> not, let 'env' find it.
> 
> Basically this; I've been bitten a couple times with a missing
> /bin/bash (though never /bin/sh)
> 
> Picked the trick up a few years ago (not sure where) and never looked back.  :-)

Question: if /bin/bash doesn't exist, but it is defined via an env
variable, what kind of system sets things up such that /bin/bash doesn't
exist?

I use /usr/bin/env for most things, but not for bash. Just
curious/looking for a compelling reason to adopt it in future scripts.

Cheers, Jamon


More information about the talk mailing list