Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Keep n instances running

by tweetiepooh (Friar)
on Jun 20, 2012 at 14:48 UTC ( #977372=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://977372]
help
Chatterbox?
[pryrt]: Those others were definitely offensive or unequivocably rude, I agree.
[choroba]: (well, it comes from the 14th century, so labelling it as "modern" doesn't seem appropriate)
[Your Mother]: "They" is becoming accepted but it irritates me sometimes. I tend to just pick she or he randomly or try to use "one."
LanX thinks it is appropriate here :)
[Your Mother]: They would think so.
[jdporter]: ok, I need a recipe for piping lines "through" an external program which is itself a filter
[jdporter]: without using a tmp file
[1nickt]: tobyink perl -MTypes::Standard= is_Int -Mstrict -wE 'say 1 if is_Int 1.0'
[jdporter]: so that I can use the existing expand unix util. Otherwise, I'll probably use Text::Tabs.
[1nickt]: pryrt I guess I don;t really care if user 42 logs on as 42.0 ... more of an academic question at this point.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2017-05-24 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?