LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 04-14-2005, 12:25 AM   #1
sumitarun
LQ Newbie
 
Registered: Mar 2005
Posts: 8

Rep: Reputation: 0
Question Exiting the Shell script with Error MEssage


Suppose there is main shell script named "main.sh" which in turns calls "first.sh" and "second.sh". Now if there is some problem in first.sh then it no furhter processing should occur and the program does not execute the seond.sh and exits from all the shell script inculding the main.sh. ANd while doing so, a error message should be logged in the log file.
 
Old 04-14-2005, 12:29 AM   #2
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
Did you consult this doc before?
http://www.tldp.org/LDP/abs/html/
 
Old 04-14-2005, 12:39 AM   #3
sumitarun
LQ Newbie
 
Registered: Mar 2005
Posts: 8

Original Poster
Rep: Reputation: 0
I had checked that document but it was of not much help. Could anyone proide some immediate code for it. Iam in great need.

Last edited by sumitarun; 04-14-2005 at 12:41 AM.
 
Old 04-14-2005, 12:46 AM   #4
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
It is a very bold statement that the doc is "not much help". All you need is already present in the example sections.
 
Old 04-14-2005, 12:54 AM   #5
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
If you can show us what you have done so far, I can try to help you to fix your problem.
 
Old 04-14-2005, 01:10 AM   #6
ahh
Member
 
Registered: May 2004
Location: UK
Distribution: Gentoo
Posts: 293

Rep: Reputation: 31
You need to make use of the exit status.

http://www.tldp.org/LDP/abs/html/exit-status.html
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script q's (io, error exiting ) dave bean Programming 6 02-17-2005 01:24 AM
shell error messages not displayed as a message box!!! user222 Linux - General 10 10-25-2004 01:11 AM
how to produce pop-up message box / alert window from shell script peb Linux - Newbie 3 02-25-2004 03:14 AM
login message shell script? jczr2 Linux - Newbie 22 05-28-2003 09:10 PM
remote shell error message slice4e Linux - General 1 05-12-2003 08:55 PM


All times are GMT -5. The time now is 10:47 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 Google+: linuxquestions
Open Source Consulting | Domain Registration