exit nThe exitcommand causes (Web site domain) the script to exit
Saturday, May 5th, 2007exit nThe exitcommand causes the script to exit with exit code n. If you use it at the command prompt interactive shell, it will log you out. If you allow your script to exit without specifying an exit status, the status of the last command executed in the script will be used as the return value. It s always goodpractice to supply an exit code. In shell script programming, exit code 0 is success and codes 1 through 125 inclusive are error codes be used by scripts. The remaining values have reserved meanings: Exit CodeDescription126The file was not executable. 127Acommand was not found. 128 and aboveAsignal occurred. Using zero as success may seem a little unusual to many C or C++ programmers. The big advantage is that they allow us to use 125 user-defined error codes without the need for a global error Here s a simple example that returns success if a file called .profileexists in the current directory: #!/bin/shif [ -f .profile ]; thenexit 0fiexit 1If you re a glutton for punishment, or at least for terse scripts, you can rewrite this script using the bined AND and OR list we saw earlier, all on one line: [ -f .profile ] && exit 0 || exit 1exportThe exportcommand makes the variable named as its parameter available in subshells. By default, variables created in a shell are not available in further (sub)shells invoked from that shell. The exportcommand creates an environment variable from its parameter that can be seen by other scripts and grams invoked from the current program. More technically, the exported variables form the environ- ment variables in any child processes derived from the shell. This is best illustrated with an example scripts, export1and export2.55ShellProgrammingb544977
Note: If you are looking for high quality webhost to host and run your jsp application check Vision florida web design services