User Name Password Register
DaniWeb IT Discussion Community
All
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 375,216 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,319 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: 415 | Replies: 1
Reply
Join Date: May 2008
Posts: 1
Reputation: saurya1979 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
saurya1979 saurya1979 is offline Offline
Newbie Poster

exit (0)

  #1  
May 16th, 2008
Hi,

What is the difference between using exit 0 and exit (0) in the shell script?

Thanks
Saurya
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 247
Reputation: eggi is on a distinguished road 
Rep Power: 1
Solved Threads: 26
eggi eggi is offline Offline
Posting Whiz in Training

Re: exit (0)

  #2  
May 16th, 2008
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
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!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Shell Scripting Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 3:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC