5

Wrapping a shell script with tee

view full story
linux-howto

http://unix.stackexchange.com – There is a bash script prints some logs and allows some arguments. The script prints the logs to STDOUT. Let's say the script's name is AAA.sh I'd also like to making the script to print the logs to STDOUT and a file. This can be done with tee. $ AAA.sh -a -b --c=d | tee 2012-07-03-080000.log But my team often forget using the tee. We should save the logs to file. So I'd like to wrap the script with tee. What I want to do is $ WrapAAAwithTee.sh -a -b --c=d Then AAAwithTee.sh should print the log to STDOUT and a log file. How can I wrap the AAA.sh? (HowTos)