shell - "&!"(与号和感叹号)在linux shell中是什么意思

标签 shell

我发现有些人在 shell 中运行程序是这样的

exe > the.log 2>&1 &!

我理解第一部分,它将stderr重定向到stdout,“&”也表示在后台运行程序,但我不知道“&!”是什么意思意思是,感叹号是什么意思?

最佳答案

zsh命令 &!disown 的快捷方式,即程序不会在退出调用 shell 时被杀死。
man zshbuiltins

disown [ job ... ]
job ... &|
job ... &!

Remove the specified jobs from the job table; the shell will no longer report their status, and will not complain if you try to exit an interactive shell with them running or stopped. If no job is specified, disown the current job. If the jobs are currently stopped and the AUTO_CONTINUE option is not set, a warning is printed containing information about how to make them running after they have been disowned. If one of the latter two forms is used, the jobs will automatically be made running, independent of the setting of the AUTO_CONTINUE option.

关于shell - "&!"(与号和感叹号)在linux shell中是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44893896/

相关文章:

linux - 需要搜索模式并打印其下一个值

linux - 如何制作 bash/shell 脚本来为命令生成 'shortcut'

azure - 如何将 az keyvault Secret list -o table 输出存储在数组中? Azure CLI、Shell 脚本

linux - CSV 文件 bash 脚本中的平均值

php - 硬盘温度不会通过网络显示

shell - 如何在建立 mosh 连接时运行复杂的命令?

linux - 执行csh脚本时如何显示行号?

excel - 将 xlxs 文件转换为 csv

linux - 如何从 shell 脚本中的命令输出中获取字符串模式?

node.js - 在不使用额外的 NPM 包的情况下检查 package.json 是否在 shell 脚本中具有特定名称的脚本