[ale] Silly bash question

Mills John M-NPHW64 Jmills at motorola.com
Thu Nov 12 14:54:19 EST 2009


Stephen -

Thanks for closing this open item. It always takes me a while to sort out 'awk'!

 - Mills

-----Original Message-----
From: ale-bounces at ale.org on behalf of Stephen Benjamin
Sent: Thu 11/12/2009 2:39 PM
To: John Mills; Atlanta Linux Enthusiasts - Yes! We run Linux!
Subject: Re: [ale] Silly bash question
 
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/35c589c5/attachment-0001.html 


More information about the Ale mailing list