zsh-workers
 help / color / mirror / code / Atom feed
* $pipestatus broken?
@ 2011-12-10 12:24 Frank Terbeck
  2011-12-10 12:48 ` Frank Terbeck
  0 siblings, 1 reply; 12+ messages in thread
From: Frank Terbeck @ 2011-12-10 12:24 UTC (permalink / raw)
  To: zsh-workers

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


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

end of thread, other threads:[~2011-12-24 18:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-10 12:24 $pipestatus broken? Frank Terbeck
2011-12-10 12:48 ` Frank Terbeck
2011-12-10 14:58   ` Bart Schaefer
2011-12-11 14:37     ` Frank Terbeck
2011-12-23 10:49     ` Frank Terbeck
2011-12-23 21:31       ` Bart Schaefer
2011-12-23 22:11         ` Frank Terbeck
2011-12-24  9:32           ` Bart Schaefer
2011-12-24  9:59             ` Frank Terbeck
2011-12-24 18:23               ` Bart Schaefer
2011-12-24 18:46                 ` Bart Schaefer
2011-12-24 17:37       ` Bart Schaefer

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).