LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-22-2011, 04:11 AM   #1
narayanan02
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: Disabled
Smile Java: System.exit(0) vs. System.exit(1)


give answer for this question in detail
 
Old 05-22-2011, 08:33 AM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
The exit code of a program basically says if it succeeded. 0 usually means success, and another number means faliure.

This is very useful in command-line applications. The bash shell uses it to enable you to do stuff like this:

Code:
# run command2 only of command1 is successful
command1 && command2

# run command2 only if command1 failed
command1 || command2

# run command2 and command3 over and over while command1 succeeds
while command1
do
    command2
    command3
done
 
  


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
system command ; how to exit? kewl Linux - Software 1 07-08-2009 02:04 AM
Exit status of system command?? rmvinodh123 Programming 4 05-04-2007 11:15 AM
Exit X Window System session Azzath Linux - Software 4 01-04-2005 02:38 AM
system freezes when exit X shanenin Linux - Software 0 09-10-2004 03:24 PM


All times are GMT -5. The time now is 12:33 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration