简体   繁体   English

&|是什么 是指外壳?

[英]What does &| mean in shell?

Put &| 放入&| on the end of a command seems to detach the process from the shell. 在命令末尾,似乎将进程与外壳分离。 But where does it come from? 但是它是从哪里来的呢? and what's the right way to use it? 什么是正确的使用方式?

& will cause the process to be detached from the parent process (which in this case is the shell), but won't be disowned from it, which means when you'll close the shell, the process you started will be closed as well. &会导致该进程与父进程(在本例中为shell)分离,但不会从父进程中消失,这意味着当您关闭shell时,启动的进程也会被关闭。 。

For disown it completely from the shell you need to do: my_process & and then disown %1 要完全将其从外壳中my_process &您需要执行以下my_process &my_process & ,然后disown %1

UPDATE UPDATE

According to the information that the command &| 根据该信息,命令&| ran on zsh the &| zsh上运行&| means: 手段:

&| &| - backgrounds the final command of the pipeline. -后台管道的最终命令。

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. 如果未指定任何作业,请放弃当前作业。

& will run the process in background. &将在后台运行该过程。 It will not occupy the terminal no more and wait it until finish. 它将不再占用终端并等待完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM