Heinrich Schuchardt | 627b57b | 2021-01-20 12:14:01 +0100 | [diff] [blame] | 1 | exit command |
| 2 | ============ |
| 3 | |
| 4 | Synopsis |
| 5 | -------- |
| 6 | |
| 7 | :: |
| 8 | |
| 9 | exit |
| 10 | |
| 11 | Description |
| 12 | ----------- |
| 13 | |
| 14 | The exit command terminates a script started via the run or source command. |
| 15 | If scripts are nested, only the innermost script is left. |
| 16 | |
| 17 | :: |
| 18 | |
| 19 | => setenv inner 'echo entry inner; exit; echo inner done' |
| 20 | => setenv outer 'echo entry outer; run inner; echo outer done' |
| 21 | => run outer |
| 22 | entry outer |
| 23 | entry inner |
| 24 | outer done |
| 25 | => |
| 26 | |
| 27 | When executed outside a script a warning is written. Following commands are not |
| 28 | executed. |
| 29 | |
| 30 | :: |
| 31 | |
| 32 | => echo first; exit; echo last |
| 33 | first |
| 34 | exit not allowed from main input shell. |
| 35 | => |
| 36 | |
| 37 | Return value |
| 38 | ------------ |
| 39 | |
| 40 | $? is always set to 0 (true). |