why not use tee? because the terminal rendering of the output makes the application run slower.
for some reason, this is not working:
application 2>&1 >"$logFile"
the output keeps going to terminal..
why not use tee? because the terminal rendering of the output makes the application run slower.
for some reason, this is not working:
application 2>&1 >"$logFile"
the output keeps going to terminal..
You have redirected
stderr
tostdout
(the terminal), then you've redirectedstdout
to a file. In conclusion, you haven't redirectedstderr
to the file:stderr -> stdout
,stderr
goes to the terminal.stdout -> $logfile
,stdout
goes to the$logfile
.Try using the following:
Notice the order matters:
stdout -> $logfile
,stdout
goes to$logfile
.stderr -> stdout -> $logfile
,stderr
goes tostdout
which is the same as$logfile
.