Re: [PATCH] contrib: Replaced /bin/sh with /bin/bash to make scripts with Bash syntax work on Solaris.
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 9, 2010, 20:16 UTC
- Message-ID
- <20100809201629.GB2888@burratino>
- In-Reply-To
- <7vvd7j67wo.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
Show 5 quoted lines
>> Maybe, relying on a sane $PATH: >> >> #!/usr/bin/env sh > > That's even worse. Please don't go there.
Okay. I was trying to be exhaustive, even if most of the strategies I mentioned are insane (“maybe” was probably too strong of a word :)). (For example, I remember some version of Cygwin requiring the #! line, so I fear it is dangerous to leave that off.)
After-the-fact s,/bin/sh,$SHELL_THE_USER_WANTS, substitution is the only sane strategy I have seen used in practice. POSIX has even blessed something like it, at last.
http://www.opengroup.org/onlinepubs/9699919799/utilities/sh.html#tag_20_117_16