I am looking forward to run commands and log their output in a temporary log file to be read later on by different processes.
So, for example: rc.d start ntpd > progress.txt
Returns:
::
Daemon script
ntpd
does not exist or is not executable.
I assume, that since it's an error it doesn't get redirected, but, is there a way to force redirect everything to file?
Best Answer
You only redirect
STDOUT
toprogress.txt
but errors are normally written toSTDERR
.To redirect both
STDOUT
andSTDERR
toprogress.txt
try:You'll find many additional information on this topic if you search for io-redirection.