[ale] Silly bash question

Stephen Benjamin skbenja at gmail.com
Thu Nov 12 14:39:54 EST 2009


Cleaner:

for pid in `jobs -p`;
do
             JOBNAME=`ps aux | grep $pid | grep -v grep | awk ' { print $11
}'`;
             echo "${JOBNAME}: $pid";
done


--
Stephen Benjamin
skbenja at gmail.com

http://www.linkedin.com/in/skbenja



On Wed, Nov 11, 2009 at 2:25 PM, John Mills <johnmills at speakeasy.net> wrote:

> Tim -
>
> Clean. Thanks.
>
> On Wed, 11 Nov 2009, Tim Watts wrote:
>
> > #/bin/bash
>
> > CAPTURE=output.log
>
> > for c in "$@"; do
> >       $c >>"$CAPTURE" 2>&1 &
> >       PIDS="$PIDS $!"
> > done
>
> > echo "$PIDS"
>
> > Then call it like this:
>
> > <script-name> "echo test1" "echo test2" "echo test3"
>
> > On Wed, 2009-11-11 at 11:12 -0500, John Mills wrote:
>
> >> I want to write a bash script to launch several processes into
> background
> >> without waiting for them to exit, and return a list of their PIDs.
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20091112/9ad9c166/attachment.html 


More information about the Ale mailing list