Help with wait command

I have a script that runs numerous other scripts. I am using a wait command to try and get the calling script to wait for all process called to finish before proceeding.

Issues

How can I set wait to timeout IE a called program never terminates.

Alternatively how can I check the called process and then decide to kill them if they have gone past as set time reference. So the calling script can continue.

I am finding sometimes wait never terminates and other times it terminates prematurely.

Thanks

:smiley:

are you trying to run all the scripts at once from the parent script, using & ? if you call the scripts one after the other, the shell waits for one script to finish before starting the next in the code, though you can run several scripts at once in the back ground using &.

post your script code.. that would help...