Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Different behaviour of zsh with two input redirections compared to all other POSIX shells I have installed



Hi,

while I was debugging some non-zsh related issue with "yes '' |
sometool", I noticed that zsh behaves differently in the following
(possibly neither common nor useful, likely esoteric :-) case:

~ → cat /tmp/bar.txt
bar
~ → zsh -c 'echo foo | cat -v < /tmp/bar.txt'
foo
bar
~ → bash -c 'echo foo | cat -v < /tmp/bar.txt'
bar
~ → dash -c 'echo foo | cat -v < /tmp/bar.txt'
bar
~ → ksh -c 'echo foo | cat -v < /tmp/bar.txt'
bar
~ → mksh -c 'echo foo | cat -v < /tmp/bar.txt'
bar

Interestingly some non-POSIX shells have the probably sanest approach:

~ → tcsh -c 'echo foo | cat -v < /tmp/bar.txt'
Ambiguous input redirect.
~ → csh -c 'echo foo | cat -v < /tmp/bar.txt'
Ambiguous input redirect.

(And yes, csh is _not_ a symlink to tcsh on that system. :-)

Is this expected/wanted zsh behaviour? Is this something we should fix
in zsh? And if so, should it rather behave like bash or like tcsh? :-)

I tend to tcsh's variant although I suspect that this could cause more
breakage than bash's behaviour.

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@xxxxxxxxxxxxxxx  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@xxxxxxxxx (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://noone.org/abe/ (Web)



Messages sorted by: Reverse Date, Date, Thread, Author