-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Linux Essentials - Second Edition
By :

Ordinarily, a script’s return value is the same as the last command the script called; that is, the script returns $?. You can control the exit value, however, or exit from the script at any point, by using the exit command. Used without any options, exit causes immediate termination of the script, with the usual exit value of $?. This can be useful in error handling or in aborting an ongoing operation for any reason—if the script detects an error or if the user selects an option to terminate, you can call exit to quit.
If you pass a numeric value between 0 and 255 to exit, the script terminates and returns the specified value as the script’s own exit value. You can use this feature to signal errors to other scripts that might call your own script. You may have to include extra code to keep track of the causes of abnormal termination, though. For instance, you might set aside a variable (say, $termcause) to hold the cause of...
Change the font size
Change margin width
Change background colour