parallel execution of script/ synchro problem

Hi everybody,

In a csh script, i need to run 4 time the same prog with different parameters. What i want is to run them in parallel. for this i use the command

toto1.sh & toto2.sh & toto3.sh & toto4.sh

[LEFT]For this I have no problem. In fact, I need to wait until all the programs are over to continue. All progs create a file when they finish ( fini1.txt, fini2.txt...) I thought to something like :

[LEFT] while ( (-e "fini1.txt = 0)&&(-e "fini2.txt = 0)&&(-e "fini3.txt = 0)&&(-e "fini4.txt = 0)
toto1.sh & toto2.sh & toto3.sh & toto4.sh
end

The problem is that i fear that if one end before the others, it restarts.

I tried with something like that :

    if \(\( -e "fini1.txt" == 0 \)&&\( -e "fini2.txt" == 0 \)&&\( -e "fini3.txt" == 0 \)&&\( -e "fini4.txt" == 0 \)\) then
    code code code
    endif

But it doesn't seems to works....

So if somebody could help me...

Thanks in advance
[/LEFT]
[/LEFT]

Hi.

       wait    The shell waits for all  background  jobs.

-- excerpt from man csh

Best wishes ... cheers, drl

PS many people would advise you to avoid csh family [csh, tcsh] in favor of Bourne shell family [sh, ksh, bash] for a number of reasons: Csh Programming Considered Harmful

thx, and for the csh, it's not a choice... or i need to translate a whole csh script in bash... qiute boring!

Thx again for your answer