基本上我是在写一份报告让听众相信下面的 Linux 命令
$ a.sh &
$ b.sh &
$ c.sh &
几乎同时启动。我找不到一个好的解释或可靠的来源来说服观众。有没有专门讨论这个的书籍或文章?谢谢。
最佳答案
来自 Bash 文档
If a command is terminated by the control operator ‘&’, the shell executes the command asynchronously in a subshell. This is known as executing the command in the background. The shell does not wait for the command to finish, and the return status is 0 (true). When job control is not active (see Job Control), the standard input for asynchronous commands, in the absence of any explicit redirections, is redirected from /dev/null.
有关更多详细信息,请查看 Bash tutorial
关于linux - 两个 linux 命令之间有多少延迟?如果第一个运行 &,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20943395/