Re: mailing output

From: Barry Finkel (b19141@ACHILLES.CTD.ANL.GOV)
Date: Fri Aug 01 2003 - 09:06:42 EDT


John Jolet <john.jolet@FXFN.COM> replied:

>>> ls -l |mail -s "subject line" root should work.....does it work from the command line?

Bill Verzal <BVerzal@KOMATSUNA.COM> replied:

>> Odd - the command 'mail -s"subject line" root < somefile' works fine for
>> me.

James Jackson <James.Jackson@MAIL.STATE.AR.US> replied:

>If you want to send the contents of a file to mailx, use cat:
>
>Ex. "cat <filename> | mailx -s "subject" <recipient>"

The difference between the first two is the input to the "mail" command.
In the first case the input is the output of the "ls -l" command,
so a pipe is required.

In the second case, the input is already in a file, so redirection
of the "mail" command stdin works.

In the third case, you are piping the file to stdin of the "mail"
command. This is equivalent of the second case. I prefer the
second case to the third case, but I assume that the difference
in execution time is minimal.
----------------------------------------------------------------------
Barry S. Finkel
Computing and Instrumentation Solutions Division
Argonne National Laboratory Phone: +1 (630) 252-7277
9700 South Cass Avenue Facsimile:+1 (630) 252-4601
Building 222, Room D209 Internet: BSFinkel@anl.gov
Argonne, IL 60439-4828 IBMMAIL: I1004994



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:06 EDT