From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23376 invoked by alias); 10 Dec 2011 12:31:54 -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: 29973 Received: (qmail 6339 invoked from network); 10 Dec 2011 12:31:52 -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.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: zsh-workers@zsh.org Subject: $pipestatus broken? User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Date: Sat, 10 Dec 2011 13:24:30 +0100 Message-ID: <87borgzkap.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: NDMwNDQ0 Hey list, I've been playing with $pipestatus to solve the subversion1.7 issues in vcs_info... Because it turns out, it can be a whole bunch of error messages. So the idea was not to match output but to look at subversion's exit status. Since "svn info" is called in a pipe, I was using $pipestatus. The result was mixed - literally. Sometimes, $pipestatus would contain "0 0" and sometimes it would contain just a single "1". Now I was extracting the offending code into a test script and then later replaced the call to "svn info" by a call to fortune(1). The result is the same. Here's my test script: [snip] local -A svninfo fortune |& while IFS=: read a b; do svninfo[${a// /_}]="${b## #}" done ps=( "${pipestatus[@]}" ) rc=${ps[1]} print "${ps[@]}" [snap] And here is a test-run: [snip] % repeat 10 zsh ./test 1 0 0 1 1 0 0 0 0 0 0 1 0 0 1 [snap] Am I using `$pipestatus' the wrong way or is this a bug? Regards, Frank -- In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925