[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "jobs" builtin: print zero exit status

From: Chet Ramey
Subject: Re: "jobs" builtin: print zero exit status
Date: Thu, 12 Sep 2013 14:34:21 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

On 9/12/13 6:14 AM, Dmitry Bolshakov wrote:
>    Hi!
>    imho "jobs" should either print zero exit status or it should be
>    documented that "Done" means zero exit status
>    $ bash -c 'set -m; perl -e "sleep 1; exit 123"& { sleep 3; jobs -l; }'
>    [1]+е║ Exit 123е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║ perl -e "sleep 1; exit 123"
>    ok, I see exit status
>    but
>    $ bash -c 'set -m; perl -e "sleep 1; exit 0"& { sleep 3; jobs -l; }'
>    [1]+е║ Doneе║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║ perl -e "sleep 1; exit 0"
>    imho "Exit 0" would be better for scripting

The format of the text isn't in the man page at all.  Parsing the output
of jobs is a really terrible way to figure out a job's exit status.  You
might try using `wait'.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]