Does nohup work across a pipe?

前端 未结 5 2030
悲哀的现实
悲哀的现实 2020-12-23 20:53

If I do

nohup cmd1 | cmd2 &

is that the same as

nohup \"cmd1 | cmd2\" &

?

I would like th

5条回答
  •  -上瘾入骨i
    2020-12-23 21:06

    No, you need to add the nohup to the commands separately.

    Something like this is recommended:

    nohup sh -c "cmd1 | cmd2" &
    

    Or alternatively:

    nohup $SHELL <

提交回复
热议问题