s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
3.1. exit and exit statusThe exit command may be used to terminate a script, just as in a C program. It can also return a value, which is available to the shell. Every command returns an exit status (sometimes referred to as a return status ). A successful command returns a 0, while an unsuccessful one returns a non-zero value that usually may be interpreted as an error code. Likewise, functions within a script and the script itself return an exit status. The last command executed in the function or script determines the exit status. Within a script, an exit nn command may be used to deliver an nn exit status to the shell (nn must be a decimal number in the 0 - 255 range). $? reads the exit status of script or function. Example 3-1. exit / exit status
|