[ale] Silly bash question

Tim Watts timtw at earthlink.net
Wed Nov 11 11:48:12 EST 2009


Maybe something like this?

#/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:
> ALErs -
> 
> 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.
> 
> Must be simple but I keep stumbling on this.
> 
> Actually PERL would be OK, too.
> 
> TIA.
> 
>   - Mills
> 
> _______________________________________________
> 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


________
The only place where democracy comes before work is in the dictionary.
-- Ralph Nader

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: This is a digitally signed message part
Url : http://mail.ale.org/pipermail/ale/attachments/20091111/0133ab66/attachment.bin 


More information about the Ale mailing list