http://qs1969.pair.com?node_id=977372


in reply to Keep n instances running

When ever I need to keep a job running I use a sub shell type structure

#!(bash|ksh|sh) <set up environment> (while true do <perl script> # brief delay to ensure everything is shutdown sleep 60 done) &

The subshell itself is backgrounded rather than just the Perl script.

I'm sure this can be adapted to starting up n copies of <perl script> maybe a little loop that will fire up multiple subshells. Note I'm not a BASH expert

#!(bash|ksh|sh) <set up environment> for I in {1..n}; do (while true do <perl script> $I # brief delay to ensure everything is shutdown sleep 60 done) &; done