The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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-23-2007 12:14 AM
Solaris 9 mailx problems csaunders SUN Solaris 5 05-18-2006 02:03 PM
mailx error message : mailx: NUL changed to @ BG_JrAdmin UNIX for Dummies Questions & Answers 2 12-01-2005 10:27 AM
how to send mails to users on exchange server from sendmail/solaris(mailx) ganeshh SUN Solaris 5 11-18-2005 12:51 AM
mailx command (Sun Solaris 8) cczerwin Shell Programming and Scripting 2 07-16-2004 04:08 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-13-2006
gzs553 gzs553 is offline VIP Member  
Supporter
  
 

Join Date: Oct 2006
Posts: 42
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 03:49 PM..
  #2 (permalink)  
Old 10-13-2006
BOFH BOFH is offline Forum Advisor  
Registered User
  
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 406
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
  #3 (permalink)  
Old 10-13-2006
gzs553 gzs553 is offline VIP Member  
Supporter
  
 

Join Date: Oct 2006
Posts: 42
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
  #4 (permalink)  
Old 10-13-2006
gzs553 gzs553 is offline VIP Member  
Supporter
  
 

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

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

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
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 ...
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0