Piping to mail and adding a subject line.
When I run a command or script and pipe it to mail, how do I add a subject line to the mail?
For example: rsync -av /home/ /b/home | mail email@gmail.com This will send the output, but without a subject line. Also, what if want to add some text in the body before the contents that are piped? |
How about putting the message in a text file or maybe using the here doc would work....
mail -s "howdy" me@mydomain.com < message.txt or mail -s "howdy" me@mydomain.com << EOF > this is a test > EOF |
All times are GMT -5. The time now is 10:19 PM. |