Is it possible to store all standard-out of a bash script and the binaries it calls in a log file AND still display the stdout on screen?
I know this is possible to store ALL stdout/stderr of a script to a single log file like:
exec 1>&${logFile}
exec 2>&1
But running a script with the above would make the script absolutely silent from the commandline, I was hoping for something like:
exec 1>& | tee -a ${logFile}
or
exec 1>& tee -a ${logFile}
But both of those fail.
And no, I don't have the option of modifying every outputable line in the script to have a (| tee -a ${logFile})