Results 1 to 3 of 3
I am trying to write a bit of a script to send a command to run a script several times, which in turn runs another script which runs a program. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-23-2006 #1
- Join Date
- Jul 2006
wait command problems
for i in $(seq 1 10) #runs rdocking 10 times do rdocking $MYTEST & rpid=$! wait $rpid echo "$i docking test(s) complete!" done
I have tried using the batch command but it causes a problem due to the fact that i am unable to see the processes or jobs that it is carrying out, and therefore i am unable to control them.
the wait man page says:
Wait for the specified process and return its termination sta-
tus. n may be a process ID or a job specification; if a job
spec is given, all processes in that job’s pipeline are waited
EDIT: Problem sorted, it was something else messing the progam up (though i am not sure what!)
- 08-24-2006 #2
I have an idea in mind, but the implementation would be messy, so I'll just describe it.
Create a directory, like ~/pids.
Each script puts it's own PID into the directory before anything else and deletes it when done.Code:
PIDLIST="$PIDLIST $$" rdocking $MYTEST "$PIDLIST"
- 08-25-2006 #3Originally Posted by KenJackson
This will lock your top level script until the command has finished, won't it?