0
我編寫了下面的代碼爲多個文件執行python腳本。當script.py
執行並且循環中的第一個文件完成時,父進程存在。我沒有找到辦法來阻止這個退出。Bash子進程在執行eval時殺死父進程exec
#!/bin/bash
args=
for arg in "[email protected]";
do
args="$args '$arg'"
done
for file in /home/andrew/Downloads/xmls/*
do
echo $file
eval exec "python script.py $file $args"
done