Re: [PATCH] t/test-lib.sh: do not trust $SHELL
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Sep 21, 2012, 21:07 UTC
- Message-ID
- <CALkWK0kRzN_yQZ1JqJogBs6Z1nLhofBijHzeWR5YfQYHOtpaBA@mail.gmail.com>
- In-Reply-To
- <20120921205834.GC22977@sigill.intra.peff.net>
Hi,
Jeff King wrote:
Show 9 quoted lines
> On Sat, Sep 22, 2012 at 02:22:46AM +0530, Ramkumar Ramachandra wrote: > >> Replace $SHELL with an explicit `/bin/sh`, as some shells do not >> support all the features used in the script. For example, ZSH does >> not respect IFS, which is used in line 478. > > I don't think that is the right thing to do. The point of SHELL is to > point at a bourne-compatible shell. On some systems, the main reason to > set it is that /bin/sh is _broken_, and we are trying to avoid it.
But you're only avoiding it in the --tee/ --va* codepath. In the normal codepath, you're stuck with /bin/sh anyway.
> A bigger question is: why are you setting SHELL=zsh in the first place?
I use ZSH as my primary shell, so SHELL is set to zsh when I run tests. How can we trust $SHELL to be a bourne-compatible shell?
Ram