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'.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/