blob: 9d7993290816a761045ca174d1c4378b0b02aaf5 [file] [log] [blame]
Dan Pasanenc6e37862014-10-02 14:08:59 -05001/* builtins.c -- the built in shell commands. */
2
3/* This file is manufactured by ./mkbuiltins, and should not be
4 edited by hand. See the source to mkbuiltins for details. */
5
6/* Copyright (C) 1987-2012 Free Software Foundation, Inc.
7
8 This file is part of GNU Bash, the Bourne Again SHell.
9
10 Bash is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14
15 Bash is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with Bash. If not, see <http://www.gnu.org/licenses/>.
22*/
23
24/* The list of shell builtins. Each element is name, function, flags,
25 long-doc, short-doc. The long-doc field contains a pointer to an array
26 of help lines. The function takes a WORD_LIST *; the first word in the
27 list is the first arg to the command. The list has already had word
28 expansion performed.
29
30 Functions which need to look at only the simple commands (e.g.
31 the enable_builtin ()), should ignore entries where
32 (array[i].function == (sh_builtin_func_t *)NULL). Such entries are for
33 the list of shell reserved control structures, like `if' and `while'.
34 The end of the list is denoted with a NULL name field. */
35
36#include "../builtins.h"
37#include "builtext.h"
38#include "bashintl.h"
39
40struct builtin static_shell_builtins[] = {
41#if defined (ALIAS)
42 { "alias", alias_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | ASSIGNMENT_BUILTIN | POSIX_BUILTIN, alias_doc,
43 N_("alias [-p] [name[=value] ... ]"), (char *)NULL },
44#endif /* ALIAS */
45#if defined (ALIAS)
46 { "unalias", unalias_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, unalias_doc,
47 N_("unalias [-a] name [name ...]"), (char *)NULL },
48#endif /* ALIAS */
49#if defined (READLINE)
50 { "bind", bind_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, bind_doc,
51 N_("bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command]"), (char *)NULL },
52#endif /* READLINE */
53 { "break", break_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, break_doc,
54 N_("break [n]"), (char *)NULL },
55 { "continue", continue_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, continue_doc,
56 N_("continue [n]"), (char *)NULL },
57 { "builtin", builtin_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, builtin_doc,
58 N_("builtin [shell-builtin [arg ...]]"), (char *)NULL },
59#if defined (DEBUGGER)
60 { "caller", caller_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, caller_doc,
61 N_("caller [expr]"), (char *)NULL },
62#endif /* DEBUGGER */
63 { "cd", cd_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, cd_doc,
64 N_("cd [-L|[-P [-e]] [-@]] [dir]"), (char *)NULL },
65 { "pwd", pwd_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, pwd_doc,
66 N_("pwd [-LP]"), (char *)NULL },
67 { ":", colon_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, colon_doc,
68 N_(":"), (char *)NULL },
69 { "true", colon_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, true_doc,
70 N_("true"), (char *)NULL },
71 { "false", false_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, false_doc,
72 N_("false"), (char *)NULL },
73 { "command", command_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, command_doc,
74 N_("command [-pVv] command [arg ...]"), (char *)NULL },
75 { "declare", declare_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | ASSIGNMENT_BUILTIN, declare_doc,
76 N_("declare [-aAfFgilnrtux] [-p] [name[=value] ...]"), (char *)NULL },
77 { "typeset", declare_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | ASSIGNMENT_BUILTIN, typeset_doc,
78 N_("typeset [-aAfFgilrtux] [-p] name[=value] ..."), (char *)NULL },
79 { "local", local_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | ASSIGNMENT_BUILTIN, local_doc,
80 N_("local [option] name[=value] ..."), (char *)NULL },
81#if defined (V9_ECHO)
82 { "echo", echo_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, echo_doc,
83 N_("echo [-neE] [arg ...]"), (char *)NULL },
84#endif /* V9_ECHO */
85#if !defined (V9_ECHO)
86 { "echo", echo_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, echo_doc,
87 N_("echo [-n] [arg ...]"), (char *)NULL },
88#endif /* !V9_ECHO */
89 { "enable", enable_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, enable_doc,
90 N_("enable [-a] [-dnps] [-f filename] [name ...]"), (char *)NULL },
91 { "eval", eval_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, eval_doc,
92 N_("eval [arg ...]"), (char *)NULL },
93 { "getopts", getopts_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, getopts_doc,
94 N_("getopts optstring name [arg]"), (char *)NULL },
95 { "exec", exec_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, exec_doc,
96 N_("exec [-cl] [-a name] [command [arguments ...]] [redirection ...]"), (char *)NULL },
97 { "exit", exit_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, exit_doc,
98 N_("exit [n]"), (char *)NULL },
99 { "logout", logout_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, logout_doc,
100 N_("logout [n]"), (char *)NULL },
101#if defined (HISTORY)
102 { "fc", fc_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, fc_doc,
103 N_("fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]"), (char *)NULL },
104#endif /* HISTORY */
105#if defined (JOB_CONTROL)
106 { "fg", fg_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, fg_doc,
107 N_("fg [job_spec]"), (char *)NULL },
108#endif /* JOB_CONTROL */
109#if defined (JOB_CONTROL)
110 { "bg", bg_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, bg_doc,
111 N_("bg [job_spec ...]"), (char *)NULL },
112#endif /* JOB_CONTROL */
113 { "hash", hash_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, hash_doc,
114 N_("hash [-lr] [-p pathname] [-dt] [name ...]"), (char *)NULL },
115#if defined (HELP_BUILTIN)
116 { "help", help_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, help_doc,
117 N_("help [-dms] [pattern ...]"), (char *)NULL },
118#endif /* HELP_BUILTIN */
119#if defined (HISTORY)
120 { "history", history_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, history_doc,
121 N_("history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]"), (char *)NULL },
122#endif /* HISTORY */
123#if defined (JOB_CONTROL)
124 { "jobs", jobs_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, jobs_doc,
125 N_("jobs [-lnprs] [jobspec ...] or jobs -x command [args]"), (char *)NULL },
126#endif /* JOB_CONTROL */
127#if defined (JOB_CONTROL)
128 { "disown", disown_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, disown_doc,
129 N_("disown [-h] [-ar] [jobspec ...]"), (char *)NULL },
130#endif /* JOB_CONTROL */
131 { "kill", kill_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, kill_doc,
132 N_("kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]"), (char *)NULL },
133 { "let", let_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, let_doc,
134 N_("let arg [arg ...]"), (char *)NULL },
135 { "read", read_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, read_doc,
136 N_("read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]"), (char *)NULL },
137 { "return", return_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, return_doc,
138 N_("return [n]"), (char *)NULL },
139 { "set", set_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, set_doc,
140 N_("set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]"), (char *)NULL },
141 { "unset", unset_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, unset_doc,
142 N_("unset [-f] [-v] [-n] [name ...]"), (char *)NULL },
143 { "export", export_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN | ASSIGNMENT_BUILTIN, export_doc,
144 N_("export [-fn] [name[=value] ...] or export -p"), (char *)NULL },
145 { "readonly", readonly_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN | ASSIGNMENT_BUILTIN, readonly_doc,
146 N_("readonly [-aAf] [name[=value] ...] or readonly -p"), (char *)NULL },
147 { "shift", shift_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, shift_doc,
148 N_("shift [n]"), (char *)NULL },
149 { "source", source_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, source_doc,
150 N_("source filename [arguments]"), (char *)NULL },
151 { ".", source_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, dot_doc,
152 N_(". filename [arguments]"), (char *)NULL },
153#if defined (JOB_CONTROL)
154 { "suspend", suspend_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, suspend_doc,
155 N_("suspend [-f]"), (char *)NULL },
156#endif /* JOB_CONTROL */
157 { "test", test_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, test_doc,
158 N_("test [expr]"), (char *)NULL },
159 { "[", test_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, test_bracket_doc,
160 N_("[ arg... ]"), (char *)NULL },
161 { "times", times_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, times_doc,
162 N_("times"), (char *)NULL },
163 { "trap", trap_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | SPECIAL_BUILTIN, trap_doc,
164 N_("trap [-lp] [[arg] signal_spec ...]"), (char *)NULL },
165 { "type", type_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, type_doc,
166 N_("type [-afptP] name [name ...]"), (char *)NULL },
167#if !defined (_MINIX)
168 { "ulimit", ulimit_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, ulimit_doc,
169 N_("ulimit [-SHabcdefilmnpqrstuvxT] [limit]"), (char *)NULL },
170#endif /* !_MINIX */
171 { "umask", umask_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, umask_doc,
172 N_("umask [-p] [-S] [mode]"), (char *)NULL },
173#if defined (JOB_CONTROL)
174 { "wait", wait_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, wait_doc,
175 N_("wait [-n] [id ...]"), (char *)NULL },
176#endif /* JOB_CONTROL */
177#if !defined (JOB_CONTROL)
178 { "wait", wait_builtin, BUILTIN_ENABLED | STATIC_BUILTIN | POSIX_BUILTIN, wait_doc,
179 N_("wait [pid ...]"), (char *)NULL },
180#endif /* !JOB_CONTROL */
181 { "for", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, for_doc,
182 N_("for NAME [in WORDS ... ] ; do COMMANDS; done"), (char *)NULL },
183 { "for ((", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, arith_for_doc,
184 N_("for (( exp1; exp2; exp3 )); do COMMANDS; done"), (char *)NULL },
185 { "select", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, select_doc,
186 N_("select NAME [in WORDS ... ;] do COMMANDS; done"), (char *)NULL },
187 { "time", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, time_doc,
188 N_("time [-p] pipeline"), (char *)NULL },
189 { "case", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, case_doc,
190 N_("case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac"), (char *)NULL },
191 { "if", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, if_doc,
192 N_("if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi"), (char *)NULL },
193 { "while", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, while_doc,
194 N_("while COMMANDS; do COMMANDS; done"), (char *)NULL },
195 { "until", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, until_doc,
196 N_("until COMMANDS; do COMMANDS; done"), (char *)NULL },
197 { "coproc", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, coproc_doc,
198 N_("coproc [NAME] command [redirections]"), (char *)NULL },
199 { "function", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, function_doc,
200 N_("function name { COMMANDS ; } or name () { COMMANDS ; }"), (char *)NULL },
201 { "{ ... }", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, grouping_braces_doc,
202 N_("{ COMMANDS ; }"), (char *)NULL },
203 { "%", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, fg_percent_doc,
204 N_("job_spec [&]"), (char *)NULL },
205 { "(( ... ))", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, arith_doc,
206 N_("(( expression ))"), (char *)NULL },
207 { "[[ ... ]]", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, conditional_doc,
208 N_("[[ expression ]]"), (char *)NULL },
209 { "variables", (sh_builtin_func_t *)0x0, BUILTIN_ENABLED | STATIC_BUILTIN, variable_help_doc,
210 N_("variables - Names and meanings of some shell variables"), (char *)NULL },
211#if defined (PUSHD_AND_POPD)
212 { "pushd", pushd_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, pushd_doc,
213 N_("pushd [-n] [+N | -N | dir]"), (char *)NULL },
214#endif /* PUSHD_AND_POPD */
215#if defined (PUSHD_AND_POPD)
216 { "popd", popd_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, popd_doc,
217 N_("popd [-n] [+N | -N]"), (char *)NULL },
218#endif /* PUSHD_AND_POPD */
219#if defined (PUSHD_AND_POPD)
220 { "dirs", dirs_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, dirs_doc,
221 N_("dirs [-clpv] [+N] [-N]"), (char *)NULL },
222#endif /* PUSHD_AND_POPD */
223 { "shopt", shopt_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, shopt_doc,
224 N_("shopt [-pqsu] [-o] [optname ...]"), (char *)NULL },
225 { "printf", printf_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, printf_doc,
226 N_("printf [-v var] format [arguments]"), (char *)NULL },
227#if defined (PROGRAMMABLE_COMPLETION)
228 { "complete", complete_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, complete_doc,
229 N_("complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]"), (char *)NULL },
230#endif /* PROGRAMMABLE_COMPLETION */
231#if defined (PROGRAMMABLE_COMPLETION)
232 { "compgen", compgen_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, compgen_doc,
233 N_("compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]"), (char *)NULL },
234#endif /* PROGRAMMABLE_COMPLETION */
235#if defined (PROGRAMMABLE_COMPLETION)
236 { "compopt", compopt_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, compopt_doc,
237 N_("compopt [-o|+o option] [-DE] [name ...]"), (char *)NULL },
238#endif /* PROGRAMMABLE_COMPLETION */
239 { "mapfile", mapfile_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, mapfile_doc,
240 N_("mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]"), (char *)NULL },
241 { "readarray", mapfile_builtin, BUILTIN_ENABLED | STATIC_BUILTIN, readarray_doc,
242 N_("readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]"), (char *)NULL },
243 { (char *)0x0, (sh_builtin_func_t *)0x0, 0, (char **)0x0, (char *)0x0, (char *)0x0 }
244};
245
246struct builtin *shell_builtins = static_shell_builtins;
247struct builtin *current_builtin;
248
249int num_shell_builtins =
250 sizeof (static_shell_builtins) / sizeof (struct builtin) - 1;
251#if defined (ALIAS)
252char * const alias_doc[] = {
253#if defined (HELP_BUILTIN)
254N_("Define or display aliases.\n\
255 \n\
256 Without arguments, `alias' prints the list of aliases in the reusable\n\
257 form `alias NAME=VALUE' on standard output.\n\
258 \n\
259 Otherwise, an alias is defined for each NAME whose VALUE is given.\n\
260 A trailing space in VALUE causes the next word to be checked for\n\
261 alias substitution when the alias is expanded.\n\
262 \n\
263 Options:\n\
264 -p Print all defined aliases in a reusable format\n\
265 \n\
266 Exit Status:\n\
267 alias returns true unless a NAME is supplied for which no alias has been\n\
268 defined."),
269#endif /* HELP_BUILTIN */
270 (char *)NULL
271};
272#endif /* ALIAS */
273#if defined (ALIAS)
274char * const unalias_doc[] = {
275#if defined (HELP_BUILTIN)
276N_("Remove each NAME from the list of defined aliases.\n\
277 \n\
278 Options:\n\
279 -a remove all alias definitions.\n\
280 \n\
281 Return success unless a NAME is not an existing alias."),
282#endif /* HELP_BUILTIN */
283 (char *)NULL
284};
285#endif /* ALIAS */
286#if defined (READLINE)
287char * const bind_doc[] = {
288#if defined (HELP_BUILTIN)
289N_("Set Readline key bindings and variables.\n\
290 \n\
291 Bind a key sequence to a Readline function or a macro, or set a\n\
292 Readline variable. The non-option argument syntax is equivalent to\n\
293 that found in ~/.inputrc, but must be passed as a single argument:\n\
294 e.g., bind '\"\\C-x\\C-r\": re-read-init-file'.\n\
295 \n\
296 Options:\n\
297 -m keymap Use KEYMAP as the keymap for the duration of this\n\
298 command. Acceptable keymap names are emacs,\n\
299 emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,\n\
300 vi-command, and vi-insert.\n\
301 -l List names of functions.\n\
302 -P List function names and bindings.\n\
303 -p List functions and bindings in a form that can be\n\
304 reused as input.\n\
305 -S List key sequences that invoke macros and their values\n\
306 -s List key sequences that invoke macros and their values\n\
307 in a form that can be reused as input.\n\
308 -V List variable names and values\n\
309 -v List variable names and values in a form that can\n\
310 be reused as input.\n\
311 -q function-name Query about which keys invoke the named function.\n\
312 -u function-name Unbind all keys which are bound to the named function.\n\
313 -r keyseq Remove the binding for KEYSEQ.\n\
314 -f filename Read key bindings from FILENAME.\n\
315 -x keyseq:shell-command Cause SHELL-COMMAND to be executed when\n\
316 KEYSEQ is entered.\n\
317 -X List key sequences bound with -x and associated commands\n\
318 in a form that can be reused as input.\n\
319 \n\
320 Exit Status:\n\
321 bind returns 0 unless an unrecognized option is given or an error occurs."),
322#endif /* HELP_BUILTIN */
323 (char *)NULL
324};
325#endif /* READLINE */
326char * const break_doc[] = {
327#if defined (HELP_BUILTIN)
328N_("Exit for, while, or until loops.\n\
329 \n\
330 Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n\
331 loops.\n\
332 \n\
333 Exit Status:\n\
334 The exit status is 0 unless N is not greater than or equal to 1."),
335#endif /* HELP_BUILTIN */
336 (char *)NULL
337};
338char * const continue_doc[] = {
339#if defined (HELP_BUILTIN)
340N_("Resume for, while, or until loops.\n\
341 \n\
342 Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n\
343 If N is specified, resumes the Nth enclosing loop.\n\
344 \n\
345 Exit Status:\n\
346 The exit status is 0 unless N is not greater than or equal to 1."),
347#endif /* HELP_BUILTIN */
348 (char *)NULL
349};
350char * const builtin_doc[] = {
351#if defined (HELP_BUILTIN)
352N_("Execute shell builtins.\n\
353 \n\
354 Execute SHELL-BUILTIN with arguments ARGs without performing command\n\
355 lookup. This is useful when you wish to reimplement a shell builtin\n\
356 as a shell function, but need to execute the builtin within the function.\n\
357 \n\
358 Exit Status:\n\
359 Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n\
360 not a shell builtin.."),
361#endif /* HELP_BUILTIN */
362 (char *)NULL
363};
364#if defined (DEBUGGER)
365char * const caller_doc[] = {
366#if defined (HELP_BUILTIN)
367N_("Return the context of the current subroutine call.\n\
368 \n\
369 Without EXPR, returns \"$line $filename\". With EXPR, returns\n\
370 \"$line $subroutine $filename\"; this extra information can be used to\n\
371 provide a stack trace.\n\
372 \n\
373 The value of EXPR indicates how many call frames to go back before the\n\
374 current one; the top frame is frame 0.\n\
375 \n\
376 Exit Status:\n\
377 Returns 0 unless the shell is not executing a shell function or EXPR\n\
378 is invalid."),
379#endif /* HELP_BUILTIN */
380 (char *)NULL
381};
382#endif /* DEBUGGER */
383char * const cd_doc[] = {
384#if defined (HELP_BUILTIN)
385N_("Change the shell working directory.\n\
386 \n\
387 Change the current directory to DIR. The default DIR is the value of the\n\
388 HOME shell variable.\n\
389 \n\
390 The variable CDPATH defines the search path for the directory containing\n\
391 DIR. Alternative directory names in CDPATH are separated by a colon (:).\n\
392 A null directory name is the same as the current directory. If DIR begins\n\
393 with a slash (/), then CDPATH is not used.\n\
394 \n\
395 If the directory is not found, and the shell option `cdable_vars' is set,\n\
396 the word is assumed to be a variable name. If that variable has a value,\n\
397 its value is used for DIR.\n\
398 \n\
399 Options:\n\
400 -L force symbolic links to be followed: resolve symbolic links in\n\
401 DIR after processing instances of `..'\n\
402 -P use the physical directory structure without following symbolic\n\
403 links: resolve symbolic links in DIR before processing instances\n\
404 of `..'\n\
405 -e if the -P option is supplied, and the current working directory\n\
406 cannot be determined successfully, exit with a non-zero status\n\
407 -@ on systems that support it, present a file with extended attributes\n\
408 as a directory containing the file attributes\n\
409 \n\
410 The default is to follow symbolic links, as if `-L' were specified.\n\
411 `..' is processed by removing the immediately previous pathname component\n\
412 back to a slash or the beginning of DIR.\n\
413 \n\
414 Exit Status:\n\
415 Returns 0 if the directory is changed, and if $PWD is set successfully when\n\
416 -P is used; non-zero otherwise."),
417#endif /* HELP_BUILTIN */
418 (char *)NULL
419};
420char * const pwd_doc[] = {
421#if defined (HELP_BUILTIN)
422N_("Print the name of the current working directory.\n\
423 \n\
424 Options:\n\
425 -L print the value of $PWD if it names the current working\n\
426 directory\n\
427 -P print the physical directory, without any symbolic links\n\
428 \n\
429 By default, `pwd' behaves as if `-L' were specified.\n\
430 \n\
431 Exit Status:\n\
432 Returns 0 unless an invalid option is given or the current directory\n\
433 cannot be read."),
434#endif /* HELP_BUILTIN */
435 (char *)NULL
436};
437char * const colon_doc[] = {
438#if defined (HELP_BUILTIN)
439N_("Null command.\n\
440 \n\
441 No effect; the command does nothing.\n\
442 \n\
443 Exit Status:\n\
444 Always succeeds."),
445#endif /* HELP_BUILTIN */
446 (char *)NULL
447};
448char * const true_doc[] = {
449#if defined (HELP_BUILTIN)
450N_("Return a successful result.\n\
451 \n\
452 Exit Status:\n\
453 Always succeeds."),
454#endif /* HELP_BUILTIN */
455 (char *)NULL
456};
457char * const false_doc[] = {
458#if defined (HELP_BUILTIN)
459N_("Return an unsuccessful result.\n\
460 \n\
461 Exit Status:\n\
462 Always fails."),
463#endif /* HELP_BUILTIN */
464 (char *)NULL
465};
466char * const command_doc[] = {
467#if defined (HELP_BUILTIN)
468N_("Execute a simple command or display information about commands.\n\
469 \n\
470 Runs COMMAND with ARGS suppressing shell function lookup, or display\n\
471 information about the specified COMMANDs. Can be used to invoke commands\n\
472 on disk when a function with the same name exists.\n\
473 \n\
474 Options:\n\
475 -p use a default value for PATH that is guaranteed to find all of\n\
476 the standard utilities\n\
477 -v print a description of COMMAND similar to the `type' builtin\n\
478 -V print a more verbose description of each COMMAND\n\
479 \n\
480 Exit Status:\n\
481 Returns exit status of COMMAND, or failure if COMMAND is not found."),
482#endif /* HELP_BUILTIN */
483 (char *)NULL
484};
485char * const declare_doc[] = {
486#if defined (HELP_BUILTIN)
487N_("Set variable values and attributes.\n\
488 \n\
489 Declare variables and give them attributes. If no NAMEs are given,\n\
490 display the attributes and values of all variables.\n\
491 \n\
492 Options:\n\
493 -f restrict action or display to function names and definitions\n\
494 -F restrict display to function names only (plus line number and\n\
495 source file when debugging)\n\
496 -g create global variables when used in a shell function; otherwise\n\
497 ignored\n\
498 -p display the attributes and value of each NAME\n\
499 \n\
500 Options which set attributes:\n\
501 -a to make NAMEs indexed arrays (if supported)\n\
502 -A to make NAMEs associative arrays (if supported)\n\
503 -i to make NAMEs have the `integer' attribute\n\
504 -l to convert NAMEs to lower case on assignment\n\
505 -n make NAME a reference to the variable named by its value\n\
506 -r to make NAMEs readonly\n\
507 -t to make NAMEs have the `trace' attribute\n\
508 -u to convert NAMEs to upper case on assignment\n\
509 -x to make NAMEs export\n\
510 \n\
511 Using `+' instead of `-' turns off the given attribute.\n\
512 \n\
513 Variables with the integer attribute have arithmetic evaluation (see\n\
514 the `let' command) performed when the variable is assigned a value.\n\
515 \n\
516 When used in a function, `declare' makes NAMEs local, as with the `local'\n\
517 command. The `-g' option suppresses this behavior.\n\
518 \n\
519 Exit Status:\n\
520 Returns success unless an invalid option is supplied or a variable\n\
521 assignment error occurs."),
522#endif /* HELP_BUILTIN */
523 (char *)NULL
524};
525char * const typeset_doc[] = {
526#if defined (HELP_BUILTIN)
527N_("Set variable values and attributes.\n\
528 \n\
529 Obsolete. See `help declare'."),
530#endif /* HELP_BUILTIN */
531 (char *)NULL
532};
533char * const local_doc[] = {
534#if defined (HELP_BUILTIN)
535N_("Define local variables.\n\
536 \n\
537 Create a local variable called NAME, and give it VALUE. OPTION can\n\
538 be any option accepted by `declare'.\n\
539 \n\
540 Local variables can only be used within a function; they are visible\n\
541 only to the function where they are defined and its children.\n\
542 \n\
543 Exit Status:\n\
544 Returns success unless an invalid option is supplied, a variable\n\
545 assignment error occurs, or the shell is not executing a function."),
546#endif /* HELP_BUILTIN */
547 (char *)NULL
548};
549#if defined (V9_ECHO)
550char * const echo_doc[] = {
551#if defined (HELP_BUILTIN)
552N_("Write arguments to the standard output.\n\
553 \n\
554 Display the ARGs, separated by a single space character and followed by a\n\
555 newline, on the standard output.\n\
556 \n\
557 Options:\n\
558 -n do not append a newline\n\
559 -e enable interpretation of the following backslash escapes\n\
560 -E explicitly suppress interpretation of backslash escapes\n\
561 \n\
562 `echo' interprets the following backslash-escaped characters:\n\
563 \\a alert (bell)\n\
564 \\b backspace\n\
565 \\c suppress further output\n\
566 \\e escape character\n\
567 \\E escape character\n\
568 \\f form feed\n\
569 \\n new line\n\
570 \\r carriage return\n\
571 \\t horizontal tab\n\
572 \\v vertical tab\n\
573 \\\\ backslash\n\
574 \\0nnn the character whose ASCII code is NNN (octal). NNN can be\n\
575 0 to 3 octal digits\n\
576 \\xHH the eight-bit character whose value is HH (hexadecimal). HH\n\
577 can be one or two hex digits\n\
578 \n\
579 Exit Status:\n\
580 Returns success unless a write error occurs."),
581#endif /* HELP_BUILTIN */
582 (char *)NULL
583};
584#endif /* V9_ECHO */
585#if !defined (V9_ECHO)
586char * const echo_doc[] = {
587#if defined (HELP_BUILTIN)
588N_("Write arguments to the standard output.\n\
589 \n\
590 Display the ARGs on the standard output followed by a newline.\n\
591 \n\
592 Options:\n\
593 -n do not append a newline\n\
594 \n\
595 Exit Status:\n\
596 Returns success unless a write error occurs."),
597#endif /* HELP_BUILTIN */
598 (char *)NULL
599};
600#endif /* !V9_ECHO */
601char * const enable_doc[] = {
602#if defined (HELP_BUILTIN)
603N_("Enable and disable shell builtins.\n\
604 \n\
605 Enables and disables builtin shell commands. Disabling allows you to\n\
606 execute a disk command which has the same name as a shell builtin\n\
607 without using a full pathname.\n\
608 \n\
609 Options:\n\
610 -a print a list of builtins showing whether or not each is enabled\n\
611 -n disable each NAME or display a list of disabled builtins\n\
612 -p print the list of builtins in a reusable format\n\
613 -s print only the names of Posix `special' builtins\n\
614 \n\
615 Options controlling dynamic loading:\n\
616 -f Load builtin NAME from shared object FILENAME\n\
617 -d Remove a builtin loaded with -f\n\
618 \n\
619 Without options, each NAME is enabled.\n\
620 \n\
621 To use the `test' found in $PATH instead of the shell builtin\n\
622 version, type `enable -n test'.\n\
623 \n\
624 Exit Status:\n\
625 Returns success unless NAME is not a shell builtin or an error occurs."),
626#endif /* HELP_BUILTIN */
627 (char *)NULL
628};
629char * const eval_doc[] = {
630#if defined (HELP_BUILTIN)
631N_("Execute arguments as a shell command.\n\
632 \n\
633 Combine ARGs into a single string, use the result as input to the shell,\n\
634 and execute the resulting commands.\n\
635 \n\
636 Exit Status:\n\
637 Returns exit status of command or success if command is null."),
638#endif /* HELP_BUILTIN */
639 (char *)NULL
640};
641char * const getopts_doc[] = {
642#if defined (HELP_BUILTIN)
643N_("Parse option arguments.\n\
644 \n\
645 Getopts is used by shell procedures to parse positional parameters\n\
646 as options.\n\
647 \n\
648 OPTSTRING contains the option letters to be recognized; if a letter\n\
649 is followed by a colon, the option is expected to have an argument,\n\
650 which should be separated from it by white space.\n\
651 \n\
652 Each time it is invoked, getopts will place the next option in the\n\
653 shell variable $name, initializing name if it does not exist, and\n\
654 the index of the next argument to be processed into the shell\n\
655 variable OPTIND. OPTIND is initialized to 1 each time the shell or\n\
656 a shell script is invoked. When an option requires an argument,\n\
657 getopts places that argument into the shell variable OPTARG.\n\
658 \n\
659 getopts reports errors in one of two ways. If the first character\n\
660 of OPTSTRING is a colon, getopts uses silent error reporting. In\n\
661 this mode, no error messages are printed. If an invalid option is\n\
662 seen, getopts places the option character found into OPTARG. If a\n\
663 required argument is not found, getopts places a ':' into NAME and\n\
664 sets OPTARG to the option character found. If getopts is not in\n\
665 silent mode, and an invalid option is seen, getopts places '?' into\n\
666 NAME and unsets OPTARG. If a required argument is not found, a '?'\n\
667 is placed in NAME, OPTARG is unset, and a diagnostic message is\n\
668 printed.\n\
669 \n\
670 If the shell variable OPTERR has the value 0, getopts disables the\n\
671 printing of error messages, even if the first character of\n\
672 OPTSTRING is not a colon. OPTERR has the value 1 by default.\n\
673 \n\
674 Getopts normally parses the positional parameters ($0 - $9), but if\n\
675 more arguments are given, they are parsed instead.\n\
676 \n\
677 Exit Status:\n\
678 Returns success if an option is found; fails if the end of options is\n\
679 encountered or an error occurs."),
680#endif /* HELP_BUILTIN */
681 (char *)NULL
682};
683char * const exec_doc[] = {
684#if defined (HELP_BUILTIN)
685N_("Replace the shell with the given command.\n\
686 \n\
687 Execute COMMAND, replacing this shell with the specified program.\n\
688 ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,\n\
689 any redirections take effect in the current shell.\n\
690 \n\
691 Options:\n\
692 -a name pass NAME as the zeroth argument to COMMAND\n\
693 -c execute COMMAND with an empty environment\n\
694 -l place a dash in the zeroth argument to COMMAND\n\
695 \n\
696 If the command cannot be executed, a non-interactive shell exits, unless\n\
697 the shell option `execfail' is set.\n\
698 \n\
699 Exit Status:\n\
700 Returns success unless COMMAND is not found or a redirection error occurs."),
701#endif /* HELP_BUILTIN */
702 (char *)NULL
703};
704char * const exit_doc[] = {
705#if defined (HELP_BUILTIN)
706N_("Exit the shell.\n\
707 \n\
708 Exits the shell with a status of N. If N is omitted, the exit status\n\
709 is that of the last command executed."),
710#endif /* HELP_BUILTIN */
711 (char *)NULL
712};
713char * const logout_doc[] = {
714#if defined (HELP_BUILTIN)
715N_("Exit a login shell.\n\
716 \n\
717 Exits a login shell with exit status N. Returns an error if not executed\n\
718 in a login shell."),
719#endif /* HELP_BUILTIN */
720 (char *)NULL
721};
722#if defined (HISTORY)
723char * const fc_doc[] = {
724#if defined (HELP_BUILTIN)
725N_("Display or execute commands from the history list.\n\
726 \n\
727 fc is used to list or edit and re-execute commands from the history list.\n\
728 FIRST and LAST can be numbers specifying the range, or FIRST can be a\n\
729 string, which means the most recent command beginning with that\n\
730 string.\n\
731 \n\
732 Options:\n\
733 -e ENAME select which editor to use. Default is FCEDIT, then EDITOR,\n\
734 then vi\n\
735 -l list lines instead of editing\n\
736 -n omit line numbers when listing\n\
737 -r reverse the order of the lines (newest listed first)\n\
738 \n\
739 With the `fc -s [pat=rep ...] [command]' format, COMMAND is\n\
740 re-executed after the substitution OLD=NEW is performed.\n\
741 \n\
742 A useful alias to use with this is r='fc -s', so that typing `r cc'\n\
743 runs the last command beginning with `cc' and typing `r' re-executes\n\
744 the last command.\n\
745 \n\
746 Exit Status:\n\
747 Returns success or status of executed command; non-zero if an error occurs."),
748#endif /* HELP_BUILTIN */
749 (char *)NULL
750};
751#endif /* HISTORY */
752#if defined (JOB_CONTROL)
753char * const fg_doc[] = {
754#if defined (HELP_BUILTIN)
755N_("Move job to the foreground.\n\
756 \n\
757 Place the job identified by JOB_SPEC in the foreground, making it the\n\
758 current job. If JOB_SPEC is not present, the shell's notion of the\n\
759 current job is used.\n\
760 \n\
761 Exit Status:\n\
762 Status of command placed in foreground, or failure if an error occurs."),
763#endif /* HELP_BUILTIN */
764 (char *)NULL
765};
766#endif /* JOB_CONTROL */
767#if defined (JOB_CONTROL)
768char * const bg_doc[] = {
769#if defined (HELP_BUILTIN)
770N_("Move jobs to the background.\n\
771 \n\
772 Place the jobs identified by each JOB_SPEC in the background, as if they\n\
773 had been started with `&'. If JOB_SPEC is not present, the shell's notion\n\
774 of the current job is used.\n\
775 \n\
776 Exit Status:\n\
777 Returns success unless job control is not enabled or an error occurs."),
778#endif /* HELP_BUILTIN */
779 (char *)NULL
780};
781#endif /* JOB_CONTROL */
782char * const hash_doc[] = {
783#if defined (HELP_BUILTIN)
784N_("Remember or display program locations.\n\
785 \n\
786 Determine and remember the full pathname of each command NAME. If\n\
787 no arguments are given, information about remembered commands is displayed.\n\
788 \n\
789 Options:\n\
790 -d forget the remembered location of each NAME\n\
791 -l display in a format that may be reused as input\n\
792 -p pathname use PATHNAME as the full pathname of NAME\n\
793 -r forget all remembered locations\n\
794 -t print the remembered location of each NAME, preceding\n\
795 each location with the corresponding NAME if multiple\n\
796 NAMEs are given\n\
797 Arguments:\n\
798 NAME Each NAME is searched for in $PATH and added to the list\n\
799 of remembered commands.\n\
800 \n\
801 Exit Status:\n\
802 Returns success unless NAME is not found or an invalid option is given."),
803#endif /* HELP_BUILTIN */
804 (char *)NULL
805};
806#if defined (HELP_BUILTIN)
807char * const help_doc[] = {
808#if defined (HELP_BUILTIN)
809N_("Display information about builtin commands.\n\
810 \n\
811 Displays brief summaries of builtin commands. If PATTERN is\n\
812 specified, gives detailed help on all commands matching PATTERN,\n\
813 otherwise the list of help topics is printed.\n\
814 \n\
815 Options:\n\
816 -d output short description for each topic\n\
817 -m display usage in pseudo-manpage format\n\
818 -s output only a short usage synopsis for each topic matching\n\
819 PATTERN\n\
820 \n\
821 Arguments:\n\
822 PATTERN Pattern specifiying a help topic\n\
823 \n\
824 Exit Status:\n\
825 Returns success unless PATTERN is not found or an invalid option is given."),
826#endif /* HELP_BUILTIN */
827 (char *)NULL
828};
829#endif /* HELP_BUILTIN */
830#if defined (HISTORY)
831char * const history_doc[] = {
832#if defined (HELP_BUILTIN)
833N_("Display or manipulate the history list.\n\
834 \n\
835 Display the history list with line numbers, prefixing each modified\n\
836 entry with a `*'. An argument of N lists only the last N entries.\n\
837 \n\
838 Options:\n\
839 -c clear the history list by deleting all of the entries\n\
840 -d offset delete the history entry at offset OFFSET.\n\
841 \n\
842 -a append history lines from this session to the history file\n\
843 -n read all history lines not already read from the history file\n\
844 -r read the history file and append the contents to the history\n\
845 list\n\
846 -w write the current history to the history file\n\
847 and append them to the history list\n\
848 \n\
849 -p perform history expansion on each ARG and display the result\n\
850 without storing it in the history list\n\
851 -s append the ARGs to the history list as a single entry\n\
852 \n\
853 If FILENAME is given, it is used as the history file. Otherwise,\n\
854 if $HISTFILE has a value, that is used, else ~/.bash_history.\n\
855 \n\
856 If the $HISTTIMEFORMAT variable is set and not null, its value is used\n\
857 as a format string for strftime(3) to print the time stamp associated\n\
858 with each displayed history entry. No time stamps are printed otherwise.\n\
859 \n\
860 Exit Status:\n\
861 Returns success unless an invalid option is given or an error occurs."),
862#endif /* HELP_BUILTIN */
863 (char *)NULL
864};
865#endif /* HISTORY */
866#if defined (JOB_CONTROL)
867char * const jobs_doc[] = {
868#if defined (HELP_BUILTIN)
869N_("Display status of jobs.\n\
870 \n\
871 Lists the active jobs. JOBSPEC restricts output to that job.\n\
872 Without options, the status of all active jobs is displayed.\n\
873 \n\
874 Options:\n\
875 -l lists process IDs in addition to the normal information\n\
876 -n lists only processes that have changed status since the last\n\
877 notification\n\
878 -p lists process IDs only\n\
879 -r restrict output to running jobs\n\
880 -s restrict output to stopped jobs\n\
881 \n\
882 If -x is supplied, COMMAND is run after all job specifications that\n\
883 appear in ARGS have been replaced with the process ID of that job's\n\
884 process group leader.\n\
885 \n\
886 Exit Status:\n\
887 Returns success unless an invalid option is given or an error occurs.\n\
888 If -x is used, returns the exit status of COMMAND."),
889#endif /* HELP_BUILTIN */
890 (char *)NULL
891};
892#endif /* JOB_CONTROL */
893#if defined (JOB_CONTROL)
894char * const disown_doc[] = {
895#if defined (HELP_BUILTIN)
896N_("Remove jobs from current shell.\n\
897 \n\
898 Removes each JOBSPEC argument from the table of active jobs. Without\n\
899 any JOBSPECs, the shell uses its notion of the current job.\n\
900 \n\
901 Options:\n\
902 -a remove all jobs if JOBSPEC is not supplied\n\
903 -h mark each JOBSPEC so that SIGHUP is not sent to the job if the\n\
904 shell receives a SIGHUP\n\
905 -r remove only running jobs\n\
906 \n\
907 Exit Status:\n\
908 Returns success unless an invalid option or JOBSPEC is given."),
909#endif /* HELP_BUILTIN */
910 (char *)NULL
911};
912#endif /* JOB_CONTROL */
913char * const kill_doc[] = {
914#if defined (HELP_BUILTIN)
915N_("Send a signal to a job.\n\
916 \n\
917 Send the processes identified by PID or JOBSPEC the signal named by\n\
918 SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then\n\
919 SIGTERM is assumed.\n\
920 \n\
921 Options:\n\
922 -s sig SIG is a signal name\n\
923 -n sig SIG is a signal number\n\
924 -l list the signal names; if arguments follow `-l' they are\n\
925 assumed to be signal numbers for which names should be listed\n\
926 \n\
927 Kill is a shell builtin for two reasons: it allows job IDs to be used\n\
928 instead of process IDs, and allows processes to be killed if the limit\n\
929 on processes that you can create is reached.\n\
930 \n\
931 Exit Status:\n\
932 Returns success unless an invalid option is given or an error occurs."),
933#endif /* HELP_BUILTIN */
934 (char *)NULL
935};
936char * const let_doc[] = {
937#if defined (HELP_BUILTIN)
938N_("Evaluate arithmetic expressions.\n\
939 \n\
940 Evaluate each ARG as an arithmetic expression. Evaluation is done in\n\
941 fixed-width integers with no check for overflow, though division by 0\n\
942 is trapped and flagged as an error. The following list of operators is\n\
943 grouped into levels of equal-precedence operators. The levels are listed\n\
944 in order of decreasing precedence.\n\
945 \n\
946 id++, id-- variable post-increment, post-decrement\n\
947 ++id, --id variable pre-increment, pre-decrement\n\
948 -, + unary minus, plus\n\
949 !, ~ logical and bitwise negation\n\
950 ** exponentiation\n\
951 *, /, % multiplication, division, remainder\n\
952 +, - addition, subtraction\n\
953 <<, >> left and right bitwise shifts\n\
954 <=, >=, <, > comparison\n\
955 ==, != equality, inequality\n\
956 & bitwise AND\n\
957 ^ bitwise XOR\n\
958 | bitwise OR\n\
959 && logical AND\n\
960 || logical OR\n\
961 expr ? expr : expr\n\
962 conditional operator\n\
963 =, *=, /=, %=,\n\
964 +=, -=, <<=, >>=,\n\
965 &=, ^=, |= assignment\n\
966 \n\
967 Shell variables are allowed as operands. The name of the variable\n\
968 is replaced by its value (coerced to a fixed-width integer) within\n\
969 an expression. The variable need not have its integer attribute\n\
970 turned on to be used in an expression.\n\
971 \n\
972 Operators are evaluated in order of precedence. Sub-expressions in\n\
973 parentheses are evaluated first and may override the precedence\n\
974 rules above.\n\
975 \n\
976 Exit Status:\n\
977 If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise."),
978#endif /* HELP_BUILTIN */
979 (char *)NULL
980};
981char * const read_doc[] = {
982#if defined (HELP_BUILTIN)
983N_("Read a line from the standard input and split it into fields.\n\
984 \n\
985 Reads a single line from the standard input, or from file descriptor FD\n\
986 if the -u option is supplied. The line is split into fields as with word\n\
987 splitting, and the first word is assigned to the first NAME, the second\n\
988 word to the second NAME, and so on, with any leftover words assigned to\n\
989 the last NAME. Only the characters found in $IFS are recognized as word\n\
990 delimiters.\n\
991 \n\
992 If no NAMEs are supplied, the line read is stored in the REPLY variable.\n\
993 \n\
994 Options:\n\
995 -a array assign the words read to sequential indices of the array\n\
996 variable ARRAY, starting at zero\n\
997 -d delim continue until the first character of DELIM is read, rather\n\
998 than newline\n\
999 -e use Readline to obtain the line in an interactive shell\n\
1000 -i text Use TEXT as the initial text for Readline\n\
1001 -n nchars return after reading NCHARS characters rather than waiting\n\
1002 for a newline, but honor a delimiter if fewer than NCHARS\n\
1003 characters are read before the delimiter\n\
1004 -N nchars return only after reading exactly NCHARS characters, unless\n\
1005 EOF is encountered or read times out, ignoring any delimiter\n\
1006 -p prompt output the string PROMPT without a trailing newline before\n\
1007 attempting to read\n\
1008 -r do not allow backslashes to escape any characters\n\
1009 -s do not echo input coming from a terminal\n\
1010 -t timeout time out and return failure if a complete line of input is\n\
1011 not read within TIMEOUT seconds. The value of the TMOUT\n\
1012 variable is the default timeout. TIMEOUT may be a\n\
1013 fractional number. If TIMEOUT is 0, read returns immediately,\n\
1014 without trying to read any data, returning success only if\n\
1015 input is available on the specified file descriptor. The\n\
1016 exit status is greater than 128 if the timeout is exceeded\n\
1017 -u fd read from file descriptor FD instead of the standard input\n\
1018 \n\
1019 Exit Status:\n\
1020 The return code is zero, unless end-of-file is encountered, read times out\n\
1021 (in which case it's greater than 128), a variable assignment error occurs,\n\
1022 or an invalid file descriptor is supplied as the argument to -u."),
1023#endif /* HELP_BUILTIN */
1024 (char *)NULL
1025};
1026char * const return_doc[] = {
1027#if defined (HELP_BUILTIN)
1028N_("Return from a shell function.\n\
1029 \n\
1030 Causes a function or sourced script to exit with the return value\n\
1031 specified by N. If N is omitted, the return status is that of the\n\
1032 last command executed within the function or script.\n\
1033 \n\
1034 Exit Status:\n\
1035 Returns N, or failure if the shell is not executing a function or script."),
1036#endif /* HELP_BUILTIN */
1037 (char *)NULL
1038};
1039char * const set_doc[] = {
1040#if defined (HELP_BUILTIN)
1041N_("Set or unset values of shell options and positional parameters.\n\
1042 \n\
1043 Change the value of shell attributes and positional parameters, or\n\
1044 display the names and values of shell variables.\n\
1045 \n\
1046 Options:\n\
1047 -a Mark variables which are modified or created for export.\n\
1048 -b Notify of job termination immediately.\n\
1049 -e Exit immediately if a command exits with a non-zero status.\n\
1050 -f Disable file name generation (globbing).\n\
1051 -h Remember the location of commands as they are looked up.\n\
1052 -k All assignment arguments are placed in the environment for a\n\
1053 command, not just those that precede the command name.\n\
1054 -m Job control is enabled.\n\
1055 -n Read commands but do not execute them.\n\
1056 -o option-name\n\
1057 Set the variable corresponding to option-name:\n\
1058 allexport same as -a\n\
1059 braceexpand same as -B\n\
1060 emacs use an emacs-style line editing interface\n\
1061 errexit same as -e\n\
1062 errtrace same as -E\n\
1063 functrace same as -T\n\
1064 hashall same as -h\n\
1065 histexpand same as -H\n\
1066 history enable command history\n\
1067 ignoreeof the shell will not exit upon reading EOF\n\
1068 interactive-comments\n\
1069 allow comments to appear in interactive commands\n\
1070 keyword same as -k\n\
1071 monitor same as -m\n\
1072 noclobber same as -C\n\
1073 noexec same as -n\n\
1074 noglob same as -f\n\
1075 nolog currently accepted but ignored\n\
1076 notify same as -b\n\
1077 nounset same as -u\n\
1078 onecmd same as -t\n\
1079 physical same as -P\n\
1080 pipefail the return value of a pipeline is the status of\n\
1081 the last command to exit with a non-zero status,\n\
1082 or zero if no command exited with a non-zero status\n\
1083 posix change the behavior of bash where the default\n\
1084 operation differs from the Posix standard to\n\
1085 match the standard\n\
1086 privileged same as -p\n\
1087 verbose same as -v\n\
1088 vi use a vi-style line editing interface\n\
1089 xtrace same as -x\n\
1090 -p Turned on whenever the real and effective user ids do not match.\n\
1091 Disables processing of the $ENV file and importing of shell\n\
1092 functions. Turning this option off causes the effective uid and\n\
1093 gid to be set to the real uid and gid.\n\
1094 -t Exit after reading and executing one command.\n\
1095 -u Treat unset variables as an error when substituting.\n\
1096 -v Print shell input lines as they are read.\n\
1097 -x Print commands and their arguments as they are executed.\n\
1098 -B the shell will perform brace expansion\n\
1099 -C If set, disallow existing regular files to be overwritten\n\
1100 by redirection of output.\n\
1101 -E If set, the ERR trap is inherited by shell functions.\n\
1102 -H Enable ! style history substitution. This flag is on\n\
1103 by default when the shell is interactive.\n\
1104 -P If set, do not resolve symbolic links when executing commands\n\
1105 such as cd which change the current directory.\n\
1106 -T If set, the DEBUG trap is inherited by shell functions.\n\
1107 -- Assign any remaining arguments to the positional parameters.\n\
1108 If there are no remaining arguments, the positional parameters\n\
1109 are unset.\n\
1110 - Assign any remaining arguments to the positional parameters.\n\
1111 The -x and -v options are turned off.\n\
1112 \n\
1113 Using + rather than - causes these flags to be turned off. The\n\
1114 flags can also be used upon invocation of the shell. The current\n\
1115 set of flags may be found in $-. The remaining n ARGs are positional\n\
1116 parameters and are assigned, in order, to $1, $2, .. $n. If no\n\
1117 ARGs are given, all shell variables are printed.\n\
1118 \n\
1119 Exit Status:\n\
1120 Returns success unless an invalid option is given."),
1121#endif /* HELP_BUILTIN */
1122 (char *)NULL
1123};
1124char * const unset_doc[] = {
1125#if defined (HELP_BUILTIN)
1126N_("Unset values and attributes of shell variables and functions.\n\
1127 \n\
1128 For each NAME, remove the corresponding variable or function.\n\
1129 \n\
1130 Options:\n\
1131 -f treat each NAME as a shell function\n\
1132 -v treat each NAME as a shell variable\n\
1133 -n treat each NAME as a name reference and unset the variable itself\n\
1134 rather than the variable it references\n\
1135 \n\
1136 Without options, unset first tries to unset a variable, and if that fails,\n\
1137 tries to unset a function.\n\
1138 \n\
1139 Some variables cannot be unset; also see `readonly'.\n\
1140 \n\
1141 Exit Status:\n\
1142 Returns success unless an invalid option is given or a NAME is read-only."),
1143#endif /* HELP_BUILTIN */
1144 (char *)NULL
1145};
1146char * const export_doc[] = {
1147#if defined (HELP_BUILTIN)
1148N_("Set export attribute for shell variables.\n\
1149 \n\
1150 Marks each NAME for automatic export to the environment of subsequently\n\
1151 executed commands. If VALUE is supplied, assign VALUE before exporting.\n\
1152 \n\
1153 Options:\n\
1154 -f refer to shell functions\n\
1155 -n remove the export property from each NAME\n\
1156 -p display a list of all exported variables and functions\n\
1157 \n\
1158 An argument of `--' disables further option processing.\n\
1159 \n\
1160 Exit Status:\n\
1161 Returns success unless an invalid option is given or NAME is invalid."),
1162#endif /* HELP_BUILTIN */
1163 (char *)NULL
1164};
1165char * const readonly_doc[] = {
1166#if defined (HELP_BUILTIN)
1167N_("Mark shell variables as unchangeable.\n\
1168 \n\
1169 Mark each NAME as read-only; the values of these NAMEs may not be\n\
1170 changed by subsequent assignment. If VALUE is supplied, assign VALUE\n\
1171 before marking as read-only.\n\
1172 \n\
1173 Options:\n\
1174 -a refer to indexed array variables\n\
1175 -A refer to associative array variables\n\
1176 -f refer to shell functions\n\
1177 -p display a list of all readonly variables or functions, depending on\n\
1178 whether or not the -f option is given\n\
1179 \n\
1180 An argument of `--' disables further option processing.\n\
1181 \n\
1182 Exit Status:\n\
1183 Returns success unless an invalid option is given or NAME is invalid."),
1184#endif /* HELP_BUILTIN */
1185 (char *)NULL
1186};
1187char * const shift_doc[] = {
1188#if defined (HELP_BUILTIN)
1189N_("Shift positional parameters.\n\
1190 \n\
1191 Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is\n\
1192 not given, it is assumed to be 1.\n\
1193 \n\
1194 Exit Status:\n\
1195 Returns success unless N is negative or greater than $#."),
1196#endif /* HELP_BUILTIN */
1197 (char *)NULL
1198};
1199char * const source_doc[] = {
1200#if defined (HELP_BUILTIN)
1201N_("Execute commands from a file in the current shell.\n\
1202 \n\
1203 Read and execute commands from FILENAME in the current shell. The\n\
1204 entries in $PATH are used to find the directory containing FILENAME.\n\
1205 If any ARGUMENTS are supplied, they become the positional parameters\n\
1206 when FILENAME is executed.\n\
1207 \n\
1208 Exit Status:\n\
1209 Returns the status of the last command executed in FILENAME; fails if\n\
1210 FILENAME cannot be read."),
1211#endif /* HELP_BUILTIN */
1212 (char *)NULL
1213};
1214char * const dot_doc[] = {
1215#if defined (HELP_BUILTIN)
1216N_("Execute commands from a file in the current shell.\n\
1217 \n\
1218 Read and execute commands from FILENAME in the current shell. The\n\
1219 entries in $PATH are used to find the directory containing FILENAME.\n\
1220 If any ARGUMENTS are supplied, they become the positional parameters\n\
1221 when FILENAME is executed.\n\
1222 \n\
1223 Exit Status:\n\
1224 Returns the status of the last command executed in FILENAME; fails if\n\
1225 FILENAME cannot be read."),
1226#endif /* HELP_BUILTIN */
1227 (char *)NULL
1228};
1229#if defined (JOB_CONTROL)
1230char * const suspend_doc[] = {
1231#if defined (HELP_BUILTIN)
1232N_("Suspend shell execution.\n\
1233 \n\
1234 Suspend the execution of this shell until it receives a SIGCONT signal.\n\
1235 Unless forced, login shells cannot be suspended.\n\
1236 \n\
1237 Options:\n\
1238 -f force the suspend, even if the shell is a login shell\n\
1239 \n\
1240 Exit Status:\n\
1241 Returns success unless job control is not enabled or an error occurs."),
1242#endif /* HELP_BUILTIN */
1243 (char *)NULL
1244};
1245#endif /* JOB_CONTROL */
1246char * const test_doc[] = {
1247#if defined (HELP_BUILTIN)
1248N_("Evaluate conditional expression.\n\
1249 \n\
1250 Exits with a status of 0 (true) or 1 (false) depending on\n\
1251 the evaluation of EXPR. Expressions may be unary or binary. Unary\n\
1252 expressions are often used to examine the status of a file. There\n\
1253 are string operators and numeric comparison operators as well.\n\
1254 \n\
1255 The behavior of test depends on the number of arguments. Read the\n\
1256 bash manual page for the complete specification.\n\
1257 \n\
1258 File operators:\n\
1259 \n\
1260 -a FILE True if file exists.\n\
1261 -b FILE True if file is block special.\n\
1262 -c FILE True if file is character special.\n\
1263 -d FILE True if file is a directory.\n\
1264 -e FILE True if file exists.\n\
1265 -f FILE True if file exists and is a regular file.\n\
1266 -g FILE True if file is set-group-id.\n\
1267 -h FILE True if file is a symbolic link.\n\
1268 -L FILE True if file is a symbolic link.\n\
1269 -k FILE True if file has its `sticky' bit set.\n\
1270 -p FILE True if file is a named pipe.\n\
1271 -r FILE True if file is readable by you.\n\
1272 -s FILE True if file exists and is not empty.\n\
1273 -S FILE True if file is a socket.\n\
1274 -t FD True if FD is opened on a terminal.\n\
1275 -u FILE True if the file is set-user-id.\n\
1276 -w FILE True if the file is writable by you.\n\
1277 -x FILE True if the file is executable by you.\n\
1278 -O FILE True if the file is effectively owned by you.\n\
1279 -G FILE True if the file is effectively owned by your group.\n\
1280 -N FILE True if the file has been modified since it was last read.\n\
1281 \n\
1282 FILE1 -nt FILE2 True if file1 is newer than file2 (according to\n\
1283 modification date).\n\
1284 \n\
1285 FILE1 -ot FILE2 True if file1 is older than file2.\n\
1286 \n\
1287 FILE1 -ef FILE2 True if file1 is a hard link to file2.\n\
1288 \n\
1289 String operators:\n\
1290 \n\
1291 -z STRING True if string is empty.\n\
1292 \n\
1293 -n STRING\n\
1294 STRING True if string is not empty.\n\
1295 \n\
1296 STRING1 = STRING2\n\
1297 True if the strings are equal.\n\
1298 STRING1 != STRING2\n\
1299 True if the strings are not equal.\n\
1300 STRING1 < STRING2\n\
1301 True if STRING1 sorts before STRING2 lexicographically.\n\
1302 STRING1 > STRING2\n\
1303 True if STRING1 sorts after STRING2 lexicographically.\n\
1304 \n\
1305 Other operators:\n\
1306 \n\
1307 -o OPTION True if the shell option OPTION is enabled.\n\
1308 -v VAR True if the shell variable VAR is set\n\
1309 -R VAR True if the shell variable VAR is set and is a name reference.\n\
1310 ! EXPR True if expr is false.\n\
1311 EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.\n\
1312 EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.\n\
1313 \n\
1314 arg1 OP arg2 Arithmetic tests. OP is one of -eq, -ne,\n\
1315 -lt, -le, -gt, or -ge.\n\
1316 \n\
1317 Arithmetic binary operators return true if ARG1 is equal, not-equal,\n\
1318 less-than, less-than-or-equal, greater-than, or greater-than-or-equal\n\
1319 than ARG2.\n\
1320 \n\
1321 Exit Status:\n\
1322 Returns success if EXPR evaluates to true; fails if EXPR evaluates to\n\
1323 false or an invalid argument is given."),
1324#endif /* HELP_BUILTIN */
1325 (char *)NULL
1326};
1327char * const test_bracket_doc[] = {
1328#if defined (HELP_BUILTIN)
1329N_("Evaluate conditional expression.\n\
1330 \n\
1331 This is a synonym for the \"test\" builtin, but the last argument must\n\
1332 be a literal `]', to match the opening `['."),
1333#endif /* HELP_BUILTIN */
1334 (char *)NULL
1335};
1336char * const times_doc[] = {
1337#if defined (HELP_BUILTIN)
1338N_("Display process times.\n\
1339 \n\
1340 Prints the accumulated user and system times for the shell and all of its\n\
1341 child processes.\n\
1342 \n\
1343 Exit Status:\n\
1344 Always succeeds."),
1345#endif /* HELP_BUILTIN */
1346 (char *)NULL
1347};
1348char * const trap_doc[] = {
1349#if defined (HELP_BUILTIN)
1350N_("Trap signals and other events.\n\
1351 \n\
1352 Defines and activates handlers to be run when the shell receives signals\n\
1353 or other conditions.\n\
1354 \n\
1355 ARG is a command to be read and executed when the shell receives the\n\
1356 signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC\n\
1357 is supplied) or `-', each specified signal is reset to its original\n\
1358 value. If ARG is the null string each SIGNAL_SPEC is ignored by the\n\
1359 shell and by the commands it invokes.\n\
1360 \n\
1361 If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. If\n\
1362 a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. If\n\
1363 a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or a\n\
1364 script run by the . or source builtins finishes executing. A SIGNAL_SPEC\n\
1365 of ERR means to execute ARG each time a command's failure would cause the\n\
1366 shell to exit when the -e option is enabled.\n\
1367 \n\
1368 If no arguments are supplied, trap prints the list of commands associated\n\
1369 with each signal.\n\
1370 \n\
1371 Options:\n\
1372 -l print a list of signal names and their corresponding numbers\n\
1373 -p display the trap commands associated with each SIGNAL_SPEC\n\
1374 \n\
1375 Each SIGNAL_SPEC is either a signal name in <signal.h> or a signal number.\n\
1376 Signal names are case insensitive and the SIG prefix is optional. A\n\
1377 signal may be sent to the shell with \"kill -signal $$\".\n\
1378 \n\
1379 Exit Status:\n\
1380 Returns success unless a SIGSPEC is invalid or an invalid option is given."),
1381#endif /* HELP_BUILTIN */
1382 (char *)NULL
1383};
1384char * const type_doc[] = {
1385#if defined (HELP_BUILTIN)
1386N_("Display information about command type.\n\
1387 \n\
1388 For each NAME, indicate how it would be interpreted if used as a\n\
1389 command name.\n\
1390 \n\
1391 Options:\n\
1392 -a display all locations containing an executable named NAME;\n\
1393 includes aliases, builtins, and functions, if and only if\n\
1394 the `-p' option is not also used\n\
1395 -f suppress shell function lookup\n\
1396 -P force a PATH search for each NAME, even if it is an alias,\n\
1397 builtin, or function, and returns the name of the disk file\n\
1398 that would be executed\n\
1399 -p returns either the name of the disk file that would be executed,\n\
1400 or nothing if `type -t NAME' would not return `file'.\n\
1401 -t output a single word which is one of `alias', `keyword',\n\
1402 `function', `builtin', `file' or `', if NAME is an alias, shell\n\
1403 reserved word, shell function, shell builtin, disk file, or not\n\
1404 found, respectively\n\
1405 \n\
1406 Arguments:\n\
1407 NAME Command name to be interpreted.\n\
1408 \n\
1409 Exit Status:\n\
1410 Returns success if all of the NAMEs are found; fails if any are not found."),
1411#endif /* HELP_BUILTIN */
1412 (char *)NULL
1413};
1414#if !defined (_MINIX)
1415char * const ulimit_doc[] = {
1416#if defined (HELP_BUILTIN)
1417N_("Modify shell resource limits.\n\
1418 \n\
1419 Provides control over the resources available to the shell and processes\n\
1420 it creates, on systems that allow such control.\n\
1421 \n\
1422 Options:\n\
1423 -S use the `soft' resource limit\n\
1424 -H use the `hard' resource limit\n\
1425 -a all current limits are reported\n\
1426 -b the socket buffer size\n\
1427 -c the maximum size of core files created\n\
1428 -d the maximum size of a process's data segment\n\
1429 -e the maximum scheduling priority (`nice')\n\
1430 -f the maximum size of files written by the shell and its children\n\
1431 -i the maximum number of pending signals\n\
1432 -l the maximum size a process may lock into memory\n\
1433 -m the maximum resident set size\n\
1434 -n the maximum number of open file descriptors\n\
1435 -p the pipe buffer size\n\
1436 -q the maximum number of bytes in POSIX message queues\n\
1437 -r the maximum real-time scheduling priority\n\
1438 -s the maximum stack size\n\
1439 -t the maximum amount of cpu time in seconds\n\
1440 -u the maximum number of user processes\n\
1441 -v the size of virtual memory\n\
1442 -x the maximum number of file locks\n\
1443 -T the maximum number of threads\n\
1444 \n\
1445 Not all options are available on all platforms.\n\
1446 \n\
1447 If LIMIT is given, it is the new value of the specified resource; the\n\
1448 special LIMIT values `soft', `hard', and `unlimited' stand for the\n\
1449 current soft limit, the current hard limit, and no limit, respectively.\n\
1450 Otherwise, the current value of the specified resource is printed. If\n\
1451 no option is given, then -f is assumed.\n\
1452 \n\
1453 Values are in 1024-byte increments, except for -t, which is in seconds,\n\
1454 -p, which is in increments of 512 bytes, and -u, which is an unscaled\n\
1455 number of processes.\n\
1456 \n\
1457 Exit Status:\n\
1458 Returns success unless an invalid option is supplied or an error occurs."),
1459#endif /* HELP_BUILTIN */
1460 (char *)NULL
1461};
1462#endif /* !_MINIX */
1463char * const umask_doc[] = {
1464#if defined (HELP_BUILTIN)
1465N_("Display or set file mode mask.\n\
1466 \n\
1467 Sets the user file-creation mask to MODE. If MODE is omitted, prints\n\
1468 the current value of the mask.\n\
1469 \n\
1470 If MODE begins with a digit, it is interpreted as an octal number;\n\
1471 otherwise it is a symbolic mode string like that accepted by chmod(1).\n\
1472 \n\
1473 Options:\n\
1474 -p if MODE is omitted, output in a form that may be reused as input\n\
1475 -S makes the output symbolic; otherwise an octal number is output\n\
1476 \n\
1477 Exit Status:\n\
1478 Returns success unless MODE is invalid or an invalid option is given."),
1479#endif /* HELP_BUILTIN */
1480 (char *)NULL
1481};
1482#if defined (JOB_CONTROL)
1483char * const wait_doc[] = {
1484#if defined (HELP_BUILTIN)
1485N_("Wait for job completion and return exit status.\n\
1486 \n\
1487 Waits for each process identified by an ID, which may be a process ID or a\n\
1488 job specification, and reports its termination status. If ID is not\n\
1489 given, waits for all currently active child processes, and the return\n\
1490 status is zero. If ID is a a job specification, waits for all processes\n\
1491 in that job's pipeline.\n\
1492 \n\
1493 If the -n option is supplied, waits for the next job to terminate and\n\
1494 returns its exit status.\n\
1495 \n\
1496 Exit Status:\n\
1497 Returns the status of the last ID; fails if ID is invalid or an invalid\n\
1498 option is given."),
1499#endif /* HELP_BUILTIN */
1500 (char *)NULL
1501};
1502#endif /* JOB_CONTROL */
1503#if !defined (JOB_CONTROL)
1504char * const wait_doc[] = {
1505#if defined (HELP_BUILTIN)
1506N_("Wait for process completion and return exit status.\n\
1507 \n\
1508 Waits for each process specified by a PID and reports its termination status.\n\
1509 If PID is not given, waits for all currently active child processes,\n\
1510 and the return status is zero. PID must be a process ID.\n\
1511 \n\
1512 Exit Status:\n\
1513 Returns the status of the last PID; fails if PID is invalid or an invalid\n\
1514 option is given."),
1515#endif /* HELP_BUILTIN */
1516 (char *)NULL
1517};
1518#endif /* !JOB_CONTROL */
1519char * const for_doc[] = {
1520#if defined (HELP_BUILTIN)
1521N_("Execute commands for each member in a list.\n\
1522 \n\
1523 The `for' loop executes a sequence of commands for each member in a\n\
1524 list of items. If `in WORDS ...;' is not present, then `in \"$@\"' is\n\
1525 assumed. For each element in WORDS, NAME is set to that element, and\n\
1526 the COMMANDS are executed.\n\
1527 \n\
1528 Exit Status:\n\
1529 Returns the status of the last command executed."),
1530#endif /* HELP_BUILTIN */
1531 (char *)NULL
1532};
1533char * const arith_for_doc[] = {
1534#if defined (HELP_BUILTIN)
1535N_("Arithmetic for loop.\n\
1536 \n\
1537 Equivalent to\n\
1538 (( EXP1 ))\n\
1539 while (( EXP2 )); do\n\
1540 COMMANDS\n\
1541 (( EXP3 ))\n\
1542 done\n\
1543 EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is\n\
1544 omitted, it behaves as if it evaluates to 1.\n\
1545 \n\
1546 Exit Status:\n\
1547 Returns the status of the last command executed."),
1548#endif /* HELP_BUILTIN */
1549 (char *)NULL
1550};
1551char * const select_doc[] = {
1552#if defined (HELP_BUILTIN)
1553N_("Select words from a list and execute commands.\n\
1554 \n\
1555 The WORDS are expanded, generating a list of words. The\n\
1556 set of expanded words is printed on the standard error, each\n\
1557 preceded by a number. If `in WORDS' is not present, `in \"$@\"'\n\
1558 is assumed. The PS3 prompt is then displayed and a line read\n\
1559 from the standard input. If the line consists of the number\n\
1560 corresponding to one of the displayed words, then NAME is set\n\
1561 to that word. If the line is empty, WORDS and the prompt are\n\
1562 redisplayed. If EOF is read, the command completes. Any other\n\
1563 value read causes NAME to be set to null. The line read is saved\n\
1564 in the variable REPLY. COMMANDS are executed after each selection\n\
1565 until a break command is executed.\n\
1566 \n\
1567 Exit Status:\n\
1568 Returns the status of the last command executed."),
1569#endif /* HELP_BUILTIN */
1570 (char *)NULL
1571};
1572char * const time_doc[] = {
1573#if defined (HELP_BUILTIN)
1574N_("Report time consumed by pipeline's execution.\n\
1575 \n\
1576 Execute PIPELINE and print a summary of the real time, user CPU time,\n\
1577 and system CPU time spent executing PIPELINE when it terminates.\n\
1578 \n\
1579 Options:\n\
1580 -p print the timing summary in the portable Posix format\n\
1581 \n\
1582 The value of the TIMEFORMAT variable is used as the output format.\n\
1583 \n\
1584 Exit Status:\n\
1585 The return status is the return status of PIPELINE."),
1586#endif /* HELP_BUILTIN */
1587 (char *)NULL
1588};
1589char * const case_doc[] = {
1590#if defined (HELP_BUILTIN)
1591N_("Execute commands based on pattern matching.\n\
1592 \n\
1593 Selectively execute COMMANDS based upon WORD matching PATTERN. The\n\
1594 `|' is used to separate multiple patterns.\n\
1595 \n\
1596 Exit Status:\n\
1597 Returns the status of the last command executed."),
1598#endif /* HELP_BUILTIN */
1599 (char *)NULL
1600};
1601char * const if_doc[] = {
1602#if defined (HELP_BUILTIN)
1603N_("Execute commands based on conditional.\n\
1604 \n\
1605 The `if COMMANDS' list is executed. If its exit status is zero, then the\n\
1606 `then COMMANDS' list is executed. Otherwise, each `elif COMMANDS' list is\n\
1607 executed in turn, and if its exit status is zero, the corresponding\n\
1608 `then COMMANDS' list is executed and the if command completes. Otherwise,\n\
1609 the `else COMMANDS' list is executed, if present. The exit status of the\n\
1610 entire construct is the exit status of the last command executed, or zero\n\
1611 if no condition tested true.\n\
1612 \n\
1613 Exit Status:\n\
1614 Returns the status of the last command executed."),
1615#endif /* HELP_BUILTIN */
1616 (char *)NULL
1617};
1618char * const while_doc[] = {
1619#if defined (HELP_BUILTIN)
1620N_("Execute commands as long as a test succeeds.\n\
1621 \n\
1622 Expand and execute COMMANDS as long as the final command in the\n\
1623 `while' COMMANDS has an exit status of zero.\n\
1624 \n\
1625 Exit Status:\n\
1626 Returns the status of the last command executed."),
1627#endif /* HELP_BUILTIN */
1628 (char *)NULL
1629};
1630char * const until_doc[] = {
1631#if defined (HELP_BUILTIN)
1632N_("Execute commands as long as a test does not succeed.\n\
1633 \n\
1634 Expand and execute COMMANDS as long as the final command in the\n\
1635 `until' COMMANDS has an exit status which is not zero.\n\
1636 \n\
1637 Exit Status:\n\
1638 Returns the status of the last command executed."),
1639#endif /* HELP_BUILTIN */
1640 (char *)NULL
1641};
1642char * const coproc_doc[] = {
1643#if defined (HELP_BUILTIN)
1644N_("Create a coprocess named NAME.\n\
1645 \n\
1646 Execute COMMAND asynchronously, with the standard output and standard\n\
1647 input of the command connected via a pipe to file descriptors assigned\n\
1648 to indices 0 and 1 of an array variable NAME in the executing shell.\n\
1649 The default NAME is \"COPROC\".\n\
1650 \n\
1651 Exit Status:\n\
1652 Returns the exit status of COMMAND."),
1653#endif /* HELP_BUILTIN */
1654 (char *)NULL
1655};
1656char * const function_doc[] = {
1657#if defined (HELP_BUILTIN)
1658N_("Define shell function.\n\
1659 \n\
1660 Create a shell function named NAME. When invoked as a simple command,\n\
1661 NAME runs COMMANDs in the calling shell's context. When NAME is invoked,\n\
1662 the arguments are passed to the function as $1...$n, and the function's\n\
1663 name is in $FUNCNAME.\n\
1664 \n\
1665 Exit Status:\n\
1666 Returns success unless NAME is readonly."),
1667#endif /* HELP_BUILTIN */
1668 (char *)NULL
1669};
1670char * const grouping_braces_doc[] = {
1671#if defined (HELP_BUILTIN)
1672N_("Group commands as a unit.\n\
1673 \n\
1674 Run a set of commands in a group. This is one way to redirect an\n\
1675 entire set of commands.\n\
1676 \n\
1677 Exit Status:\n\
1678 Returns the status of the last command executed."),
1679#endif /* HELP_BUILTIN */
1680 (char *)NULL
1681};
1682char * const fg_percent_doc[] = {
1683#if defined (HELP_BUILTIN)
1684N_("Resume job in foreground.\n\
1685 \n\
1686 Equivalent to the JOB_SPEC argument to the `fg' command. Resume a\n\
1687 stopped or background job. JOB_SPEC can specify either a job name\n\
1688 or a job number. Following JOB_SPEC with a `&' places the job in\n\
1689 the background, as if the job specification had been supplied as an\n\
1690 argument to `bg'.\n\
1691 \n\
1692 Exit Status:\n\
1693 Returns the status of the resumed job."),
1694#endif /* HELP_BUILTIN */
1695 (char *)NULL
1696};
1697char * const arith_doc[] = {
1698#if defined (HELP_BUILTIN)
1699N_("Evaluate arithmetic expression.\n\
1700 \n\
1701 The EXPRESSION is evaluated according to the rules for arithmetic\n\
1702 evaluation. Equivalent to \"let EXPRESSION\".\n\
1703 \n\
1704 Exit Status:\n\
1705 Returns 1 if EXPRESSION evaluates to 0; returns 0 otherwise."),
1706#endif /* HELP_BUILTIN */
1707 (char *)NULL
1708};
1709char * const conditional_doc[] = {
1710#if defined (HELP_BUILTIN)
1711N_("Execute conditional command.\n\
1712 \n\
1713 Returns a status of 0 or 1 depending on the evaluation of the conditional\n\
1714 expression EXPRESSION. Expressions are composed of the same primaries used\n\
1715 by the `test' builtin, and may be combined using the following operators:\n\
1716 \n\
1717 ( EXPRESSION ) Returns the value of EXPRESSION\n\
1718 ! EXPRESSION True if EXPRESSION is false; else false\n\
1719 EXPR1 && EXPR2 True if both EXPR1 and EXPR2 are true; else false\n\
1720 EXPR1 || EXPR2 True if either EXPR1 or EXPR2 is true; else false\n\
1721 \n\
1722 When the `==' and `!=' operators are used, the string to the right of\n\
1723 the operator is used as a pattern and pattern matching is performed.\n\
1724 When the `=~' operator is used, the string to the right of the operator\n\
1725 is matched as a regular expression.\n\
1726 \n\
1727 The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to\n\
1728 determine the expression's value.\n\
1729 \n\
1730 Exit Status:\n\
1731 0 or 1 depending on value of EXPRESSION."),
1732#endif /* HELP_BUILTIN */
1733 (char *)NULL
1734};
1735char * const variable_help_doc[] = {
1736#if defined (HELP_BUILTIN)
1737N_("Common shell variable names and usage.\n\
1738 \n\
1739 BASH_VERSION Version information for this Bash.\n\
1740 CDPATH A colon-separated list of directories to search\n\
1741 for directories given as arguments to `cd'.\n\
1742 GLOBIGNORE A colon-separated list of patterns describing filenames to\n\
1743 be ignored by pathname expansion.\n\
1744 HISTFILE The name of the file where your command history is stored.\n\
1745 HISTFILESIZE The maximum number of lines this file can contain.\n\
1746 HISTSIZE The maximum number of history lines that a running\n\
1747 shell can access.\n\
1748 HOME The complete pathname to your login directory.\n\
1749 HOSTNAME The name of the current host.\n\
1750 HOSTTYPE The type of CPU this version of Bash is running under.\n\
1751 IGNOREEOF Controls the action of the shell on receipt of an EOF\n\
1752 character as the sole input. If set, then the value\n\
1753 of it is the number of EOF characters that can be seen\n\
1754 in a row on an empty line before the shell will exit\n\
1755 (default 10). When unset, EOF signifies the end of input.\n\
1756 MACHTYPE A string describing the current system Bash is running on.\n\
1757 MAILCHECK How often, in seconds, Bash checks for new mail.\n\
1758 MAILPATH A colon-separated list of filenames which Bash checks\n\
1759 for new mail.\n\
1760 OSTYPE The version of Unix this version of Bash is running on.\n\
1761 PATH A colon-separated list of directories to search when\n\
1762 looking for commands.\n\
1763 PROMPT_COMMAND A command to be executed before the printing of each\n\
1764 primary prompt.\n\
1765 PS1 The primary prompt string.\n\
1766 PS2 The secondary prompt string.\n\
1767 PWD The full pathname of the current directory.\n\
1768 SHELLOPTS A colon-separated list of enabled shell options.\n\
1769 TERM The name of the current terminal type.\n\
1770 TIMEFORMAT The output format for timing statistics displayed by the\n\
1771 `time' reserved word.\n\
1772 auto_resume Non-null means a command word appearing on a line by\n\
1773 itself is first looked for in the list of currently\n\
1774 stopped jobs. If found there, that job is foregrounded.\n\
1775 A value of `exact' means that the command word must\n\
1776 exactly match a command in the list of stopped jobs. A\n\
1777 value of `substring' means that the command word must\n\
1778 match a substring of the job. Any other value means that\n\
1779 the command must be a prefix of a stopped job.\n\
1780 histchars Characters controlling history expansion and quick\n\
1781 substitution. The first character is the history\n\
1782 substitution character, usually `!'. The second is\n\
1783 the `quick substitution' character, usually `^'. The\n\
1784 third is the `history comment' character, usually `#'.\n\
1785 HISTIGNORE A colon-separated list of patterns used to decide which\n\
1786 commands should be saved on the history list.\n\
1787"),
1788#endif /* HELP_BUILTIN */
1789 (char *)NULL
1790};
1791#if defined (PUSHD_AND_POPD)
1792char * const pushd_doc[] = {
1793#if defined (HELP_BUILTIN)
1794N_("Add directories to stack.\n\
1795 \n\
1796 Adds a directory to the top of the directory stack, or rotates\n\
1797 the stack, making the new top of the stack the current working\n\
1798 directory. With no arguments, exchanges the top two directories.\n\
1799 \n\
1800 Options:\n\
1801 -n Suppresses the normal change of directory when adding\n\
1802 directories to the stack, so only the stack is manipulated.\n\
1803 \n\
1804 Arguments:\n\
1805 +N Rotates the stack so that the Nth directory (counting\n\
1806 from the left of the list shown by `dirs', starting with\n\
1807 zero) is at the top.\n\
1808 \n\
1809 -N Rotates the stack so that the Nth directory (counting\n\
1810 from the right of the list shown by `dirs', starting with\n\
1811 zero) is at the top.\n\
1812 \n\
1813 dir Adds DIR to the directory stack at the top, making it the\n\
1814 new current working directory.\n\
1815 \n\
1816 The `dirs' builtin displays the directory stack.\n\
1817 \n\
1818 Exit Status:\n\
1819 Returns success unless an invalid argument is supplied or the directory\n\
1820 change fails."),
1821#endif /* HELP_BUILTIN */
1822 (char *)NULL
1823};
1824#endif /* PUSHD_AND_POPD */
1825#if defined (PUSHD_AND_POPD)
1826char * const popd_doc[] = {
1827#if defined (HELP_BUILTIN)
1828N_("Remove directories from stack.\n\
1829 \n\
1830 Removes entries from the directory stack. With no arguments, removes\n\
1831 the top directory from the stack, and changes to the new top directory.\n\
1832 \n\
1833 Options:\n\
1834 -n Suppresses the normal change of directory when removing\n\
1835 directories from the stack, so only the stack is manipulated.\n\
1836 \n\
1837 Arguments:\n\
1838 +N Removes the Nth entry counting from the left of the list\n\
1839 shown by `dirs', starting with zero. For example: `popd +0'\n\
1840 removes the first directory, `popd +1' the second.\n\
1841 \n\
1842 -N Removes the Nth entry counting from the right of the list\n\
1843 shown by `dirs', starting with zero. For example: `popd -0'\n\
1844 removes the last directory, `popd -1' the next to last.\n\
1845 \n\
1846 The `dirs' builtin displays the directory stack.\n\
1847 \n\
1848 Exit Status:\n\
1849 Returns success unless an invalid argument is supplied or the directory\n\
1850 change fails."),
1851#endif /* HELP_BUILTIN */
1852 (char *)NULL
1853};
1854#endif /* PUSHD_AND_POPD */
1855#if defined (PUSHD_AND_POPD)
1856char * const dirs_doc[] = {
1857#if defined (HELP_BUILTIN)
1858N_("Display directory stack.\n\
1859 \n\
1860 Display the list of currently remembered directories. Directories\n\
1861 find their way onto the list with the `pushd' command; you can get\n\
1862 back up through the list with the `popd' command.\n\
1863 \n\
1864 Options:\n\
1865 -c clear the directory stack by deleting all of the elements\n\
1866 -l do not print tilde-prefixed versions of directories relative\n\
1867 to your home directory\n\
1868 -p print the directory stack with one entry per line\n\
1869 -v print the directory stack with one entry per line prefixed\n\
1870 with its position in the stack\n\
1871 \n\
1872 Arguments:\n\
1873 +N Displays the Nth entry counting from the left of the list shown by\n\
1874 dirs when invoked without options, starting with zero.\n\
1875 \n\
1876 -N Displays the Nth entry counting from the right of the list shown by\n\
1877 dirs when invoked without options, starting with zero.\n\
1878 \n\
1879 Exit Status:\n\
1880 Returns success unless an invalid option is supplied or an error occurs."),
1881#endif /* HELP_BUILTIN */
1882 (char *)NULL
1883};
1884#endif /* PUSHD_AND_POPD */
1885char * const shopt_doc[] = {
1886#if defined (HELP_BUILTIN)
1887N_("Set and unset shell options.\n\
1888 \n\
1889 Change the setting of each shell option OPTNAME. Without any option\n\
1890 arguments, list all shell options with an indication of whether or not each\n\
1891 is set.\n\
1892 \n\
1893 Options:\n\
1894 -o restrict OPTNAMEs to those defined for use with `set -o'\n\
1895 -p print each shell option with an indication of its status\n\
1896 -q suppress output\n\
1897 -s enable (set) each OPTNAME\n\
1898 -u disable (unset) each OPTNAME\n\
1899 \n\
1900 Exit Status:\n\
1901 Returns success if OPTNAME is enabled; fails if an invalid option is\n\
1902 given or OPTNAME is disabled."),
1903#endif /* HELP_BUILTIN */
1904 (char *)NULL
1905};
1906char * const printf_doc[] = {
1907#if defined (HELP_BUILTIN)
1908N_("Formats and prints ARGUMENTS under control of the FORMAT.\n\
1909 \n\
1910 Options:\n\
1911 -v var assign the output to shell variable VAR rather than\n\
1912 display it on the standard output\n\
1913 \n\
1914 FORMAT is a character string which contains three types of objects: plain\n\
1915 characters, which are simply copied to standard output; character escape\n\
1916 sequences, which are converted and copied to the standard output; and\n\
1917 format specifications, each of which causes printing of the next successive\n\
1918 argument.\n\
1919 \n\
1920 In addition to the standard format specifications described in printf(1),\n\
1921 printf interprets:\n\
1922 \n\
1923 %b expand backslash escape sequences in the corresponding argument\n\
1924 %q quote the argument in a way that can be reused as shell input\n\
1925 %(fmt)T output the date-time string resulting from using FMT as a format\n\
1926 string for strftime(3)\n\
1927 \n\
1928 The format is re-used as necessary to consume all of the arguments. If\n\
1929 there are fewer arguments than the format requires, extra format\n\
1930 specifications behave as if a zero value or null string, as appropriate,\n\
1931 had been supplied.\n\
1932 \n\
1933 Exit Status:\n\
1934 Returns success unless an invalid option is given or a write or assignment\n\
1935 error occurs."),
1936#endif /* HELP_BUILTIN */
1937 (char *)NULL
1938};
1939#if defined (PROGRAMMABLE_COMPLETION)
1940char * const complete_doc[] = {
1941#if defined (HELP_BUILTIN)
1942N_("Specify how arguments are to be completed by Readline.\n\
1943 \n\
1944 For each NAME, specify how arguments are to be completed. If no options\n\
1945 are supplied, existing completion specifications are printed in a way that\n\
1946 allows them to be reused as input.\n\
1947 \n\
1948 Options:\n\
1949 -p print existing completion specifications in a reusable format\n\
1950 -r remove a completion specification for each NAME, or, if no\n\
1951 NAMEs are supplied, all completion specifications\n\
1952 -D apply the completions and actions as the default for commands\n\
1953 without any specific completion defined\n\
1954 -E apply the completions and actions to \"empty\" commands --\n\
1955 completion attempted on a blank line\n\
1956 \n\
1957 When completion is attempted, the actions are applied in the order the\n\
1958 uppercase-letter options are listed above. The -D option takes\n\
1959 precedence over -E.\n\
1960 \n\
1961 Exit Status:\n\
1962 Returns success unless an invalid option is supplied or an error occurs."),
1963#endif /* HELP_BUILTIN */
1964 (char *)NULL
1965};
1966#endif /* PROGRAMMABLE_COMPLETION */
1967#if defined (PROGRAMMABLE_COMPLETION)
1968char * const compgen_doc[] = {
1969#if defined (HELP_BUILTIN)
1970N_("Display possible completions depending on the options.\n\
1971 \n\
1972 Intended to be used from within a shell function generating possible\n\
1973 completions. If the optional WORD argument is supplied, matches against\n\
1974 WORD are generated.\n\
1975 \n\
1976 Exit Status:\n\
1977 Returns success unless an invalid option is supplied or an error occurs."),
1978#endif /* HELP_BUILTIN */
1979 (char *)NULL
1980};
1981#endif /* PROGRAMMABLE_COMPLETION */
1982#if defined (PROGRAMMABLE_COMPLETION)
1983char * const compopt_doc[] = {
1984#if defined (HELP_BUILTIN)
1985N_("Modify or display completion options.\n\
1986 \n\
1987 Modify the completion options for each NAME, or, if no NAMEs are supplied,\n\
1988 the completion currently being executed. If no OPTIONs are given, print\n\
1989 the completion options for each NAME or the current completion specification.\n\
1990 \n\
1991 Options:\n\
1992 -o option Set completion option OPTION for each NAME\n\
1993 -D Change options for the \"default\" command completion\n\
1994 -E Change options for the \"empty\" command completion\n\
1995 \n\
1996 Using `+o' instead of `-o' turns off the specified option.\n\
1997 \n\
1998 Arguments:\n\
1999 \n\
2000 Each NAME refers to a command for which a completion specification must\n\
2001 have previously been defined using the `complete' builtin. If no NAMEs\n\
2002 are supplied, compopt must be called by a function currently generating\n\
2003 completions, and the options for that currently-executing completion\n\
2004 generator are modified.\n\
2005 \n\
2006 Exit Status:\n\
2007 Returns success unless an invalid option is supplied or NAME does not\n\
2008 have a completion specification defined."),
2009#endif /* HELP_BUILTIN */
2010 (char *)NULL
2011};
2012#endif /* PROGRAMMABLE_COMPLETION */
2013char * const mapfile_doc[] = {
2014#if defined (HELP_BUILTIN)
2015N_("Read lines from the standard input into an indexed array variable.\n\
2016 \n\
2017 Read lines from the standard input into the indexed array variable ARRAY, or\n\
2018 from file descriptor FD if the -u option is supplied. The variable MAPFILE\n\
2019 is the default ARRAY.\n\
2020 \n\
2021 Options:\n\
2022 -n count Copy at most COUNT lines. If COUNT is 0, all lines are copied.\n\
2023 -O origin Begin assigning to ARRAY at index ORIGIN. The default index is 0.\n\
2024 -s count Discard the first COUNT lines read.\n\
2025 -t Remove a trailing newline from each line read.\n\
2026 -u fd Read lines from file descriptor FD instead of the standard input.\n\
2027 -C callback Evaluate CALLBACK each time QUANTUM lines are read.\n\
2028 -c quantum Specify the number of lines read between each call to CALLBACK.\n\
2029 \n\
2030 Arguments:\n\
2031 ARRAY Array variable name to use for file data.\n\
2032 \n\
2033 If -C is supplied without -c, the default quantum is 5000. When\n\
2034 CALLBACK is evaluated, it is supplied the index of the next array\n\
2035 element to be assigned and the line to be assigned to that element\n\
2036 as additional arguments.\n\
2037 \n\
2038 If not supplied with an explicit origin, mapfile will clear ARRAY before\n\
2039 assigning to it.\n\
2040 \n\
2041 Exit Status:\n\
2042 Returns success unless an invalid option is given or ARRAY is readonly or\n\
2043 not an indexed array."),
2044#endif /* HELP_BUILTIN */
2045 (char *)NULL
2046};
2047char * const readarray_doc[] = {
2048#if defined (HELP_BUILTIN)
2049N_("Read lines from a file into an array variable.\n\
2050 \n\
2051 A synonym for `mapfile'."),
2052#endif /* HELP_BUILTIN */
2053 (char *)NULL
2054};