didess has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying unsuccessfully to do with Perl what I do often with shell on various tastes of ...X (AIX, LinuX, ...), no need on Windows.
Sending several commands in parallell in background, then waiting for the end of all the processes.
It helps me a lot to reduce drastically execution time when managing numerous servers through ssh commands.
Example in shell :
I think it should be much better with Perl, but up to now I can't successexport PIDS="" for P in $PARAMS do some-command $P > /tmp/some-file.$P & PIDS="$PIDS $!" done wait $PIDS ... continue work ...
Any hint ?
Thanks to all of you
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sending multiple commands
by locked_user sundialsvc4 (Abbot) on Jan 07, 2011 at 16:18 UTC | |
|
Re: sending multiple commands
by mirod (Canon) on Jan 07, 2011 at 16:20 UTC | |
|
Re: sending multiple commands
by Anonyrnous Monk (Hermit) on Jan 07, 2011 at 16:28 UTC | |
|
Re: sending multiple commands
by locked_user sundialsvc4 (Abbot) on Jan 08, 2011 at 17:19 UTC | |
by Anonyrnous Monk (Hermit) on Jan 08, 2011 at 17:52 UTC |