The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Profile scripts versus rc scripts.... rookie22 UNIX for Dummies Questions & Answers 1 09-17-2008 10:31 AM
mailx pradeep_desh Shell Programming and Scripting 2 06-06-2006 06:14 AM
mailx error message : mailx: NUL changed to @ BG_JrAdmin UNIX for Dummies Questions & Answers 2 12-01-2005 10:27 AM
mailx to to Dl sm321 Shell Programming and Scripting 1 07-16-2004 09:21 PM
Mailx skammer Shell Programming and Scripting 1 11-05-2002 02:53 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-04-2009
ak835 ak835 is offline
Registered User
  
 

Join Date: Apr 2008
Location: Mumbai,India
Posts: 77
Arrow mailx in scripts

Guys

if i wanna send a mail ,i just type

"mailx -s "test" <ak@abc.com>

without 'CTRL+d' interrupt,mail won be sent.

If i wish to achive this in a script,how do i handle the interrupt?

Regards
Abhi
  #2 (permalink)  
Old 06-04-2009
alyex alyex is offline
Registered User
  
 

Join Date: Jun 2009
Location: sh
Posts: 5
What you can do in a script is as below:

=======================================
mailx -s "test" whoever@wherever.com <<-EOF
hello
EOF
=======================================

You can use any word for "EOF" in the above example but it makes most sense as "End Of File/Input" is what ctrl-D does.

Make sure there is no indent before "EOF"
  #3 (permalink)  
Old 06-04-2009
ravager's Avatar
ravager ravager is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 128
SCRIPT bla
bla
mail_to="yourmail@mail1 othermail@mail"
/bin/mailx -s "`uname -n|tr '[a-z]' '[A-Z]'` Backup Report `" $mail_to < /tmp/bkp_monitor.log.$$

bla
#end script
  #4 (permalink)  
Old 06-04-2009
ak835 ak835 is offline
Registered User
  
 

Join Date: Apr 2008
Location: Mumbai,India
Posts: 77
Arrow

thanks guys.

If mailx is receiving input from say,'if' loop or 'cat' command,its sure going to end ,without a need of EOF signal.

I have two enviroments.On both envs,mailx is under 'if' loop.
On one env,'if' gets executed ,mail is sent ,script ends but on other env its stuck at mailx command.Why so?

Does mailx version make a diffrence?

Regards
Abhi
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:31 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