debuti
November 11th, 2008, 05:55 PM
Hi all.
I'm making a bash script.
I want it's output is printed to the console as well as to a file.
How to do that ?
Currently I do that plainly stupid like this
-----------------------
LOG=/var/log/mylog
echo Hello
echo Hello >> $LOG
echo Hello again
echo Hello again >> $LOG
echo Another hello again
echo Another hello again >> $LOG
---------------------
There must be a smarter way. Please show me. Thanks
I'm making a bash script.
I want it's output is printed to the console as well as to a file.
How to do that ?
Currently I do that plainly stupid like this
-----------------------
LOG=/var/log/mylog
echo Hello
echo Hello >> $LOG
echo Hello again
echo Hello again >> $LOG
echo Another hello again
echo Another hello again >> $LOG
---------------------
There must be a smarter way. Please show me. Thanks