[Gllug] pipe data to mail body

ben f ben_m_f at yahoo.co.uk
Fri Feb 27 16:30:57 UTC 2004


> You can run the various things you want concatenated
> in a subshell, then
> send the output from that subshell to mail, like
> this:
> -----
> (echo Subject: stuff
> echo
> head -1 $log | awk '{print $1}'
> awk -f ~/sh/myextract.awk $log
> cat ~/.sig ) | mail -s 'test' root
> -----

Rich,

This was just the sort of construct I needed - thanks.

Couple of things:
1. Did you mean to put an echo in front of the "("
starting the subshell to feed it through the pipe?
I had to do this!

2. One side-effect is that the shell eats my newlines.
Is there a way to prevent the shell doing this?

Thanks,

Ben


	
	
		
___________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list