[英]Running multiple programs together in the shell script in infinite while loop
我有這樣的shell腳本;
while true
do
python get_proxies.py
python run1.py & python run2.py & python run3.py & python run4.py &
......
done
在此循環中,我希望一起運行此類程序,但在所有程序完成處理之前,我不希望腳本傳遞到下一個循環。
我該如何處理?
謝謝,
使用內置的wait 。 因此,甚至不需要循環:
python run1.py & python run2.py & python run3.py & python run4.py &
wait
它將等待上述命令完成
我通常使用xterm
xterm -e "sh -c 'python myscript.py'"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.