:: Re: [DNG] Danger: Debian POSIX host…
Etusivu
Poista viesti
Vastaa
Lähettäjä: Rick Moen
Päiväys:  
Vastaanottaja: dng
Aihe: Re: [DNG] Danger: Debian POSIX hostility
Quoting Peter Duffy (peter@???):

> With respect, I'd tend to disagree with that to some extent. The /bin/sh
> symlink is built in, and is there from the point that the system is
> installed.


That was a _second_ if lesser blunder (in that bash was, even at the
inception of Linux, a poor approximation of the Bourne shell), but
doesn't excuse the one of failing to put /bin/bash in the shebang if one
intends to write a bash-specific script. Which is what was actually
under discussion.

> So it's a feature made available to users, and it's arguably
> not a blunder to use it.


It's not a blunder to use a /bin/sh -> /bin/bash symlink. It's a
blunder to fail to specify bash in the shebang if you're writing a bash
script.

> I'd agree that best practice is specifying bash explicitly in the
> shebang, if it's required (something that I personally have always done
> since I first bitten by the bash/dash problem).


For values of 'best practices' approximating 'This will prevent your
script accidentally breaking if you use bash-specific features and
your script ends up being run at a time or place where /bin/sh is
something other than bash.'

> I'm trying to remember what happens on systems that default to ksh and
> csh - I assume that on those, the shebang always needs to specify the
> shell to be used.


ksh and pdksh are fairly close approximations of the Bourne shell. csh
and tcsh are very much not.