home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: exec Chapter 4
The Bourne Shell and Korn Shell
Next: Reference: export






Exit a shell script with status n (e.g., exit 1 ). n can be 0 (success) or nonzero (failure). If n is not given, exit status will be that of the most recent command. exit can be issued at the command line to close a window (log out).

if [ $# -eq 0 ]; then
   echo "Usage:  $0 [-c] [-d] file(s)"
   exit 1	# Error status

Previous: Reference: exec UNIX in a Nutshell: System V Edition Next: Reference: export
Reference: exec Book Index Reference: export

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System