However, it only execute scripts, without arguments.
So you would have to create for each script a script which calls the script with arguments.
Then pass those 'holding-scripts' to tui-psm.
I don't know what you have in test1.sh but if it is a simple command to shutdown some process, you could call the command itself in a loop and background each.
Thanks for the reply.
So I understand if I run below it will run the 3 scripts in parallel.
test1.sh par1 &
test1.sh par2 &
test1.sh par3 &
Now I have 2 questions.
How UNIX will call test1.sh par2 & after test1.sh par1 &.
test1.sh par1 & we are running in backgroud , so after kicking this script shall it automatically kick test1.sh par2 & without considering the first one to fail or success?
SEA -->
Why we are calling wait call in your example?
wait $p1 && wait $p2 && wait $p3 - Is it when p1 completes it will start p2 ...
Please use code tags as required by the forum rules.
We are not calling wait.
It executes the scripts in background, and 'wait' is used as intervall to check wether the script has started yet, is still running, or how it exited.
Change:
test1.sh par2 & after test1.sh par1 &
to:
(test1.sh par2 && test1 par1) &
To run the the par1 only if par2 ended successfully, if you want to run it anyway, use ; instead of && .
hth
EDIT: test1.sh par2 && test1 par1 could be the content of a file passed to tui-psm.
Sure, if you let it only execute (set the limit to) one at a time.... it will do a sequence only / as well.
Just to be complete, if one tells the command the limit is 5, it will start t scripts at once in paralell.
And then check every few secs if one or more has ended.
So if 3 had ended, it can start another 3 at once.
If you set the limit to 1000, it could run a thousand scripst in paralell, but still would need to check every few secs, if some had ended and if there are remainings to start.
Its designed to work with more scripts, not just 3, but for some reason, 3 is always the question on the forum.
Also, its not (only) ment to run scripts in background, but also to let you know how they returned.
Thanks for the reply.
I have still below confusion.
ust to be complete, if one tells the command the limit is 5, it will start t scripts at once in paralell.
And then check every few secs if one or more has ended.
So if 3 had ended, it can start another 3 at once.
If you set the limit to 1000, it could run a thousand scripst in paralell, but still would need to check every few secs, if some had ended and if there are remainings to start
When I'm running 3 scripts in parallel with below
test1.sh par2 & after test1.sh par1 &
where I'm defining
if one tells the command the limit is 5, it will start t scripts