Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
STDOUT on STDERR redirected/duplicated?
- X-seq: zsh-users 11222
- From: "Gerald Lai" <laigera@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: STDOUT on STDERR redirected/duplicated?
- Date: Mon, 26 Feb 2007 09:19:25 -0800
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=mirSCMoId48jeKIAwR2Xcz9bqQaVFz/zPfVuIY1xpXy5mhRc8xdp0FXIHQ+ymg+PX1X/M3Lshr0CC9hm4wZl1ST7mWxoXRxzIVowDTfnam9g2RkrAXRMcYakyAlrAtTiVU4BLlSFtQj1HNUL3fqIAn6IPee8uNG58VZ7//GE1g8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=m2ySI73HEHgdh/Qjirq2rOW4xpmAMOK0o23kQl2Cn9pfgXz7FQ6G+ezl+jFU/PMvmtNIwW0ko4LW4FxC9zV2TSaZ9lq7bguYH5LKJ5U90y1omSqoLauTognQBNwWTb+2keevS0wMpFBNWMoiMbFisuvpS/0LgOFZEftv0Ekam1o=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi all,
Please study these outputs:
-----
zsh-4.0.7$ echo "abc"
abc
zsh-4.0.7$ echo "abc" | xargs echo
abc
zsh-4.0.7$ echo "abc" 1>&2
abc
zsh-4.0.7$
echo "abc" 1>&2 | xargs echo
abc
abc
bash-2.05b$ echo "abc"
abc
bash-2.05b$ echo "abc" | xargs echo
abc
bash-2.05b$ echo "abc" 1>&2
abc
bash-2.05b$
echo "abc" 1>&2 | xargs echo
abc
-----
Yes, the last line is a blank line.
My understanding of the difference between Zsh and Bash when "1>&2" is performed is that STDOUT becomes valid (duplicated from STDERR) for the pipe "|" [for Zsh], whereas STDOUT is gone (redirected to STDERR) for the pipe "|" [for Bash]. Is this correct? Could someone offer an explanation of the Zsh internals.
For a sanity check, the pipe "|" means redirect STDOUT of left-side operation to STDIN of right-side operation. Correct? :)
Thanks.
--
Gerald Lai
Messages sorted by:
Reverse Date,
Date,
Thread,
Author