我对.sh
使用脚本在脚本中运行一组任务的区别或优势(如果有的话)感到困惑GNU parallel
例如Ole Tange的回答:
parallel ./pngout -s0 {} R{} ::: *.png
Run Code Online (Sandbox Code Playgroud)
而不是说通过它们循环将它们放在背景中&
。
例如froschutz的回答:
#copied from the link for illustration
for stuff in things
do
( something
with
stuff ) &
done
wait # for all the something with stuff
Run Code Online (Sandbox Code Playgroud)
简而言之,它们只是在语法上或实际上不同吗?如果实际上不同,我应该什么时候使用它们?