zsh-workers
 help / color / mirror / code / Atom feed
* Different behaviour of zsh with two input redirections compared to all other POSIX shells I have installed
@ 2014-12-15 11:33 Axel Beckert
  2014-12-15 11:46 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Axel Beckert @ 2014-12-15 11:33 UTC (permalink / raw)
  To: zsh-workers

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@deuxchevaux.org  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://noone.org/abe/ (Web)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-15 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15 11:33 Different behaviour of zsh with two input redirections compared to all other POSIX shells I have installed Axel Beckert
2014-12-15 11:46 ` Peter Stephenson
2014-12-15 11:53   ` Axel Beckert

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).