DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   Shell Scripting (http://www.daniweb.com/forums/forum113.html)
-   -   exit (0) (http://www.daniweb.com/forums/thread124526.html)

saurya1979 May 16th, 2008 5:49 am
exit (0)
 
Hi,

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

Thanks
Saurya

eggi May 16th, 2008 6:38 pm
Re: exit (0)
 
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


All times are GMT -4. The time now is 5:37 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC