Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有一个 UNIX shell 脚本,它的每一行都有一些需要运行的程序,比如
#!/bin/bash command1 command2 command3 command4
command2 将仅在 command1 执行完成后执行,还是它们并行运行而不等待前一个命令完成,因为每个命令都是需要执行的单独进程。
这些命令是串行运行的。要并行运行它们,请附加&到每一行:
&
#!/bin/bash command1& command2& command3& command4& wait