•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 361,854 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,578 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 376 | Replies: 1
![]() |
•
•
Join Date: Oct 2007
Posts: 229
Reputation:
Rep Power: 1
Solved Threads: 20
Hey There,
I'm not 100% sure on this one, but I believe that "exit 0" or "exit" with any number afterward, causes the shell to exit, while exit(0) is a shell built-in that causes program termination. Generally, your program is running in a subshell that will terminate when your script terminates, so, practically, there's not much of a difference.
Anyone else? Interesting question
, Mike
I'm not 100% sure on this one, but I believe that "exit 0" or "exit" with any number afterward, causes the shell to exit, while exit(0) is a shell built-in that causes program termination. Generally, your program is running in a subshell that will terminate when your script terminates, so, practically, there's not much of a difference.
Anyone else? Interesting question

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
Similar Threads
- GUI Window - Exit Button? (Java)
- how to program the Exit function from the JFrame window? (Java)
- IE resets home page to "about blank" upon exit (Viruses, Spyware and other Nasties)
- How to exit without exit? (C++)
Other Threads in the Shell Scripting Forum
- Previous Thread: How to copy and paste line in shell script
- Next Thread: ed question


Linear Mode