101 reputation
bio website keymon.wordpress.com
visits member for 2 years, 6 months
seen Mar 20 at 13:08

comment Force bash script to use tee without piping from the command line
Really cool. I tested this on Solaris with bash 3.00.16 and it works. You can also use this to keep both stderr and stdout output in the script, and write everything to the same file. You spawn 2 tee in this case: exec > >(tee -a test.sh.$$.log); exec 2> >(tee -a test.sh.$$.log 1>&2)