Nohup: ignoring input – what does it mean

nohup

I am using nohup command from a while like

nohup bash life.bash > nohup.out 2> nohup.err &

In the nohup.err file I always have a line nohup: ignoring input. Can you please help me figure out what it means?

Best Answer

That’s just nohup telling you what it’s set up; it outputs that to its standard error, which you’ve redirected to nohup.err. You can avoid the message by redirecting its standard input:

nohup bash life.bash > nohup.out 2> nohup.err < /dev/null &

nohup checks its standard input, standard output and standard error to see which are connected to a terminal; if it finds any which are connected, it handles them as appropriate (ignoring input, redirecting output to nohup.out, redirecting error to standard output), and tells you what it’s done. If it doesn’t find anything it needs to disconnect, it doesn’t output anything itself.

Related Question