1 This file is reserved.def, in which the shell reserved words are defined.
2 It has no direct C file production, but defines builtins for the Bash
5 Copyright (C) 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
7 This file is part of GNU Bash, the Bourne Again SHell.
9 Bash is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 1, or (at your option) any later
14 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License along
20 with Bash; see the file COPYING. If not, write to the Free Software
21 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 $SHORT_DOC for NAME [in WORDS ... ;] do COMMANDS; done
25 The `for' loop executes a sequence of commands for each member in a
26 list of items. If `in WORDS ...;' is not present, then `in "$@"' is
27 assumed. For each element in WORDS, NAME is set to that element, and
28 the COMMANDS are executed.
32 $SHORT_DOC select NAME [in WORDS ... ;] do COMMANDS; done
33 The WORDS are expanded, generating a list of words. The
34 set of expanded words is printed on the standard error, each
35 preceded by a number. If `in WORDS' is not present, `in "$@"'
36 is assumed. The PS3 prompt is then displayed and a line read
37 from the standard input. If the line consists of the number
38 corresponding to one of the displayed words, then NAME is set
39 to that word. If the line is empty, WORDS and the prompt are
40 redisplayed. If EOF is read, the command completes. Any other
41 value read causes NAME to be set to null. The line read is saved
42 in the variable REPLY. COMMANDS are executed after each selection
43 until a break or return command is executed.
47 $SHORT_DOC time [-p] PIPELINE
48 Execute PIPELINE and print a summary of the real time, user CPU time,
49 and system CPU time spent executing PIPELINE when it terminates.
50 The return status is the return status of PIPELINE. The `-p' option
51 prints the timing summary in a slightly different format. This uses
52 the value of the TIMEFORMAT variable as the output format.
56 $SHORT_DOC case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac
57 Selectively execute COMMANDS based upon WORD matching PATTERN. The
58 `|' is used to separate multiple patterns.
62 $SHORT_DOC if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi
63 The if COMMANDS are executed. If the exit status is zero, then the then
64 COMMANDS are executed. Otherwise, each of the elif COMMANDS are executed
65 in turn, and if the exit status is zero, the corresponding then COMMANDS
66 are executed and the if command completes. Otherwise, the else COMMANDS
67 are executed, if present. The exit status is the exit status of the last
68 command executed, or zero if no condition tested true.
72 $SHORT_DOC while COMMANDS; do COMMANDS; done
73 Expand and execute COMMANDS as long as the final command in the
74 `while' COMMANDS has an exit status of zero.
78 $SHORT_DOC until COMMANDS; do COMMANDS; done
79 Expand and execute COMMANDS as long as the final command in the
80 `until' COMMANDS has an exit status which is not zero.
84 $SHORT_DOC function NAME { COMMANDS ; } or NAME () { COMMANDS ; }
85 Create a simple command invoked by NAME which runs COMMANDS.
86 Arguments on the command line along with NAME are passed to the
91 $DOCNAME grouping_braces
92 $SHORT_DOC { COMMANDS }
93 Run a set of commands in a group. This is one way to redirect an
94 entire set of commands.
99 $SHORT_DOC %[DIGITS | WORD] [&]
100 This is similar to the `fg' command. Resume a stopped or background
101 job. If you specifiy DIGITS, then that job is used. If you specify
102 WORD, then the job whose name begins with WORD is used. Following the
103 job specification with a `&' places the job in the background.
107 $DOCNAME variable_help
108 $SHORT_DOC variables - Some variable names and meanings
109 BASH_VERSION Version information for this Bash.
110 CDPATH A colon separated list of directories to search
111 when the argument to `cd' is not found in the current
113 GLOBIGNORE A colon-separated list of patterns describing filenames to
114 be ignored by pathname expansion.
115 #if defined (HISTORY)
116 HISTFILE The name of the file where your command history is stored.
117 HISTFILESIZE The maximum number of lines this file can contain.
118 HISTSIZE The maximum number of history lines that a running
121 HOME The complete pathname to your login directory.
122 HOSTNAME The name of the current host.
123 HOSTTYPE The type of CPU this version of Bash is running under.
124 IGNOREEOF Controls the action of the shell on receipt of an EOF
125 character as the sole input. If set, then the value
126 of it is the number of EOF characters that can be seen
127 in a row on an empty line before the shell will exit
128 (default 10). When unset, EOF signifies the end of input.
129 MACHTYPE A string describing the current system Bash is running on.
130 MAILCHECK How often, in seconds, Bash checks for new mail.
131 MAILPATH A colon-separated list of filenames which Bash checks
133 OSTYPE The version of Unix this version of Bash is running on.
134 PATH A colon-separated list of directories to search when
135 looking for commands.
136 PROMPT_COMMAND A command to be executed before the printing of each
138 PS1 The primary prompt string.
139 PS2 The secondary prompt string.
140 PWD The full pathname of the current directory.
141 SHELLOPTS A colon-separated list of enabled shell options.
142 TERM The name of the current terminal type.
143 TIMEFORMAT The output format for timing statistics displayed by the
144 `time' reserved word.
145 auto_resume Non-null means a command word appearing on a line by
146 itself is first looked for in the list of currently
147 stopped jobs. If found there, that job is foregrounded.
148 A value of `exact' means that the command word must
149 exactly match a command in the list of stopped jobs. A
150 value of `substring' means that the command word must
151 match a substring of the job. Any other value means that
152 the command must be a prefix of a stopped job.
153 #if defined (HISTORY)
154 # if defined (BANG_HISTORY)
155 histchars Characters controlling history expansion and quick
156 substitution. The first character is the history
157 substitution character, usually `!'. The second is
158 the `quick substitution' character, usually `^'. The
159 third is the `history comment' character, usually `#'.
160 # endif /* BANG_HISTORY */
161 HISTIGNORE A colon-separated list of patterns used to decide which
162 command should be saved on the history list.