LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 12-21-2007, 09:58 AM   #1
tostay2003
Member
 
Registered: Jun 2006
Posts: 126

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
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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: 126

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
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
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: 126

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


Reply



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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:20 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration