I need to write the standard err and standard output to
$LOG, while also having them printed on console, from within a script.
The script has many commands, so redirecting each one of them is not a good solution.
I've tried this, but it didn't work as expected:
#!/bin/bash LOG=/var/tmp/log #... exec > $LOG 2>&1
My target is to write to
$LOG on any standard output and standard error,
but on the same time also to the standard output (on console). Is it possible?