From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19650 invoked by alias); 21 Nov 2014 11:47:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33740 Received: (qmail 14999 invoked from network); 21 Nov 2014 11:47:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=no version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Stephane Chazelas Subject: [PATCH][DOC] Re: Redirection bug for stderr? Date: Fri, 21 Nov 2014 11:29:28 +0000 Message-ID: <20141121112928.GB7177@chaz.gmail.com> References: <20141120104440.GA23262@gmail.com> <20141120160816.0d259011@pwslap01u.europe.root.pri> <20141120165859.GA10542@chaz.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 5ec1853a.skybroadband.com Content-Disposition: inline In-Reply-To: <20141120165859.GA10542@chaz.gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) 2014-11-20 16:58:59 +0000, Stephane Chazelas: [...] > Or: > > % { print output; print error >&2 } 2>&1 >&- >foo.out | sed 's/error/erratic/' [...] Here as a patch. Also adding a missing "hideval" in ${(t)var} description (unrelated). diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index a0478e7..f1334e3 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -1061,6 +1061,9 @@ for arrays which keep only the first occurrence of duplicated values item(tt(hide))( for parameters with the `hide' flag ) +item(tt(hideval))( +for parameters with the `hideval' flag +) item(tt(special))( for special parameters defined by the shell ) diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index 7d4b86e..eaffe71 100644 --- a/Etc/FAQ.yo +++ b/Etc/FAQ.yo @@ -1784,7 +1784,14 @@ sect(Why is my output duplicated with `tt(foo 2>&1 >foo.out | bar)'?) to both files when the redirector appears twice. What's going on in the first example is exactly the same, however the second redirector is disguised as a pipe. So if you want to turn this effect off, you need - to unset the option mytt(MULTIOS). + to unset the option mytt(MULTIOS) or write it: + verb( + % { print output; print error >&2 } 2>&1 >&- >foo.out | sed 's/error/erratic/' + erratic + ) + By closing stdout with tt(>&-), we're cancelling the previous redirections + (to the pipe) and start anew with tt(>foo.out) instead of adding it as a + redirection target to stdout. sect(What are these `^' and `~' pattern characters, anyway?)