I would like to grab the output of a command and save it to a file as well as displaying it on the screen (which it does by default), is this possible? I was able to get one or the other but not both.
Write () # Display a message on screen and log to a file
# usage: Write "[Your message here]"
{
MESSAGE="$1"
eval "echo \"$MESSAGE\""|tee -a $LOG_FILE
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.