Bash child process kills parent when doing eval exec
我编写了以下代码来为多个文件执行python脚本。当
1 2 3 4 5 6 7 8 9 10 11 12 13 | #!/bin/bash args= for arg in"$@"; do args="$args '$arg'" done for file in /home/andrew/Downloads/xmls/* do echo $file eval exec"python script.py $file $args" done |
它不会退出。因为您正在
删除
这里也不需要
1 | python script.py"$file""$@" |