Re: mailing output
From: James Jackson (James.Jackson_at_MAIL.STATE.AR.US)
Date: 07/31/03
- Previous message: Green, Simon: "Re: AIX equivalent to HP's 'glance' cmd?"
- Maybe in reply to: Shawn Bierman: "mailing output"
- Next in thread: Black, Brian: "Re: mailing output"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 31 Jul 2003 10:00:19 -0500 To: aix-l@Princeton.EDU
Try piping the output from the command to mailx:
Ex. "ls -al | mailx -s "subject" <recipient>"
If you want to send the contents of a file to mailx, use cat:
Ex. "cat <filename> | mailx -s "subject" <recipient>"
HTH,
JJackson
-----Original Message-----
From: Shawn Bierman [mailto:BiermanS@METHODISTHEALTH.ORG]
Sent: Thursday, July 31, 2003 9:45 AM
To: aix-l@Princeton.EDU
Subject: mailing output
Greetings,
I am having a bit of trouble with a script that should email root the
output of a command but also have a subject line.
Currently we just run the command from cron and it gets sent to root's
email but with a subject line. So, I thought i would make a script that
added the subject.
I was hoping for something as easy as:
mail -s"subject line" root | ls -la
even when I output the command to a file and then try to redirect I get
failures.
mail -s"subject line" root < somefile
mail complains of unknow users 'subject' and 'line'.
Is there a simple way?
- Previous message: Green, Simon: "Re: AIX equivalent to HP's 'glance' cmd?"
- Maybe in reply to: Shawn Bierman: "mailing output"
- Next in thread: Black, Brian: "Re: mailing output"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: mail command option for return address on linux
... I am migrating/porting Solaris scripts to Linux Platform. ... One of script
uses mailx command on Solaris and we don't have mailx on ... At the time that was, amongst
others, used in News control ... (comp.mail.misc) - Re: mailing output
... I am having a bit of trouble with a script that should email root the
... Currently we just run the command from cron and it gets sent to root's ... (AIX-L) - Re: mailx error "Unknown tilde escape"
... Todd> I am receiving this error from command line using mailx. ...
Neil> Make sure that your message does ... (comp.unix.solaris) - mail command option for return address
... I am migrating/porting Solaris scripts to Linux Platform. ... One of
script uses mailx command on Solaris and we don't have mailx on ... Instead we are using
mail command. ... (linux.redhat) - mail command option for return address on linux
... I am migrating/porting Solaris scripts to Linux Platform. ... One of
script uses mailx command on Solaris and we don't have mailx on ... Instead we are using
mail command. ... (comp.mail.misc)