Send to email and stdout

From EggeWiki
Revision as of 07:18, 26 June 2013 by Brianegge (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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">

  1. !/bin/bash

tee >(mail -s "Test tee" ${USER}) <<EOF a b c EOF </geshi>