0

I have such a shell script;

while true
do
     python get_proxies.py
     python run1.py & python run2.py & python run3.py & python run4.py &
     ......
done

In this loop, I want to run such programs together, but I don't want the script to pass to the next loop until all the programs finish processing.

How can I manage that?

Thanks,

0

2 Answers 2

2

Use the built in wait. So, no need for the loop even:

python run1.py & python run2.py & python run3.py & python run4.py &
wait

It will wait until the above commands complete

Sign up to request clarification or add additional context in comments.

Comments

1

I generally do these using xterm

xterm -e "sh -c 'python myscript.py'"

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.