On 09/21/2012 09:58 PM, Ramkumar Ramachandra wrote:
> Hi again,
>
> Ramkumar Ramachandra wrote:
>> I was able to reproduce the problem on all my machines, and I consider
>> this very disturbing. However, I was successfully able to corner the
>> issue. I have an overtly long $PATH that's not getting split properly
>> by `IFS=:` in one corner case -- in other words, this shell script
>> fails to execute properly when called with `--tee` (just set a really
>> long $PATH and try):
>
> Oops. Looks like it has nothing to do with an overtly long $PATH. It
> has something to do with $SHELL being zsh though, because other shells
> work. Looking deeper into this.
>
Zsh doesn't do word-splitting by default on variable expansions:
$ zsh -c 'v="1 2 3"; for x in $v; do echo "$x"; done'
1 2 3
unless you set the SH_WORD_SPLIT option, or put Zsh in Bourne-compatibility
mode somehow:
$ zsh -o SH_WORD_SPLIT -c 'v="1 2 3"; for x in $v; do echo "$x"; done'
1
2
3
$ zsh -c 'emulate sh; v="1 2 3"; for x in $v; do echo "$x"; done'
1
2
3
More info at: <http://zsh.sourceforge.net/FAQ/zshfaq02.html>
HTH,
Stefano
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html