Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Would like to send Command output as mail ... How ?

Status
Not open for further replies.

TSch

Technical User
Jul 12, 2001
557
DE
Hi folks,

I'd like to send the "Error Output" of a command as mail.
So far I've created the following line:

./command 2> mail -s "The following error has occured" root

But it's not quite working right now ...
I also tried putting everything behind 2> into the following:

" " ' ' `` ´´

But nothing worked.

Any ideas how this might be accomplished ?

Thanks in advance !

Regards
Thomas
 

You have to use a pipe, not a redirection.
Try
./command 2 ¦ mail -s "The following error has occured" root Henrik Morsing
IBM Certified AIX 4.3 Systems Administration
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top