LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-21-2007, 09:58 AM   #1
tostay2003
Member
 
Registered: Jun 2006
Posts: 125

Rep: Reputation: 15
script exits


I have this below statement at the end of the script. And the script is exiting immediately after this statement is executed. It is not going to next line. The below statements is successfully sending mail.
Code:
mailx -s "${THIS_SCRIPT} $finished." $EMAIL_USERS << End_of_Mail 
Shell script : ${THIS_SCRIPT} 
$EMAIL_MSG 
END_OF_MAIL
 
Old 12-21-2007, 10:07 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: OpenSUSE 12.1 CentOS 6.2
Posts: 9,012

Rep: Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353Reputation: 1353
Code:
mailx -s "${THIS_SCRIPT} $finished." $EMAIL_USERS << End_of_Mail 
Shell script : ${THIS_SCRIPT} 
$EMAIL_MSG 
END_OF_MAIL
Remember the Unix/Linux shells are case sensitive!
 
Old 12-24-2007, 08:54 AM   #3
tostay2003
Member
 
Registered: Jun 2006
Posts: 125

Original Poster
Rep: Reputation: 15
Thank you, didn't have a look at that

Last edited by tostay2003; 12-26-2007 at 08:12 AM.
 
Old 12-24-2007, 05:00 PM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Etch/Lenny/Squeeze
Posts: 3,485

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
This is very useful debugging shell scripts:
Code:
$ sh -x yourscript
Each line is echoed on the screen as it is executed, great help beyond inserting echo statements.

jlinkels
 
Old 12-26-2007, 08:13 AM   #5
tostay2003
Member
 
Registered: Jun 2006
Posts: 125

Original Poster
Rep: Reputation: 15
Wow jlinkels. That saves lot of my time using echo statements
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pppd exits after 2 minutes ebasi Linux - Software 0 10-10-2006 08:09 AM
firefox just exits bloodiestmarry Linux - Software 6 01-12-2006 11:04 AM
Ethereal exits when accessing help mikemrh9 Linux - Software 0 01-04-2005 08:39 AM
LIRC Exits.... Aeiri Linux - Hardware 0 06-13-2004 07:55 PM
Flagging exits in Bash Script dtheorem Programming 5 11-08-2003 10:15 PM


All times are GMT -5. The time now is 05:19 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration