markmulligansr
MIS
How do I write a KSH script to run programs in parallel?
I'd like to pass the script a variable with the number of programs I'd like to run in parallel.
If for example, I have an input file with 100 table names and if I want to run a runstats program for 10 tables at a time in parallel with no more than 10 running at the same time, how would I do this?
I would want the script to wait on the 10 runstats programs that are running and when one finishes, I'd like it to read the next record from the input file and continuously have 10 of these runstats programs running in parallel until the end of the file is reached.
If there is a way that I can check the return code from each of these programs, I'd like to do that too.
Thanks for your help.
I'd like to pass the script a variable with the number of programs I'd like to run in parallel.
If for example, I have an input file with 100 table names and if I want to run a runstats program for 10 tables at a time in parallel with no more than 10 running at the same time, how would I do this?
I would want the script to wait on the 10 runstats programs that are running and when one finishes, I'd like it to read the next record from the input file and continuously have 10 of these runstats programs running in parallel until the end of the file is reached.
If there is a way that I can check the return code from each of these programs, I'd like to do that too.
Thanks for your help.