我有两个后台作业,作业 ID 为 1 和 2。我想在作业 1 完成后做一些事情,但我不想挂起。
目前我得到的是wait 1 && do whatever,但是这个命令它会自动阻止当前的 shell。我想让wait它自己运行后台。我wait 1 & && do whatever在 zsh 中尝试过,但不起作用。我收到一个错误zsh: parse error near '&&':
wait 1 && do whatever
wait
wait 1 & && do whatever
zsh: parse error near '&&'
注意:重要的是我想在后台等待而不是等待某些后台作业完成。
linux shell process shell-script background-process
background-process ×1
linux ×1
process ×1
shell ×1
shell-script ×1