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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sh, Bourne Problem with getting lines in a file kdyzsa Shell Programming and Scripting 1 05-08-2008 11:28 PM
please give a bourne script to this problem raj1811 Shell Programming and Scripting 1 09-30-2006 04:36 PM
mail script problem using cgi unknown2205 UNIX for Dummies Questions & Answers 1 03-08-2006 06:10 AM
bourne script help Heedunk Shell Programming and Scripting 1 02-05-2004 08:49 PM
simple Bourne problem pnxi Shell Programming and Scripting 5 09-09-2003 08:33 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 12-12-2001
Priest_Ridden Priest_Ridden is offline
Registered User
  
 

Join Date: Dec 2001
Posts: 5
Question bourne mail script problem

Hey there,

Just have a quick question. i've written a program and it needs to
send a email to confirm it's completed. now i've done the

mail -s "Subject" test@test.com

the problem is the program, when run just waits. it doesn't execute the next command unless i press ^D. is there away for it to just send a mail without a body and go on without having to press ^D

thanks
priest_ridden
  #2 (permalink)  
Old 12-12-2001
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 499
That because it's waiting on the body of the message to be included. If it's excluded it expects standard input to provide the content.

Over come it by trying ...
mail -s "Everest AU - CPU Monthly Report." \
TEST@TEST.com.au < $xcpudir\data/cpu$CurrYr$PrevMth\.data


Hope that helps - and that I've explained it clearly enough.
  #3 (permalink)  
Old 12-12-2001
Priest_Ridden Priest_Ridden is offline
Registered User
  
 

Join Date: Dec 2001
Posts: 5
Ok, I think I get what you're saying.

< $xcpudir\data/cpu$CurrYr$PrevMth\.data

if i'm off let me know.

the first part is the current dir of the program and the rest just sends date information for the body so the progrm will keep running.

hope i understood that right.

thanks
  #4 (permalink)  
Old 12-12-2001
Priest_Ridden Priest_Ridden is offline
Registered User
  
 

Join Date: Dec 2001
Posts: 5
well i looked at it some more and i figured it out thanks a lot
i just did this and it seems to work out

Code:
mail -s "Subject" test@test.com <usr/home/mail/$USER >/dev/null 2>&1
and now everything works just fine

Last edited by Priest_Ridden; 12-12-2001 at 01:49 AM..
  #5 (permalink)  
Old 12-12-2001
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 499
Sorry, my example may not have been entirely understandable.


3. To send a file to another user, enter:
mail fran < proposal

This command sends the contents of the file proposal to fran.

Hope that helps.
  #6 (permalink)  
Old 12-12-2001
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 499
Just saw your reply - you're quick.

Never knew about: mail -s "Subject."TEST@TEST.com /dev/null 2>&1

Learning something new everyday.
  #7 (permalink)  
Old 12-12-2001
Priest_Ridden Priest_Ridden is offline
Registered User
  
 

Join Date: Dec 2001
Posts: 5
I'd be even quicker if i would have used the code format before i typed my last message. lol

i think before the /dev/null that you need >

though i could be wrong
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 04:24 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