> On Mon, May 26, 2008 at 02:58:17PM +0200, Miroslav Rudisin wrote: > > children's PIDs are not printed when called in eval block > > > > $ sleep 1000 & > > $ sleep 100 & > > $ jobs -p > > 14202 > > 14201 > > $ echo $(jobs -p) > > > > $ > > Hi, I don't think that's a bug, the jobs builtin 'shall display the > status of jobs that were started in the current shell environment;'[0] > > When running jobs in a subshell, you change the shell environment for > the jobs builtin.
ok, i understand. but then we have not reasonable way to store pids of background process into shell variable... $ sleep 1000 & $ sleep 100 & $ for i in `jobs -p`; do echo $i; done # doesn't work $ jobs -p | xargs # doesn't work only working way is redirecting output to the file $ jobs -p > /tmp/pids # this works -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]