bash background tasks

本文深入探讨了在bash shell中如何正确地将命令后台运行,理解其与标准输入、输出和错误流的关系,以及shell如何管理这些进程。通过详细解释管道作业的概念和bash对job控制的实现,读者将掌握如何有效地组织和控制shell脚本中的多个命令执行流程。

Append & after the command detaches it from stdin which means the shell isn’t tied up by the command and you can execute other commands.

However, the command process is still managed by the shell and stdout and stderr are still attached to the shell session.

This means that when the shell session ends (you close your terminal window, exit ssh, etc) the command’s process is sent a HUP signal, which usually terminates the command.


The shell associates a job with each pipeline. It keeps a table of currently executing jobs, which may be listed with the jobs command.

All of the processes in a single pipeline are members of the same job. Bash uses the job abstraction as the basis for job control.

To facilitate the implementation of the user interface to job control, the operating system maintains the notion of a current terminal process group id.

References

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值