nohup and sed, redirecting stderr and stdout
문제
On my server nohup sleep 1 > nohup.out &
gives no help message. Good.
Running the same command on my laptop, I get: nohup: ignoring input and redirecting stderr to stdout
. Although the command still runs and completes correctly, I do not understand why there is a difference in the reporting of this message between my two machines. Fortunately, however, I can resolve this issue on my laptop by simply redirecting stderr and stdout to a file: nohup sleep 1 &> nohup.out &
So .... what I'm trying to do is implement a more useful command on my laptop:
The following works fine on my server and no message is reported:
nohup ls -1 *.txt | sed -e "s%\(.*\)%/home/user/scripts/script.pl -find \1 %" | sh > nohup.out &
This line of code "nohups" a piped list of files into sed, where they are run through script.pl
consecutively and executed in shell. script.pl
prints data to several files, and also prints some info to stdout. I capture this info by writing it to a file called nohup.out
Now when I run this one-liner on my laptop, I get nohup: ignoring input and redirecting stderr to stdout
. This is expected (but for reasons unknown to me). But when I modify the line to redirect stderr and stdout:
nohup ls -1 *.txt | sed -e "s%\(.*\)%/home/user/scripts/script.pl -find \1 %" | sh &> nohup.out &
I still get the message nohup: ignoring input and redirecting stderr to stdout
How can I fix my one-liner so that it runs on my laptop without receiving a message displayed?
올바른 솔루션이 없습니다