<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [ale] Silly bash question</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Stephen -<BR>
<BR>
Thanks for closing this open item. It always takes me a while to sort out 'awk'!<BR>
<BR>
- Mills<BR>
<BR>
-----Original Message-----<BR>
From: ale-bounces@ale.org on behalf of Stephen Benjamin<BR>
Sent: Thu 11/12/2009 2:39 PM<BR>
To: John Mills; Atlanta Linux Enthusiasts - Yes! We run Linux!<BR>
Subject: Re: [ale] Silly bash question<BR>
<BR>
Cleaner:<BR>
<BR>
for pid in `jobs -p`;<BR>
do<BR>
JOBNAME=`ps aux | grep $pid | grep -v grep | awk ' { print $11<BR>
}'`;<BR>
echo "${JOBNAME}: $pid";<BR>
done<BR>
<BR>
<BR>
--<BR>
Stephen Benjamin<BR>
skbenja@gmail.com<BR>
<BR>
<A HREF="http://www.linkedin.com/in/skbenja">http://www.linkedin.com/in/skbenja</A><BR>
<BR>
<BR>
<BR>
On Wed, Nov 11, 2009 at 2:25 PM, John Mills <johnmills@speakeasy.net> wrote:<BR>
<BR>
> Tim -<BR>
><BR>
> Clean. Thanks.<BR>
><BR>
> On Wed, 11 Nov 2009, Tim Watts wrote:<BR>
><BR>
> > #/bin/bash<BR>
><BR>
> > CAPTURE=output.log<BR>
><BR>
> > for c in "$@"; do<BR>
> > $c >>"$CAPTURE" 2>&1 &<BR>
> > PIDS="$PIDS $!"<BR>
> > done<BR>
><BR>
> > echo "$PIDS"<BR>
><BR>
> > Then call it like this:<BR>
><BR>
> > <script-name> "echo test1" "echo test2" "echo test3"<BR>
><BR>
> > On Wed, 2009-11-11 at 11:12 -0500, John Mills wrote:<BR>
><BR>
> >> I want to write a bash script to launch several processes into<BR>
> background<BR>
> >> without waiting for them to exit, and return a list of their PIDs.<BR>
> _______________________________________________<BR>
> Ale mailing list<BR>
> Ale@ale.org<BR>
> <A HREF="http://mail.ale.org/mailman/listinfo/ale">http://mail.ale.org/mailman/listinfo/ale</A><BR>
> See JOBS, ANNOUNCE and SCHOOLS lists at<BR>
> <A HREF="http://mail.ale.org/mailman/listinfo">http://mail.ale.org/mailman/listinfo</A><BR>
><BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>