linux - 两个 linux 命令之间有多少延迟?如果第一个运行 &

标签 linux background-process prompt

基本上我是在写一份报告让听众相信下面的 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/

相关文章:

php - 当用户获取页面时,如何在服务器端启动 PHP 后台进程?

git - 在 bash 提示符下为 git status 设置颜色

php - "php_connect_nonb() failed: Operation now in progress (115)"间歇性发生

c - 可执行文件之间有什么区别?

创建多代子进程

python - 在 Django 中启动后台任务的简单方法

python - 这是在Python中获取窗口大小的方法

service - 如何在 Android TV Oreo 中始终运行服务/守护进程?

Bash 脚本用户输入提示

windows - 将 txt 文件中的阿拉伯文文本显示到 cmd 提示符