我发现有些人在 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/