"Das U-Boot" Source Tree
at master 45 lines 907 B view raw
1.. index:: 2 single: exit (command) 3 4exit command 5============ 6 7Synopsis 8-------- 9 10:: 11 12 exit 13 14Description 15----------- 16 17The exit command terminates a script started via the run or source command. 18If scripts are nested, only the innermost script is left. 19 20:: 21 22 => setenv inner 'echo entry inner; exit; echo inner done' 23 => setenv outer 'echo entry outer; run inner; echo outer done' 24 => run outer 25 entry outer 26 entry inner 27 outer done 28 => 29 30When executed outside a script a warning is written. Following commands are not 31executed. 32 33:: 34 35 => echo first; exit; echo last 36 first 37 exit not allowed from main input shell. 38 => 39 40Return value 41------------ 42 43$? is default set to 0 (true). In case zero or positive integer parameter 44is passed to the command, the return value is the parameter value. In case 45negative integer parameter is passed to the command, the return value is 0.