[plug] mail command

Craig Ringer craig at postnewspapers.com.au
Tue Jan 10 14:05:40 WST 2006


Russell Steicke wrote:

> It's waiting for you to type the body of the email.  Try one of these:
> 
>   $ mail -s test username < body
> 
>   $ echo message | mail -s test username
> 
> Or if you want to send an empty message:
> 
>   $ mail -s test username < /dev/null

This is also a suitable use for shell here documents:

mail -s test $username <<__END__
Hi $username
You can use shell variable substitutions here, including arrays and all 
the extended substitions.
First letter of username: ${username:0:1}
.
__END__

--
Craig Ringer



More information about the plug mailing list