Stupid scripting question -- FAQ-ish

Kurt Wall kwall
Mon May 17 11:43:16 PDT 2004


Feigning erudition, Tim Wunder wrote:
% On Monday 20 January 2003 1:21 pm, someone claiming to be Net Llama! wrote:
% > On Mon, 20 Jan 2003, Tim Wunder wrote:
% > > On 1/20/2003 12:38 PM, someone claiming to be Net Llama! wrote:
% > > > A non-sendmail specific version:
% > > > mail -s "GNUCash update" tim at thewunders.org < "message f00"
% > >
% > > <snip>
% > >
% > > I was trying this, but it would fail on me. I just tried again and bash
% > > gives me this error:
% > > bash: message f00: No such file or directory
% > >
% > > Maybe some kind of RH8-ism is preventing this from working :-(
% > > Although I rather think it's user error...
% >
% > ahhh..try redirecting a file, rather than "message f00", and it should
% > work.  there are other ways, like cat'ing something or echo'ing it.
% 
% Redirecting a file works, but how would I go about cat'ing or echo'ing an 
% environment variable?
% 
% I tried:
% export MSG="Some Message"
% mail -s "Mail Test" tim at thewunders.org < /bin/echo $MSG

echo $MSG | mail -s "Mail Test" tim at thewunders.org 

echo "some long text here" | mail -s "Mail Test" tim at thewunders.org



More information about the Linux-users mailing list