Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: getting the status of the left-hand side of a pipe in the right-hand side



On 2019-08-01 09:49:03 -0700, Bart Schaefer wrote:
> So you might be able to find the job from the job table but the best you
> can reliably do for its status is to send it a "kill -0" and see if that
> returns error.

Can I assume that the left-hand side is the last job in the table
(this seems to be the case in all the tests I've done)?

That would be nice as a precise status is provided: either "running"
or the exit status. And this would be very useful as it appears that
$pipestatus no longer contains the expected value if the jobs builtin
is used:

zira% false | { sleep 1; jobs } ; echo $pipestatus
[1]    exit 1     false
0

i.e. "0" instead of "1 0". Is this a bug? At least, this is not
documented.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author