How to redirect standard output to multiple log files Following seems to be not working. Any help is appreciated.
some_command 1> output_log_1 output_log_2 2>&1
Let's say your output is generated from a function,
To redirect the output from
This will work for multiple files, given any data source piping to tee:
This will also work:
For example, if this is run from the console, you'll see the output there. Run from a crontab, the output will appear the status message which is mailed to you (also see Gilles' answer here http://unix.stackexchange.com/a/100833/3998).
This worked for me in bash on Ubuntu 12.04, and has been verified in Ubuntu 14.04 using GNU bash 4.3.11(1), so it should work on any recent GNU bash version.
Unable to comment, however, another way to express
Could be simplified to this, when dealing with many files.