Imported from ../bash-1.14.7.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, 1989, 1991, 1992 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 1, 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, 675 Mass Ave, Cambridge, MA 02139, 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 select
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.
44 $END
45
46 $BUILTIN case
47 $SHORT_DOC case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac
48 Selectively execute COMMANDS based upon WORD matching PATTERN.  The
49 `|' is used to separate multiple patterns.
50 $END
51
52 $BUILTIN if
53 $SHORT_DOC if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi
54 The if COMMANDS are executed.  If the exit status is zero, then the then
55 COMMANDS are executed.  Otherwise, each of the elif COMMANDS are executed
56 in turn, and if the exit status is zero, the corresponding then COMMANDS
57 are executed and the if command completes.  Otherwise, the else COMMANDS
58 are executed, if present.  The exit status is the exit status of the last
59 command executed, or zero if no condition tested true.
60 $END
61
62 $BUILTIN while
63 $SHORT_DOC while COMMANDS; do COMMANDS; done
64 Expand and execute COMMANDS as long as the final command in the
65 `while' COMMANDS has an exit status of zero.
66 $END
67
68 $BUILTIN until
69 $SHORT_DOC until COMMANDS; do COMMANDS; done
70 Expand and execute COMMANDS as long as the final command in the
71 `until' COMMANDS has an exit status which is not zero.
72 $END
73
74 $BUILTIN function
75 $SHORT_DOC function NAME { COMMANDS ; } or NAME () { COMMANDS ; }
76 Create a simple command invoked by NAME which runs COMMANDS.
77 Arguments on the command line along with NAME are passed to the
78 function as $0 .. $n.
79 $END
80
81 $BUILTIN { ... }
82 $DOCNAME grouping_braces
83 $SHORT_DOC { COMMANDS }
84 Run a set of commands in a group.  This is one way to redirect an
85 entire set of commands.
86 $END
87
88 $BUILTIN %
89 $DOCNAME fg_percent
90 $SHORT_DOC %[DIGITS | WORD] [&]
91 This is similar to the `fg' command.  Resume a stopped or background
92 job.  If you specifiy DIGITS, then that job is used.  If you specify
93 WORD, then the job whose name begins with WORD is used.  Following the
94 job specification with a `&' places the job in the background.
95 $END
96
97 $BUILTIN variables
98 $DOCNAME variable_help
99 $SHORT_DOC variables - Some variable names and meanings
100 BASH_VERSION    The version numbers of this Bash.
101 CDPATH          A colon separated list of directories to search
102                 when the argument to `cd' is not found in the current
103                 directory.
104 #if defined (HISTORY)
105 HISTFILE        The name of the file where your command history is stored.
106 HISTFILESIZE    The maximum number of lines this file can contain.
107 HISTSIZE        The maximum number of history lines that a running
108                 shell can access.
109 #endif /* HISTORY */
110 HOME            The complete pathname to your login directory.
111 HOSTTYPE        The type of CPU this version of Bash is running under.
112 IGNOREEOF       Controls the action of the shell on receipt of an EOF
113                 character as the sole input.  If set, then the value
114                 of it is the number of EOF characters that can be seen
115                 in a row on an empty line before the shell will exit
116                 (default 10).  When unset, EOF signifies the end of input.
117 MAILCHECK       How often, in seconds, Bash checks for new mail.
118 MAILPATH        A colon-separated list of filenames which Bash checks
119                 for new mail.
120 PATH            A colon-separated list of directories to search when
121                 looking for commands.
122 PROMPT_COMMAND  A command to be executed before the printing of each
123                 primary prompt.
124 PS1             The primary prompt string.
125 PS2             The secondary prompt string.
126 TERM            The name of the current terminal type.
127 auto_resume     Non-null means a command word appearing on a line by
128                 itself is first looked for in the list of currently
129                 stopped jobs.  If found there, that job is foregrounded.
130                 A value of `exact' means that the command word must
131                 exactly match a command in the list of stopped jobs.  A
132                 value of `substring' means that the command word must
133                 match a substring of the job.  Any other value means that
134                 the command must be a prefix of a stopped job.
135 #if defined (HISTORY)
136 command_oriented_history
137                 Non-null means to save multiple-line commands together on
138                 a single history line.
139 #  if defined (BANG_HISTORY)
140 histchars       Characters controlling history expansion and quick
141                 substitution.  The first character is the history
142                 substitution character, usually `!'.  The second is
143                 the `quick substitution' character, usually `^'.  The
144                 third is the `history comment' character, usually `#'.
145 #  endif /* BANG_HISTORY */
146 HISTCONTROL     Set to a value of `ignorespace', it means don't enter
147                 lines which begin with a space or tab on the history
148                 list.  Set to a value of `ignoredups', it means don't
149                 enter lines which match the last entered line.  Set to
150                 `ignoreboth' means to combine the two options.  Unset,
151                 or set to any other value than those above means to save
152                 all lines on the history list.
153 #endif /* HISTORY */
154 $END