Reputation: 303
I'm using this code to write all terminal's output to the file
exec > >(tee -a "${LOG_FILE}" )
exec 2> >(tee -a "${LOG_FILE}" >&2)
How to tell it to stop? If, for example, I don't want some output to get into log..
Thank you!
Upvotes: 0
Views: 1996
Reputation: 37268
It's not completely clear what your goal is here, but here is something to try.
Do you know about the script
utility? You can run script myTerminalOutputFile
and any commands and output after that will be captured to myTerminalOutputFile
. The downside is that it captures everything. You'll see funny screen control chars like ^[[5m;27j
. So do a quick test to see if that works for you.
To finish capturing output just type exit
and you are returned to you parent shell cmd-line.
Warning: check man script
for details about the inherent funkyness of your particular OS's version of script. Some are better than others. script -k myTerminalOutputFile
may work better in this case.
IHTH
Upvotes: 2