Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
$pipestatus broken?
- X-seq: zsh-workers 29973
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: $pipestatus broken?
- Date: Sat, 10 Dec 2011 13:24:30 +0100
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author