Home > OS >  The nohup command can what all don't output
The nohup command can what all don't output

Time:11-10

Such as title, the background is another working group to write a shell, shell I need with his shell tunes, and my shell contains nohup background in parallel, because nohup will automatically prompt process, so that the shell of his judgment error, and can only be 0,,, give a way for bosses,

CodePudding user response:

Try it like this:
Nohup cmd_xxx & gt;/dev/null 2 & gt; & 1 & amp;

/dev/null 2 & gt; & 1 role is to make the standard output to/dev/null (discarding the standard output), and then the error output from the reuse standard output descriptor, so the error output also are directed to the/dev/null, error output is also rejected,

CodePudding user response:

reference 1st floor glen30 response:
try it like this:
Nohup cmd_xxx & gt;/dev/null 2 & gt; & 1 & amp;

/dev/null 2 & gt; & 1 role is to make the standard output to/dev/null (discarding the standard output), then the error output from the reuse standard output descriptors, so the error output also are directed to the/dev/null, error output is also rejected,

The need to write 2 & gt; & 1, again write & gt;/dev/null,

Write the semantics of the standard error is to follow the standard input, standard input to follow/dev/null, can form a chain

, in turn, is the standard input to follow/dev/null, standard error to follow the standard input, but then the standard error actually don't know the standard input is redirected, cause there is a problem
  • Related