ot: mail flag for attachment in unix

Kenneth Brody kenbrody at spamcop.net
Thu Oct 1 06:12:06 PDT 2009


Dennis Malen wrote:
> Here's the last conundrum. What I now wanted to do was to send a script that 
> attaches a file to the email and also writes a message in the body of the 
> email.
> 
> I attempted to use:
> 
> uuencode /tmp/emccx.xls emcc.xls | mail -s "test3" dmalen at malen.com <tryftp

That can't work.  This says:

    run uuencode and send its stdout through a pipe to mail's stdin.
    run mail, and redirect stdin from tryftp.

So, uuencode sends its output through the pipe, but you have told mail not 
to read from the pipe.

You can't have two stdin streams.

[...]

-- 
Kenneth Brody


More information about the Filepro-list mailing list