I have a shell command like this
sudo nohup coffee -c -w *.coffee &
disown $!
wait
but when I run the shell scrit it says nohup: appending output to 'nohup.out'
and makes me hit enter.
How do I get around having to hit enter?
8 year old thread, but I found that none of these answers really solve the issue in the question.
The message nohup: ignoring input and appending output to 'nohup.out'
is piped through stderr (AFAIK), so in order to silence that message, all you have to do is to redirect stderr to /dev/null
, like so:
nohup mycommand 2> /dev/null
However, if you additionally want to run this process in the background with &
, you will find that (for bash at least), there will be a single line output of the job number and PID (e.g. [1] 27184
). To avoid this, run the entire command in a subshell, like so:
(nohup my command 2> /dev/null &)
But if you're using this in a script, the former solution is sufficient.
As far as I understand, you don't have to. The message is output to the console, but not added to your input buffer. Therefore you can just continue typing your commands in as if there were no message from nohup
, the message will not interfere with your input.
Well, having to type not from the exact prompt position may be aesthetically not so pleasing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With