]> git.ipfire.org Git - thirdparty/u-boot.git/blob - doc/usage/cmd/exit.rst
doc: create index entries for commands
[thirdparty/u-boot.git] / doc / usage / cmd / exit.rst
1 .. index::
2 single: exit (command)
3
4 exit command
5 ============
6
7 Synopsis
8 --------
9
10 ::
11
12 exit
13
14 Description
15 -----------
16
17 The exit command terminates a script started via the run or source command.
18 If 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
30 When executed outside a script a warning is written. Following commands are not
31 executed.
32
33 ::
34
35 => echo first; exit; echo last
36 first
37 exit not allowed from main input shell.
38 =>
39
40 Return value
41 ------------
42
43 $? is default set to 0 (true). In case zero or positive integer parameter
44 is passed to the command, the return value is the parameter value. In case
45 negative integer parameter is passed to the command, the return value is 0.