Re: [PATCH] Use bash for test.sh.

Eitan Adler <[email protected]>
Newsgroups gmane.comp.compilers.ccache
Message-ID <CAF6rxg=om2wLx_e2f6pp8CVgop5wGy7awac75yc69Hs1dYeaxA@mail.gmail.com>
On 12 November 2012 13:11, Eitan Adler <[email protected]> wrote:
> On 12 November 2012 13:04, Mike Frysinger <[email protected]> wrote:
>> yes, when people tell you forcing asinine behavior is wrong, you label them
>> trolls.  i guess that's how you "win" arguments.
>
> Claiming that systems without /bin/bash are "crap" shows a level of
> naivete that only someone new to the open source world has. It was a
> choice between actual
> incompetence (unlikely) or pretend incompetence (a troll).
>
> On to the substance instead of my mistaken ad hominem :
>
> 1) Even on systems with a binary called /bin/bash using "#!/bash/bash" is wrong
> 2) Many systems don't ship with bash at all for licensing, technical,
> or preference reasons
> 3) Most operating systems that ship bash don't ship it in /bin
>
> The only correct behaviors are using
>
> #!/usr/bin/env bash to find the bash binary
> or
> #!/bin/sh  which is mandated to exist by POSIX

actually one more valid behavior:

#!/bin/sh
[ -z "$BASH" ] && bash $0

though this is far less common and I'm not sure if it has any
positives or negatives versus the 'env' approach.

-- 
Eitan Adler
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.