我已经为运行 GNU“bash”shell 的 Linux 机器“继承”了一些 shell 脚本。在一种特殊情况下,机器运行 GNU bash 版本 2.0.5b
其中一个脚本有一个wait &(“wait &”)指令作为for循环的“for 行”的一部分。乍一看,这似乎是一个奇怪/有趣的习语,但我对它的网络搜索没有返回任何相关内容。man wait显示“BASH_BUILTINS”(“BASH BUILTINS COMMAND”)联机帮助页,其中有以下说明:
wait [n]
Wait for the specified process and return its termination status.
n may be a process ID or a job specification; if a job spec is given,
all processes in that job's pipeline are waited for. If n is not
given, all currently active child processes are waited for, and the
return status is zero. …Run Code Online (Sandbox Code Playgroud)