Imported from ../bash-2.05b.tar.gz.
[platform/upstream/bash.git] / builtins / reserved.def
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
3 builtin help command.
4
5 Copyright (C) 1987-2002 Free Software Foundation, Inc.
6
7 This file is part of GNU Bash, the Bourne Again SHell.
8
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 2, or (at your option) any later
12 version.
13
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
17 for more details.
18
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, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
22
23 $BUILTIN for
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.
29 $END
30
31 $BUILTIN for ((
32 $DOCNAME arith_for
33 $SHORT_DOC for (( exp1; exp2; exp3 )); do COMMANDS; done
34 Equivalent to
35         (( EXP1 ))
36         while (( EXP2 )); do
37                 COMMANDS
38                 (( EXP3 ))
39         done
40 EXP1, EXP2, and EXP3 are arithmetic expressions.  If any expression is
41 omitted, it behaves as if it evaluates to 1.
42 $END
43
44 $BUILTIN select
45 $SHORT_DOC select NAME [in WORDS ... ;] do COMMANDS; done
46 The WORDS are expanded, generating a list of words.  The
47 set of expanded words is printed on the standard error, each
48 preceded by a number.  If `in WORDS' is not present, `in "$@"'
49 is assumed.  The PS3 prompt is then displayed and a line read
50 from the standard input.  If the line consists of the number
51 corresponding to one of the displayed words, then NAME is set
52 to that word.  If the line is empty, WORDS and the prompt are
53 redisplayed.  If EOF is read, the command completes.  Any other
54 value read causes NAME to be set to null.  The line read is saved
55 in the variable REPLY.  COMMANDS are executed after each selection
56 until a break command is executed.
57 $END
58
59 $BUILTIN time
60 $SHORT_DOC time [-p] PIPELINE
61 Execute PIPELINE and print a summary of the real time, user CPU time,
62 and system CPU time spent executing PIPELINE when it terminates.
63 The return status is the return status of PIPELINE.  The `-p' option
64 prints the timing summary in a slightly different format.  This uses
65 the value of the TIMEFORMAT variable as the output format.
66 $END
67
68 $BUILTIN case
69 $SHORT_DOC case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac
70 Selectively execute COMMANDS based upon WORD matching PATTERN.  The
71 `|' is used to separate multiple patterns.
72 $END
73
74 $BUILTIN if
75 $SHORT_DOC if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi
76 The if COMMANDS are executed.  If the exit status is zero, then the then
77 COMMANDS are executed.  Otherwise, each of the elif COMMANDS are executed
78 in turn, and if the exit status is zero, the corresponding then COMMANDS
79 are executed and the if command completes.  Otherwise, the else COMMANDS
80 are executed, if present.  The exit status is the exit status of the last
81 command executed, or zero if no condition tested true.
82 $END
83
84 $BUILTIN while
85 $SHORT_DOC while COMMANDS; do COMMANDS; done
86 Expand and execute COMMANDS as long as the final command in the
87 `while' COMMANDS has an exit status of zero.
88 $END
89
90 $BUILTIN until
91 $SHORT_DOC until COMMANDS; do COMMANDS; done
92 Expand and execute COMMANDS as long as the final command in the
93 `until' COMMANDS has an exit status which is not zero.
94 $END
95
96 $BUILTIN function
97 $SHORT_DOC function NAME { COMMANDS ; } or NAME () { COMMANDS ; }
98 Create a simple command invoked by NAME which runs COMMANDS.
99 Arguments on the command line along with NAME are passed to the
100 function as $0 .. $n.
101 $END
102
103 $BUILTIN { ... }
104 $DOCNAME grouping_braces
105 $SHORT_DOC { COMMANDS ; }
106 Run a set of commands in a group.  This is one way to redirect an
107 entire set of commands.
108 $END
109
110 $BUILTIN %
111 $DOCNAME fg_percent
112 $SHORT_DOC %[DIGITS | WORD] [&]
113 This is similar to the `fg' command.  Resume a stopped or background
114 job.  If you specifiy DIGITS, then that job is used.  If you specify
115 WORD, then the job whose name begins with WORD is used.  Following the
116 job specification with a `&' places the job in the background.
117 $END
118
119 $BUILTIN (( ... ))
120 $DOCNAME arith
121 $SHORT_DOC (( expression ))
122 The EXPRESSION is evaluated according to the rules for arithmetic
123 evaluation.  Equivalent to "let EXPRESSION".
124 $END
125
126 $BUILTIN [[ ... ]]
127 $DOCNAME conditional
128 $SHORT_DOC [[ expression ]]
129 Returns a status of 0 or 1 depending on the evaluation of the conditional
130 expression EXPRESSION.  Expressions are composed of the same primaries used
131 by the `test' builtin, and may be combined using the following operators
132
133         ( EXPRESSION )  Returns the value of EXPRESSION
134         ! EXPRESSION    True if EXPRESSION is false; else false
135         EXPR1 && EXPR2  True if both EXPR1 and EXPR2 are true; else false
136         EXPR1 || EXPR2  True if either EXPR1 or EXPR2 is true; else false
137
138 When the `==' and `!=' operators are used, the string to the right of the
139 operator is used as a pattern and pattern matching is performed.  The
140 && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to
141 determine the expression's value.
142 $END
143
144 $BUILTIN variables
145 $DOCNAME variable_help
146 $SHORT_DOC variables - Some variable names and meanings
147 BASH_VERSION    Version information for this Bash.
148 CDPATH          A colon separated list of directories to search
149                 when the argument to `cd' is not found in the current
150                 directory.
151 GLOBIGNORE      A colon-separated list of patterns describing filenames to
152                 be ignored by pathname expansion.
153 #if defined (HISTORY)
154 HISTFILE        The name of the file where your command history is stored.
155 HISTFILESIZE    The maximum number of lines this file can contain.
156 HISTSIZE        The maximum number of history lines that a running
157                 shell can access.
158 #endif /* HISTORY */
159 HOME            The complete pathname to your login directory.
160 HOSTNAME        The name of the current host.
161 HOSTTYPE        The type of CPU this version of Bash is running under.
162 IGNOREEOF       Controls the action of the shell on receipt of an EOF
163                 character as the sole input.  If set, then the value
164                 of it is the number of EOF characters that can be seen
165                 in a row on an empty line before the shell will exit
166                 (default 10).  When unset, EOF signifies the end of input.
167 MACHTYPE        A string describing the current system Bash is running on.
168 MAILCHECK       How often, in seconds, Bash checks for new mail.
169 MAILPATH        A colon-separated list of filenames which Bash checks
170                 for new mail.
171 OSTYPE          The version of Unix this version of Bash is running on.
172 PATH            A colon-separated list of directories to search when
173                 looking for commands.
174 PROMPT_COMMAND  A command to be executed before the printing of each
175                 primary prompt.
176 PS1             The primary prompt string.
177 PS2             The secondary prompt string.
178 PWD             The full pathname of the current directory.
179 SHELLOPTS       A colon-separated list of enabled shell options.
180 TERM            The name of the current terminal type.
181 TIMEFORMAT      The output format for timing statistics displayed by the
182                 `time' reserved word.
183 auto_resume     Non-null means a command word appearing on a line by
184                 itself is first looked for in the list of currently
185                 stopped jobs.  If found there, that job is foregrounded.
186                 A value of `exact' means that the command word must
187                 exactly match a command in the list of stopped jobs.  A
188                 value of `substring' means that the command word must
189                 match a substring of the job.  Any other value means that
190                 the command must be a prefix of a stopped job.
191 #if defined (HISTORY)
192 #  if defined (BANG_HISTORY)
193 histchars       Characters controlling history expansion and quick
194                 substitution.  The first character is the history
195                 substitution character, usually `!'.  The second is
196                 the `quick substitution' character, usually `^'.  The
197                 third is the `history comment' character, usually `#'.
198 #  endif /* BANG_HISTORY */
199 HISTIGNORE      A colon-separated list of patterns used to decide which
200                 commands should be saved on the history list.
201 #endif /* HISTORY */
202 $END