简体   繁体   中英

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.

For disown it completely from the shell you need to do: my_process & and then disown %1

UPDATE

According to the information that the command &| ran on zsh the &| 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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