The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
MailX rajani_p UNIX and Linux Applications 0 10-22-2007 09:14 PM
Solaris 9 mailx problems csaunders SUN Solaris 5 05-18-2006 11:03 AM
mailx error message : mailx: NUL changed to @ BG_JrAdmin UNIX for Dummies Questions & Answers 2 12-01-2005 06:27 AM
how to send mails to users on exchange server from sendmail/solaris(mailx) ganeshh SUN Solaris 5 11-17-2005 08:51 PM
mailx command (Sun Solaris 8) cczerwin Shell Programming and Scripting 2 07-16-2004 01:08 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2006
Supporter
 

Join Date: Oct 2006
Posts: 40
Need Help w/mailx - Sun Solaris

I have this Legato application which generates a file and then it pipes it to mailx.

cat << savelog.txt | mailx -s "Saverpt `date +"%c`" myemail@xxx.com

The "savelog.txt does get created and is owned by root and other group, but yet will not email using mailx to myemail@xxx.com.

Mailx emails me from "root" instead of the application user and only emails the "Subject Line" and not the text file. Can someone assist why this is happening.

When I am logged in as myself (userme) and run the script from the command line I get the email fromt userme@xxx.com and the contents of the file in the email. So what is different.

Last edited by gzs553; 10-13-2006 at 12:49 PM.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-13-2006
Registered User
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 395
I don't know why you're doing a cat << savelog.txt but remove the "<<"'s. Just use

Code:
cat savelog.txt | mailx -s "Saverpt `date +"%c`" myemail@xxx.com
or

Code:
mailx -s "Saverpt `date +"%c`" myemail@xxx.com < savelog.txt

Carl
Reply With Quote
  #3 (permalink)  
Old 10-13-2006
Supporter
 

Join Date: Oct 2006
Posts: 40
Th application is running a report and the output of the report is being catted to the savetext.log and then being mailed.

cat << pathname/savtext.log | mailx
Reply With Quote
  #4 (permalink)  
Old 10-13-2006
Supporter
 

Join Date: Oct 2006
Posts: 40
The savelog.txt{date} is dated, so It is immediately emailed.

Last edited by gzs553; 10-14-2006 at 07:02 AM. Reason: Correct syntax
Reply With Quote
  #5 (permalink)  
Old 10-19-2006
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 629
my guess is you have a path problem ... when you run the script manually, you probably cd'd to the directory where the log file exists at ... however, the automated job probably does not know where the log file is and cannot redirect it to cat so it cannot send anything aside from the subject line ... confirm the path requirements and you should be okay ...
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:02 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0