Send to email and stdout: Difference between revisions
(Created page with "From a shell script I often want to send an email and also echo the message to stdout. Here's a simple way of getting this done: <geshi lang="bash"> #!/bin/bash tee >(mail -...") |
mNo edit summary |
||
Line 11: | Line 11: | ||
</geshi> | </geshi> | ||
[[Category | [[Category:Bash]] |
Latest revision as of 11:18, 26 June 2013
From a shell script I often want to send an email and also echo the message to stdout. Here's a simple way of getting this done:
<geshi lang="bash">
- !/bin/bash
tee >(mail -s "Test tee" ${USER}) <<EOF a b c EOF </geshi>