Open liuty10 opened 4 years ago
https://unix.stackexchange.com/questions/80707/how-to-output-text-to-both-screen-and-file-inside-a-shell-script
command | tee -a "$log_file" tee saves input to a file (use -a to append rather than overwrite), and copies the input to standard output as well.
update-client 2>&1 | tee my.log 2>&1 redirects standard error to standard output, and tee sends its standard input to standard output and the file.
https://unix.stackexchange.com/questions/80707/how-to-output-text-to-both-screen-and-file-inside-a-shell-script
command | tee -a "$log_file" tee saves input to a file (use -a to append rather than overwrite), and copies the input to standard output as well.
update-client 2>&1 | tee my.log 2>&1 redirects standard error to standard output, and tee sends its standard input to standard output and the file.