Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-22-2011, 05:11 AM   #1
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, 09:33 AM   #2
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:

# 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


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 03:04 AM
Exit status of system command?? rmvinodh123 Programming 4 05-04-2007 12:15 PM
Exit X Window System session Azzath Linux - Software 4 01-04-2005 03:38 AM
system freezes when exit X shanenin Linux - Software 0 09-10-2004 04:24 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:54 PM.

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