【发布时间】:2014-07-16 04:50:43
【问题描述】:
我从来没有在 bash 中写过这么激烈的东西。基本上,我想并行运行有限数量的数据导入脚本。为此,我需要知道一个何时终止以便开始下一个。但是,我不确定如何并行执行此操作。以下同步工作:
# watch the outputfile for "DONE!"
tail -f $outputfile | while read OUTPUT
do
if [[ "${OUTPUT}" == *"DONE!"* ]]
then
runNextScript
fi
done
如何异步运行?
【问题讨论】:
-
太复杂了。将问题简化为更小的示例。 stackoverflow.com/help/mcve
-
后半部分更多的是为了完整性,但现在看起来更干净了。谢谢!
标签: bash automation background-process tail watch