How can I exit from command prompt from shell file?
shell file contains :
if(); then // some unix code here else // want to exit from cmd prompt or Kill current cmd prompt fi
can any knows @ it?
Like Chris Down, I'm going to assume that you are using GNU bash. Other shells may be different, but the general idea should be the same.
In bash, the environment variable
You can ask the user whether to exit using a construct like the following.
If it is available, you can use GNU
I assume that you mean you want to kill the interactive shell that the script was forked from. I also assume that that shell is
If you are sourcing the script in that shell, just use
Or, in shells without