[Gllug] pipe data to mail body

Xander D Harkness xander at harkness.co.uk
Fri Feb 27 16:50:30 UTC 2004

On Fri, 2004-02-27 at 15:52, ben f wrote:
> Hi everyone,
> quick query:
> I want to receive an e-mail that has several outputs
> in it. e.g.
> awk -f ~/sh/myextract.awk $log | mail -s 'test' root
> So the output of the awk script gets sent as the mail
> body. But (!), I also want other outputs to go into
> it, such as:
> head -1 $log | awk '{print $1}'
Have a look at tee  this allows you to divert from standard input.

Hence you can direct one copy of the output to one stream and the other
output elsewhere :-)

I am not sure whether I read your email correctly; however tee is a
pretty funky command anyway :-)

Kind regards

Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list