简体   繁体   English

BasH:在后台运行脚本

[英]BasH: run scripts in background

I am trying to run two scripts in the background. 我正在尝试在后台运行两个脚本。 However I would like to have one script run first, wait for it to finish and run the next script recursively. 但是我想先运行一个脚本,等待它完成并递归运行下一个脚本。 Will this code snippet do as such: 此代码段会这样吗:

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
for i in "${studyinstanceuids[@]}"; do
    ( echo "$i" | ./cmd2; echo "$1" | ./sendExamToRepo.sh )&
done
wait

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM