我正在尝试在后台运行两个脚本。但是我想首先运行一个脚本,等待它完成并递归地运行下一个脚本。这段代码片段会这样做吗:
for i in "${studyinstanceuids[@]}"
do
#let count="$count+1"
echo "$i" | ./cmd2&
sleep 5
if job1 is alive then sleep 5
echo "$i" | ./sendExamToRepo.sh&
wait
fi
答案 0 :(得分:0)
for i in "${studyinstanceuids[@]}"; do
( echo "$i" | ./cmd2; echo "$1" | ./sendExamToRepo.sh )&
done
wait