1da2e3ebdSchin /***********************************************************************
2da2e3ebdSchin *                                                                      *
3da2e3ebdSchin *               This software is part of the ast package               *
4*b30d1939SAndy Fiddaman *          Copyright (c) 1982-2012 AT&T Intellectual Property          *
5da2e3ebdSchin *                      and is licensed under the                       *
6*b30d1939SAndy Fiddaman *                 Eclipse Public License, Version 1.0                  *
77c2fbfb3SApril Chin *                    by AT&T Intellectual Property                     *
8da2e3ebdSchin *                                                                      *
9da2e3ebdSchin *                A copy of the License is available at                 *
10*b30d1939SAndy Fiddaman *          http://www.eclipse.org/org/documents/epl-v10.html           *
11*b30d1939SAndy Fiddaman *         (with md5 checksum b35adb5213ca9657e911e9befb180842)         *
12da2e3ebdSchin *                                                                      *
13da2e3ebdSchin *              Information and Software Systems Research               *
14da2e3ebdSchin *                            AT&T Research                             *
15da2e3ebdSchin *                           Florham Park NJ                            *
16da2e3ebdSchin *                                                                      *
17da2e3ebdSchin *                  David Korn <dgk@research.att.com>                   *
18da2e3ebdSchin *                                                                      *
19da2e3ebdSchin ***********************************************************************/
20da2e3ebdSchin #pragma prototyped
21da2e3ebdSchin 
22*b30d1939SAndy Fiddaman 
23da2e3ebdSchin #include	"defs.h"
24da2e3ebdSchin #include	"shtable.h"
25*b30d1939SAndy Fiddaman #include	<signal.h>
26da2e3ebdSchin #include	"ulimit.h"
27da2e3ebdSchin #include	"name.h"
28da2e3ebdSchin #include	"version.h"
29da2e3ebdSchin #if KSHELL
30da2e3ebdSchin #   include	"builtins.h"
31da2e3ebdSchin #   include	"jobs.h"
32da2e3ebdSchin #   include	"FEATURE/cmds"
33da2e3ebdSchin #   define	bltin(x)	(b_##x)
34da2e3ebdSchin     /* The following is for builtins that do not accept -- options */
35da2e3ebdSchin #   define	Bltin(x)	(B_##x)
36da2e3ebdSchin #else
37da2e3ebdSchin #   define bltin(x)	0
38da2e3ebdSchin #endif
39da2e3ebdSchin 
40*b30d1939SAndy Fiddaman #ifndef SHOPT_CMDLIB_DIR
41*b30d1939SAndy Fiddaman #   define SHOPT_CMDLIB_DIR	SH_CMDLIB_DIR
42*b30d1939SAndy Fiddaman #else
43*b30d1939SAndy Fiddaman #   ifndef SHOPT_CMDLIB_HDR
44da2e3ebdSchin #	define SHOPT_CMDLIB_HDR	<cmdlist.h>
45*b30d1939SAndy Fiddaman #   endif
46da2e3ebdSchin #endif
47*b30d1939SAndy Fiddaman 
48da2e3ebdSchin #define Q(f)		#f	/* libpp cpp workaround -- fixed 2005-04-11 */
497c2fbfb3SApril Chin #define CMDLIST(f)	SH_CMDLIB_DIR "/" Q(f), NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f),
50da2e3ebdSchin 
51da2e3ebdSchin #undef	basename
52da2e3ebdSchin #undef	dirname
53da2e3ebdSchin 
54da2e3ebdSchin /*
55da2e3ebdSchin  * The order up through "[" is significant
56da2e3ebdSchin  */
57da2e3ebdSchin const struct shtable3 shtab_builtins[] =
58da2e3ebdSchin {
59da2e3ebdSchin 	"login",	NV_BLTIN|BLT_ENV|BLT_SPC,	Bltin(login),
60da2e3ebdSchin 	"exec",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(exec),
61da2e3ebdSchin 	"set",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(set),
62da2e3ebdSchin 	":",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(true),
63da2e3ebdSchin 	"true",		NV_BLTIN|BLT_ENV,		bltin(true),
64da2e3ebdSchin 	"command",	NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(command),
65da2e3ebdSchin 	"cd",		NV_BLTIN|BLT_ENV,		bltin(cd),
66da2e3ebdSchin 	"break",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(break),
67da2e3ebdSchin 	"continue",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(break),
68da2e3ebdSchin 	"typeset",	NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(typeset),
697c2fbfb3SApril Chin 	"test",		NV_BLTIN|BLT_ENV,		bltin(test),
70da2e3ebdSchin 	"[",		NV_BLTIN|BLT_ENV,		bltin(test),
71da2e3ebdSchin 	"let",		NV_BLTIN|BLT_ENV,		bltin(let),
727c2fbfb3SApril Chin 	"export",	NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(readonly),
737c2fbfb3SApril Chin 	".",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(dot_cmd),
747c2fbfb3SApril Chin 	"return",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(return),
75da2e3ebdSchin #if SHOPT_BASH
76da2e3ebdSchin 	"local",	NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(typeset),
77da2e3ebdSchin #endif
78da2e3ebdSchin #if _bin_newgrp || _usr_bin_newgrp
79da2e3ebdSchin 	"newgrp",	NV_BLTIN|BLT_ENV|BLT_SPC,	Bltin(login),
80da2e3ebdSchin #endif	/* _bin_newgrp || _usr_bin_newgrp */
81*b30d1939SAndy Fiddaman 	"alias",	NV_BLTIN|BLT_SPC,		bltin(alias),
82*b30d1939SAndy Fiddaman 	"hash",		NV_BLTIN|BLT_SPC,		bltin(alias),
837c2fbfb3SApril Chin 	"enum",		NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(enum),
84da2e3ebdSchin 	"eval",		NV_BLTIN|BLT_ENV|BLT_SPC|BLT_EXIT,bltin(eval),
857c2fbfb3SApril Chin 	"exit",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(return),
86da2e3ebdSchin 	"fc",		NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(hist),
87da2e3ebdSchin 	"hist",		NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(hist),
88da2e3ebdSchin 	"readonly",	NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(readonly),
89da2e3ebdSchin 	"shift",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(shift),
90da2e3ebdSchin 	"trap",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(trap),
91da2e3ebdSchin 	"unalias",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(unalias),
92da2e3ebdSchin 	"unset",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(unset),
93da2e3ebdSchin 	"builtin",	NV_BLTIN,			bltin(builtin),
94da2e3ebdSchin #if SHOPT_ECHOPRINT
95da2e3ebdSchin 	"echo",		NV_BLTIN|BLT_ENV,		bltin(print),
96da2e3ebdSchin #else
97da2e3ebdSchin 	"echo",		NV_BLTIN|BLT_ENV,		Bltin(echo),
98da2e3ebdSchin #endif /* SHOPT_ECHOPRINT */
99da2e3ebdSchin #ifdef JOBS
100da2e3ebdSchin #   ifdef SIGTSTP
101da2e3ebdSchin 	"bg",		NV_BLTIN|BLT_ENV,		bltin(bg),
102da2e3ebdSchin 	"fg",		NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(bg),
103da2e3ebdSchin 	"disown",	NV_BLTIN|BLT_ENV,		bltin(bg),
1047c2fbfb3SApril Chin 	"kill",		NV_BLTIN|BLT_ENV,		bltin(kill),
105da2e3ebdSchin #   else
1067c2fbfb3SApril Chin 	"/bin/kill",	NV_BLTIN|BLT_ENV,		bltin(kill),
107da2e3ebdSchin #   endif	/* SIGTSTP */
108da2e3ebdSchin 	"jobs",		NV_BLTIN|BLT_ENV,		bltin(jobs),
109da2e3ebdSchin #endif	/* JOBS */
110da2e3ebdSchin 	"false",	NV_BLTIN|BLT_ENV,		bltin(false),
111da2e3ebdSchin 	"getopts",	NV_BLTIN|BLT_ENV,		bltin(getopts),
112da2e3ebdSchin 	"print",	NV_BLTIN|BLT_ENV,		bltin(print),
1137c2fbfb3SApril Chin 	"printf",	NV_BLTIN|BLT_ENV,		bltin(printf),
1147c2fbfb3SApril Chin 	"pwd",		NV_BLTIN,			bltin(pwd),
115da2e3ebdSchin 	"read",		NV_BLTIN|BLT_ENV,		bltin(read),
1167c2fbfb3SApril Chin 	"sleep",	NV_BLTIN,			bltin(sleep),
117da2e3ebdSchin 	"alarm",	NV_BLTIN,			bltin(alarm),
118da2e3ebdSchin 	"ulimit",	NV_BLTIN|BLT_ENV,		bltin(ulimit),
119da2e3ebdSchin 	"umask",	NV_BLTIN|BLT_ENV,		bltin(umask),
120da2e3ebdSchin #ifdef _cmd_universe
121da2e3ebdSchin 	"universe",	NV_BLTIN|BLT_ENV,		bltin(universe),
122da2e3ebdSchin #endif /* _cmd_universe */
123da2e3ebdSchin #if SHOPT_FS_3D
124da2e3ebdSchin 	"vpath",	NV_BLTIN|BLT_ENV,		bltin(vpath),
125da2e3ebdSchin 	"vmap",		NV_BLTIN|BLT_ENV,		bltin(vpath),
126da2e3ebdSchin #endif /* SHOPT_FS_3D */
127da2e3ebdSchin 	"wait",		NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(wait),
128da2e3ebdSchin 	"type",		NV_BLTIN|BLT_ENV,		bltin(whence),
129da2e3ebdSchin 	"whence",	NV_BLTIN|BLT_ENV,		bltin(whence),
130da2e3ebdSchin #ifdef SHOPT_CMDLIB_HDR
131*b30d1939SAndy Fiddaman #undef	mktemp		/* undo possible map-libc mktemp => _ast_mktemp */
132da2e3ebdSchin #include SHOPT_CMDLIB_HDR
133da2e3ebdSchin #else
134da2e3ebdSchin 	CMDLIST(basename)
135da2e3ebdSchin 	CMDLIST(chmod)
136da2e3ebdSchin 	CMDLIST(dirname)
1377c2fbfb3SApril Chin 	CMDLIST(getconf)
138da2e3ebdSchin 	CMDLIST(head)
139da2e3ebdSchin 	CMDLIST(mkdir)
140da2e3ebdSchin 	CMDLIST(logname)
141da2e3ebdSchin 	CMDLIST(cat)
142da2e3ebdSchin 	CMDLIST(cmp)
143da2e3ebdSchin 	CMDLIST(cut)
144da2e3ebdSchin 	CMDLIST(uname)
145da2e3ebdSchin 	CMDLIST(wc)
146da2e3ebdSchin 	CMDLIST(sync)
14734f9b3eeSRoland Mainz #endif
14834f9b3eeSRoland Mainz #if SHOPT_REGRESS
14934f9b3eeSRoland Mainz 	"__regress__",		NV_BLTIN|BLT_ENV,	bltin(__regress__),
150da2e3ebdSchin #endif
151da2e3ebdSchin 	"",		0, 0
152da2e3ebdSchin };
153da2e3ebdSchin 
154*b30d1939SAndy Fiddaman #if SHOPT_COSHELL
155*b30d1939SAndy Fiddaman #  define _JOB_	"[+?Each \ajob\a can be specified as one of the following:]{" \
156*b30d1939SAndy Fiddaman         "[+\anumber\a?\anumber\a refers to a process id.]" \
157*b30d1939SAndy Fiddaman         "[+-\anumber\a?\anumber\a refers to a process group id.]" \
158*b30d1939SAndy Fiddaman         "[+\apool\a.\anum\a?refers to job \anum\a in background pool named \apool\a.]" \
159*b30d1939SAndy Fiddaman         "[+\apool\a?refers to all jobs in background pool named \apool\a.]" \
160*b30d1939SAndy Fiddaman         "[+%\anumber\a?\anumber\a refer to a job number.]" \
161*b30d1939SAndy Fiddaman         "[+%\astring\a?Refers to a job whose name begins with \astring\a.]" \
162*b30d1939SAndy Fiddaman         "[+%??\astring\a?Refers to a job whose name contains \astring\a.]" \
163*b30d1939SAndy Fiddaman         "[+%+ \bor\b %%?Refers to the current job.]" \
164*b30d1939SAndy Fiddaman         "[+%-?Refers to the previous job.]" \
165*b30d1939SAndy Fiddaman 	"}"
166*b30d1939SAndy Fiddaman #else
167*b30d1939SAndy Fiddaman #  define _JOB_	"[+?Each \ajob\a can be specified as one of the following:]{" \
168*b30d1939SAndy Fiddaman         "[+\anumber\a?\anumber\a refers to a process id.]" \
169*b30d1939SAndy Fiddaman         "[+-\anumber\a?\anumber\a refers to a process group id.]" \
170*b30d1939SAndy Fiddaman         "[+%\anumber\a?\anumber\a refer to a job number.]" \
171*b30d1939SAndy Fiddaman         "[+%\astring\a?Refers to a job whose name begins with \astring\a.]" \
172*b30d1939SAndy Fiddaman         "[+%??\astring\a?Refers to a job whose name contains \astring\a.]" \
173*b30d1939SAndy Fiddaman         "[+%+ \bor\b %%?Refers to the current job.]" \
174*b30d1939SAndy Fiddaman         "[+%-?Refers to the previous job.]" \
175*b30d1939SAndy Fiddaman 	"}"
176*b30d1939SAndy Fiddaman #endif
177*b30d1939SAndy Fiddaman 
178da2e3ebdSchin 
179da2e3ebdSchin const char sh_set[] =
180da2e3ebdSchin "[a?Set the export attribute for each variable whose name does not "
181da2e3ebdSchin 	"contain a \b.\b that you assign a value in the current shell "
182da2e3ebdSchin 	"environment.]"
183da2e3ebdSchin "[b?The shell writes a message to standard error as soon it detects that "
184da2e3ebdSchin 	"a background job completes rather than waiting until the next prompt.]"
185da2e3ebdSchin "[e?A simple command that has an non-zero exit status will cause the shell "
186da2e3ebdSchin 	"to exit unless the simple command is:]{"
187da2e3ebdSchin 	"[++?contained in an \b&&\b or \b||\b list.]"
188da2e3ebdSchin 	"[++?the command immediately following \bif\b, \bwhile\b, or \buntil\b.]"
189da2e3ebdSchin 	"[++?contained in the pipeline following \b!\b.]"
190da2e3ebdSchin "}"
191da2e3ebdSchin "[f?Pathname expansion is disabled.]"
192da2e3ebdSchin "[h?Obsolete.  Causes each command whose name has the syntax of an "
1937c2fbfb3SApril Chin 	"alias to become a tracked alias when it is first encountered.]"
194da2e3ebdSchin "[k?This is obsolete.  All arguments of the form \aname\a\b=\b\avalue\a "
195da2e3ebdSchin 	"are removed and placed in the variable assignment list for "
196da2e3ebdSchin 	"the command.  Ordinarily, variable assignments must precede "
197da2e3ebdSchin 	"command arguments.]"
198da2e3ebdSchin "[m?When enabled, the shell runs background jobs in a separate process "
199da2e3ebdSchin 	"group and displays a line upon completion.  This mode is enabled "
200da2e3ebdSchin 	"by default for interactive shells on systems that support job "
201da2e3ebdSchin 	"control.]"
202da2e3ebdSchin "[n?The shell reads commands and checks for syntax errors, but does "
203da2e3ebdSchin 	"not execute the command.  Usually specified on command invocation.]"
204da2e3ebdSchin "[o]:?[option?If \aoption\a is not specified, the list of options and "
205da2e3ebdSchin 	"their current settings will be written to standard output.  When "
206da2e3ebdSchin 	"invoked with a \b+\b the options will be written in a format "
207da2e3ebdSchin 	"that can be reinput to the shell to restore the settings. "
208*b30d1939SAndy Fiddaman 	"Options \b-o\b \aname\a can also be specified with \b--\b\aname\a "
209*b30d1939SAndy Fiddaman 	"and \b+o \aname\a can be specifed with \b--no\b\aname\a  except that "
210*b30d1939SAndy Fiddaman 	"options names beginning with \bno\b are turned on by omitting \bno\b."
211da2e3ebdSchin 	"This option can be repeated to enable/disable multiple options. "
212da2e3ebdSchin 	"The value of \aoption\a must be one of the following:]{"
213da2e3ebdSchin 		"[+allexport?Equivalent to \b-a\b.]"
214da2e3ebdSchin 		"[+bgnice?Runs background jobs at lower priorities.]"
215da2e3ebdSchin 		"[+braceexpand?Equivalent to \b-B\b.] "
216da2e3ebdSchin 		"[+emacs?Enables/disables \bemacs\b editing mode.]"
217da2e3ebdSchin 		"[+errexit?Equivalent to \b-e\b.]"
218da2e3ebdSchin 		"[+globstar?Equivalent to \b-G\b.]"
219da2e3ebdSchin 		"[+gmacs?Enables/disables \bgmacs\b editing mode.  \bgmacs\b "
220da2e3ebdSchin 			"editing mode is the same as \bemacs\b editing mode "
221da2e3ebdSchin 			"except for the handling of \b^T\b.]"
222da2e3ebdSchin #if SHOPT_BASH
223da2e3ebdSchin 		"[+hashall?Equivalent to \b-h\b and \b-o trackall\b. Available "
224da2e3ebdSchin 		"in bash compatibility mode only.]"
225da2e3ebdSchin 		"[+history?Enable command history. Available in bash "
226da2e3ebdSchin 		"compatibility mode only. On by default in interactive "
227da2e3ebdSchin 		"shells.]"
228da2e3ebdSchin #endif
229da2e3ebdSchin #if SHOPT_HISTEXPAND
230da2e3ebdSchin 		"[+histexpand?Equivalent to \b-H\b.]"
231da2e3ebdSchin #endif
232da2e3ebdSchin 		"[+ignoreeof?Prevents an interactive shell from exiting on "
233da2e3ebdSchin 			"reading an end-of-file.]"
234da2e3ebdSchin 		"[+keyword?Equivalent to \b-k\b.]"
235*b30d1939SAndy Fiddaman 		"[+letoctal?The \blet\b builtin recognizes octal constants "
236*b30d1939SAndy Fiddaman 			"with leading 0.]"
237da2e3ebdSchin 		"[+markdirs?A trailing \b/\b is appended to directories "
238da2e3ebdSchin 			"resulting from pathname expansion.]"
239da2e3ebdSchin 		"[+monitor?Equivalent to \b-m\b.]"
240da2e3ebdSchin 		"[+multiline?Use multiple lines when editing lines that are "
241da2e3ebdSchin 			"longer than the window width.]"
242da2e3ebdSchin 		"[+noclobber?Equivalent to \b-C\b.]"
243da2e3ebdSchin 		"[+noexec?Equivalent to \b-n\b.]"
244da2e3ebdSchin 		"[+noglob?Equivalent to \b-f\b.]"
245da2e3ebdSchin 		"[+nolog?This has no effect.  It is provided for backward "
246da2e3ebdSchin 			"compatibility.]"
247da2e3ebdSchin 		"[+notify?Equivalent to \b-b\b.]"
248da2e3ebdSchin 		"[+nounset?Equivalent to \b-u\b.]"
249da2e3ebdSchin #if SHOPT_BASH
250da2e3ebdSchin 		"[+onecmd?Equivalent to \b-t\b. Available in bash compatibility "
251da2e3ebdSchin 		"mode only.]"
252da2e3ebdSchin 		"[+physical?Equivalent to \b-P\b. Available in bash "
253da2e3ebdSchin 		"compatibility mode only.]"
254da2e3ebdSchin 		"[+posix?Turn on POSIX compatibility. Available in bash "
255da2e3ebdSchin 		"compatibility mode only. Bash in POSIX mode is not the "
256da2e3ebdSchin 		"same as ksh.]"
257da2e3ebdSchin #endif
258da2e3ebdSchin 		"[+pipefail?A pipeline will not complete until all components "
259da2e3ebdSchin 			"of the pipeline have completed, and the exit status "
260da2e3ebdSchin 			"of the pipeline will be the value of the last "
261da2e3ebdSchin 			"command to exit with non-zero exit status, or will "
262da2e3ebdSchin 			"be zero if all commands return zero exit status.]"
263da2e3ebdSchin 		"[+privileged?Equivalent to \b-p\b.]"
264*b30d1939SAndy Fiddaman 		"[+rc?Do not run the \b.kshrc\b file for interactive shells.]"
265da2e3ebdSchin 		"[+showme?Simple commands preceded by a \b;\b will be traced "
266da2e3ebdSchin 			"as if \b-x\b were enabled but not executed.]"
267da2e3ebdSchin 		"[+trackall?Equivalent to \b-h\b.]"
268da2e3ebdSchin 		"[+verbose?Equivalent to \b-v\b.]"
269da2e3ebdSchin 		"[+vi?Enables/disables \bvi\b editing mode.]"
270da2e3ebdSchin 		"[+viraw?Does not use canonical input mode when using \bvi\b "
271da2e3ebdSchin 			"edit mode.]"
272da2e3ebdSchin 		"[+xtrace?Equivalent to \b-x\b.]"
273da2e3ebdSchin "}"
274da2e3ebdSchin "[p?Privileged mode.  Disabling \b-p\b sets the effective user id to the "
275da2e3ebdSchin 	"real user id, and the effective group id to the real group id.  "
276da2e3ebdSchin 	"Enabling \b-p\b restores the effective user and group ids to their "
277da2e3ebdSchin 	"values when the shell was invoked.  The \b-p\b option is on "
278da2e3ebdSchin 	"whenever the real and effective user id is not equal or the "
279da2e3ebdSchin 	"real and effective group id is not equal.  User profiles are "
280da2e3ebdSchin 	"not processed when \b-p\b is enabled.]"
281da2e3ebdSchin "[r?restricted.  Enables restricted shell.  This option cannot be unset once "
282da2e3ebdSchin 	"enabled.]"
283da2e3ebdSchin "[t?Obsolete.  The shell reads one command and then exits.]"
284da2e3ebdSchin "[u?If enabled, the shell displays an error message when it tries to expand "
285da2e3ebdSchin 	"a variable that is unset.]"
286da2e3ebdSchin "[v?Verbose.  The shell displays its input onto standard error as it "
287da2e3ebdSchin 	"reads it.]"
288da2e3ebdSchin "[x?Execution trace.  The shell will display each command after all "
289da2e3ebdSchin 	"expansion and before execution preceded by the expanded value "
290da2e3ebdSchin 	"of the \bPS4\b parameter.]"
291da2e3ebdSchin #if SHOPT_BASH
292da2e3ebdSchin 	"\fbash1\f"
293da2e3ebdSchin #endif
294da2e3ebdSchin #if SHOPT_BRACEPAT
295da2e3ebdSchin "[B?Enable {...} group expansion. On by default.]"
296da2e3ebdSchin #endif
297da2e3ebdSchin "[C?Prevents existing regular files from being overwritten using the \b>\b "
298da2e3ebdSchin 	"redirection operator.  The \b>|\b redirection overrides this "
299da2e3ebdSchin 	"\bnoclobber\b option.]"
300da2e3ebdSchin "[G?Causes \b**\b by itself to also match all sub-directories during pathname "
301da2e3ebdSchin 	"expansion.]"
302da2e3ebdSchin #if SHOPT_HISTEXPAND
303da2e3ebdSchin    "[H?Enable \b!\b-style history expansion similar to \bcsh\b.]"
304da2e3ebdSchin #endif
305da2e3ebdSchin ;
306da2e3ebdSchin 
307da2e3ebdSchin const char sh_optbreak[] =
308da2e3ebdSchin "[-1c?\n@(#)$Id: break (AT&T Research) 1999-04-07 $\n]"
309da2e3ebdSchin USAGE_LICENSE
310da2e3ebdSchin "[+NAME?break - break out of loop ]"
311da2e3ebdSchin "[+DESCRIPTION?\bbreak\b is a shell special built-in that exits the "
312da2e3ebdSchin 	"smallest enclosing \bfor\b, \bselect\b, \bwhile\b, or \buntil\b loop, "
313da2e3ebdSchin 	"or the \an\a-th enclosing loop if \an\a is specified.  "
314da2e3ebdSchin 	"Execution continues at the command following the loop(s).]"
315da2e3ebdSchin "[+?If \an\a is given, it must be a positive integer >= 1. If \an\a "
316da2e3ebdSchin 	"is larger than the number of enclosing loops, the last enclosing "
317da2e3ebdSchin 	"loop will be exited.]"
318da2e3ebdSchin "\n"
319da2e3ebdSchin "\n[n]\n"
320da2e3ebdSchin "\n"
321da2e3ebdSchin "[+EXIT STATUS?0]"
322da2e3ebdSchin "[+SEE ALSO?\bcontinue\b(1), \breturn\b(1)]"
323da2e3ebdSchin ;
324da2e3ebdSchin 
325da2e3ebdSchin const char sh_optcont[] =
326da2e3ebdSchin "[-1c?\n@(#)$Id: continue (AT&T Research) 1999-04-07 $\n]"
327da2e3ebdSchin USAGE_LICENSE
328da2e3ebdSchin "[+NAME?continue - continue execution at top of the loop]"
329da2e3ebdSchin "[+DESCRIPTION?\bcontinue\b is a shell special built-in that continues "
330da2e3ebdSchin 	"execution at the top of smallest enclosing enclosing \bfor\b, "
331da2e3ebdSchin 	"\bselect\b, \bwhile\b, or \buntil\b loop, if any; or the top of "
332da2e3ebdSchin 	"the \an\a-th enclosing loop if \an\a is specified.]"
333da2e3ebdSchin "[+?If \an\a is given, it must be a positive integer >= 1. If \an\a "
334da2e3ebdSchin 	"is larger than the number of enclosing loops, the last enclosing "
335da2e3ebdSchin 	" loop will be used.]"
336da2e3ebdSchin 
337da2e3ebdSchin "\n"
338da2e3ebdSchin "\n[n]\n"
339da2e3ebdSchin "\n"
340da2e3ebdSchin "[+SEE ALSO?\bbreak\b(1)]"
341da2e3ebdSchin ;
342da2e3ebdSchin 
343da2e3ebdSchin const char sh_optalarm[]	= "r [varname seconds]";
344da2e3ebdSchin const char sh_optalias[] =
345da2e3ebdSchin "[-1c?\n@(#)$Id: alias (AT&T Research) 1999-07-07 $\n]"
346da2e3ebdSchin USAGE_LICENSE
347da2e3ebdSchin "[+NAME?alias - define or display aliases]"
348da2e3ebdSchin "[+DESCRIPTION?\balias\b creates or redefines alias definitions "
349da2e3ebdSchin 	"or writes the existing alias definitions to standard output.  "
350da2e3ebdSchin 	"An alias definitions provides a string value that will replace "
351da2e3ebdSchin 	"a command name when the command is read.  Alias names can "
352da2e3ebdSchin 	"contain any printable character which is not special to the shell.  "
353da2e3ebdSchin 	"If an alias value ends in a space or tab, then the word "
354da2e3ebdSchin 	"following the command name the alias replaces is also checked "
355da2e3ebdSchin 	"to see whether it is an alias.]"
356da2e3ebdSchin "[+?If no \aname\as are specified then the names and values of all "
357da2e3ebdSchin 	"aliases are written to standard output.  Otherwise, for "
358da2e3ebdSchin 	"each \aname\a that is specified, and \b=\b\avalue\a  is not "
359da2e3ebdSchin 	"specified, the current value of the alias corresponding to "
360da2e3ebdSchin 	"\aname\a is written to standard output.  If \b=\b\avalue\a is "
361da2e3ebdSchin 	"specified, the alias \aname\a will be created or redefined.]"
362da2e3ebdSchin "[+?\balias\b is built-in to the shell as a declaration command so that "
363da2e3ebdSchin 	"field splitting and pathname expansion are not performed on "
364da2e3ebdSchin 	"the arguments.  Tilde expansion occurs on \avalue\a.  An alias "
365da2e3ebdSchin 	"definition only affects scripts read by the current shell "
366da2e3ebdSchin 	"environment.  It does not effect scripts run by this shell.]"
367da2e3ebdSchin "[p?Causes the output to be in the form of alias commands that can be used "
368da2e3ebdSchin 	"as input to the shell to recreate the current aliases.]"
369da2e3ebdSchin "[t?Used for tracked aliases.  These are aliases that connect a "
370da2e3ebdSchin 	"command name to the pathname of the command and are reset "
371da2e3ebdSchin 	"when the \bPATH\b variable is unset.  The tracked aliases feature is "
372da2e3ebdSchin 	"now obsolete.]"
373da2e3ebdSchin "[x?Ignored, this option is obsolete.]"
374da2e3ebdSchin "\n"
375da2e3ebdSchin "\n[name[=value]...]\n"
376da2e3ebdSchin "\n"
377da2e3ebdSchin "[+EXIT STATUS?]{"
378da2e3ebdSchin         "[+0?Successful completion.]"
379da2e3ebdSchin         "[+>0?One or more \aname\a operands did not have an alias "
380da2e3ebdSchin 		"definition, or an error occurred.]"
381da2e3ebdSchin "}"
382da2e3ebdSchin 
383da2e3ebdSchin "[+SEE ALSO?\bsh\b(1), \bunalias\b(1)]"
384da2e3ebdSchin ;
385da2e3ebdSchin 
386da2e3ebdSchin const char sh_optbuiltin[] =
387*b30d1939SAndy Fiddaman "[-1c?\n@(#)$Id: builtin (AT&T Research) 2010-08-04 $\n]"
388da2e3ebdSchin USAGE_LICENSE
389da2e3ebdSchin "[+NAME?builtin - add, delete, or display shell built-ins]"
390da2e3ebdSchin "[+DESCRIPTION?\bbuiltin\b can be used to add, delete, or display "
391da2e3ebdSchin     "built-in commands in the current shell environment. A built-in command "
392da2e3ebdSchin     "executes in the current shell process and can have side effects in the "
393da2e3ebdSchin     "current shell. On most systems, the invocation time for built-in "
394da2e3ebdSchin     "commands is one or two orders of magnitude less than commands that "
395da2e3ebdSchin     "create a separate process.]"
396da2e3ebdSchin "[+?For each \apathname\a specified, the basename of the pathname "
397da2e3ebdSchin     "determines the name of the built-in. For each basename, the shell looks "
398da2e3ebdSchin     "for a C level function in the current shell whose name is determined by "
399da2e3ebdSchin     "prepending \bb_\b to the built-in name. If \apathname\a contains a "
400da2e3ebdSchin     "\b/\b, then the built-in is bound to this pathname. A built-in bound to "
401da2e3ebdSchin     "a pathname will only be executed if \apathname\a is the first "
402da2e3ebdSchin     "executable found during a path search. Otherwise, built-ins are found "
403da2e3ebdSchin     "prior to performing the path search.]"
404da2e3ebdSchin "[+?If no \apathname\a operands are specified, then \bbuiltin\b displays "
405da2e3ebdSchin     "the current list of built-ins, or just the special built-ins if \b-s\b "
406da2e3ebdSchin     "is specified, on standard output. The full pathname for built-ins that "
407da2e3ebdSchin     "are bound to pathnames are displayed.]"
408da2e3ebdSchin "[+?Libraries containing built-ins can be specified with the \b-f\b "
409da2e3ebdSchin     "option. If the library contains a function named \blib_init\b(), this "
410da2e3ebdSchin     "function will be invoked with argument \b0\b when the library is "
411da2e3ebdSchin     "loaded. The \blib_init\b() function can load built-ins by invoking an "
412da2e3ebdSchin     "appropriate C level function. In this case there is no restriction on "
413da2e3ebdSchin     "the C level function name.]"
414da2e3ebdSchin "[+?The C level function will be invoked with three arguments. The first "
415da2e3ebdSchin     "two are the same as \bmain\b() and the third one is a pointer.]"
416da2e3ebdSchin "[+?\bbuiltin\b cannot be invoked from a restricted shell.]"
417da2e3ebdSchin "[d?Deletes each of the specified built-ins. Special built-ins cannot be "
418da2e3ebdSchin     "deleted.]"
419da2e3ebdSchin "[f]:[lib?On systems with dynamic linking, \alib\a names a shared "
420*b30d1939SAndy Fiddaman     "library to load and search for built-ins. Libraries are searched for "
421*b30d1939SAndy Fiddaman     "in \b../lib/ksh\b and \b../lib\b on \b$PATH\b and in system dependent "
422*b30d1939SAndy Fiddaman     "library directories. The system "
423da2e3ebdSchin     "dependent shared library prefix and/or suffix may be omitted. Once a "
424da2e3ebdSchin     "library is loaded, its symbols become available for the current and "
425da2e3ebdSchin     "subsequent invocations of \bbuiltin\b. Multiple libraries can be "
426da2e3ebdSchin     "specified with separate invocations of \bbuiltin\b. Libraries are "
427da2e3ebdSchin     "searched in the reverse order in which they are specified.]"
428*b30d1939SAndy Fiddaman "[l?List the library base name, plugin YYYYMMDD version stamp, and full "
429*b30d1939SAndy Fiddaman     "path for \b-f\b\alib\a on one line on the standard output.]"
430da2e3ebdSchin "[s?Display only the special built-ins.]"
431da2e3ebdSchin "\n"
432da2e3ebdSchin "\n[pathname ...]\n"
433da2e3ebdSchin "\n"
434da2e3ebdSchin "[+EXIT STATUS?]{"
435da2e3ebdSchin 	"[+0?All \apathname\a operands and \b-f\b options processed "
436da2e3ebdSchin 	"successfully.]"
437da2e3ebdSchin 	"[+>0?An error occurred.]"
438da2e3ebdSchin "}"
439da2e3ebdSchin "[+SEE ALSO?\bwhence\b(1)]"
440da2e3ebdSchin ;
441da2e3ebdSchin 
442da2e3ebdSchin const char sh_optcd[] =
443da2e3ebdSchin "[-1c?\n@(#)$Id: cd (AT&T Research) 1999-06-05 $\n]"
444da2e3ebdSchin USAGE_LICENSE
445da2e3ebdSchin "[+NAME?cd - change working directory ]"
446da2e3ebdSchin "[+DESCRIPTION?\bcd\b changes the current working directory of the "
447da2e3ebdSchin 	"current shell environment.]"
448da2e3ebdSchin "[+?In the first form with one operand, if \adirectory\a begins with "
449da2e3ebdSchin 	"\b/\b, or if the first component is \b.\b or \b..\b, the "
450da2e3ebdSchin 	"directory will be changed to this directory.  If directory is \b-\b, "
451da2e3ebdSchin 	"the directory will be changed to the last directory visited.  "
452da2e3ebdSchin 	"Otherwise, if the \bCDPATH\b environment variable is set, \bcd\b "
453da2e3ebdSchin 	"searches for \adirectory\a relative to each directory named in "
454da2e3ebdSchin 	"the colon separated list of directories defined by \bCDPATH\b.  "
455da2e3ebdSchin 	"If \bCDPATH\b not set, \bcd\b changes to the directory specified "
456da2e3ebdSchin 	"by \adirectory\a.]"
457da2e3ebdSchin "[+?In the second form, the first occurrence of the string \aold\a "
458da2e3ebdSchin 	"contained in the pathname of the present working directory "
459da2e3ebdSchin 	"is replaced by the string \anew\a and the resulting string "
460da2e3ebdSchin 	"is used as the directory to which to change.]"
461da2e3ebdSchin "[+?When invoked without operands and when the \bHOME\b environment "
462da2e3ebdSchin 	"variable is set to a nonempty value,  the directory named by "
463da2e3ebdSchin 	"the \bHOME\b environment variable will be used.  If \bHOME\b "
464da2e3ebdSchin 	"is empty or unset, \bcd\b will fail.]"
465da2e3ebdSchin "[+?When \bcd\b is successful, the \bPWD\b environment variable will be set "
466da2e3ebdSchin 	"to the name of an absolute pathname that does not contain any "
467da2e3ebdSchin 	"\b..\b components corresponding to the new directory.  The "
468da2e3ebdSchin 	"environment variable \bOLDPWD\b will be set to the previous "
469da2e3ebdSchin 	"value of \bPWD\b.  If the new directory is found by searching "
470da2e3ebdSchin 	"the directories named by \bCDPATH\b, or if \adirectory\a is \b-\b, "
471da2e3ebdSchin 	"or if the two operand form is used, the new value of \bPWD\b will be "
472da2e3ebdSchin 	"written to standard output.]"
473da2e3ebdSchin "[+?If both \b-L\b and \b-P\b are specified, the last one specified will "
474da2e3ebdSchin 	"be used.  If neither \b-P\b or \b-L\b is specified then the "
475da2e3ebdSchin 	"behavior will be determined by the \bgetconf\b parameter "
476da2e3ebdSchin 	"\bPATH_RESOLVE\b.  If \bPATH_RESOLVE\b is \bphysical\b, "
477da2e3ebdSchin 	"then the behavior will be as if \b-P\b were specified.  Otherwise, "
478da2e3ebdSchin 	"the behavior will be as if  \b-L\b were specified.]"
479da2e3ebdSchin "[L?Handle each pathname component \b..\b in a logical fashion by moving "
480da2e3ebdSchin 	"up one level by name in the present working directory.]"
481da2e3ebdSchin "[P?The present working directory is first converted to an absolute pathname "
482da2e3ebdSchin 	"that does not contain symbolic link components and symbolic name "
483da2e3ebdSchin 	"components are expanded in the resulting directory name.]"
484da2e3ebdSchin "\n"
485da2e3ebdSchin "\n[directory]\n"
486da2e3ebdSchin "old new\n"
487da2e3ebdSchin "\n"
488da2e3ebdSchin "[+EXIT STATUS?]{"
489da2e3ebdSchin 	"[+0?Directory successfully changed.]"
490da2e3ebdSchin 	"[+>0?An error occurred.]"
491da2e3ebdSchin "}"
492da2e3ebdSchin "[+SEE ALSO?\bpwd\b(1), \bgetconf\b(1)]"
493da2e3ebdSchin ;
494da2e3ebdSchin 
495da2e3ebdSchin const char sh_optcommand[] =
496da2e3ebdSchin "[-1c?\n@(#)$Id: command (AT&T Research) 2003-08-01 $\n]"
497da2e3ebdSchin USAGE_LICENSE
498da2e3ebdSchin "[+NAME?command - execute a simple command]"
499da2e3ebdSchin "[+DESCRIPTION?Without \b-v\b or \b-V\b,  \bcommand\b executes \acommand\a "
500da2e3ebdSchin 	"with arguments given by \aarg\a, suppressing the shell function lookup "
501da2e3ebdSchin 	"that normally occurs.  In addition, if \acommand\a is a special "
502da2e3ebdSchin 	"built-in command, then the special properties are removed so that "
503da2e3ebdSchin 	"failures will not cause the script that executes it to terminate.]"
504da2e3ebdSchin "[+?With the \b-v\b or \b-V\b options, \bcommand\b is equivalent to the "
505da2e3ebdSchin 	"\bwhence\b(1) command.]"
506da2e3ebdSchin "[p?Causes a default path to be searched rather than the one defined by the "
507da2e3ebdSchin 	"value of \bPATH\b.]"
508da2e3ebdSchin "[v?Equivalent to \bwhence\b \acommand\a [\aarg\a ...]].]"
509da2e3ebdSchin "[x?If \acommand\a fails because there are too many \aarg\as, it will be "
510da2e3ebdSchin 	"invoked multiple times with a subset of the arguments on each "
511da2e3ebdSchin 	"invocation.  Arguments that occur prior to the first word that expand "
512da2e3ebdSchin 	"to multiple arguments and arguments that occur after the last word "
513da2e3ebdSchin 	"that expands to multiple arguments will be passed on each invocation. "
514da2e3ebdSchin 	"The exit status will be the maximum invocation exit status.]"
515da2e3ebdSchin "[V?Equivalent to \bwhence \b-v\b \acommand\a [\aarg\a ...]].]"
516da2e3ebdSchin "\n"
517da2e3ebdSchin "\n[command [arg ...]]\n"
518da2e3ebdSchin "\n"
519da2e3ebdSchin "[+EXIT STATUS?If \acommand\a is invoked, the exit status of \bcommand\b "
520da2e3ebdSchin 	"will be that of \acommand\a.  Otherwise, it will be one of "
521da2e3ebdSchin 	"the following:]{"
522da2e3ebdSchin 	"[+0?\bcommand\b completed successfully.]"
523da2e3ebdSchin 	"[+>0?\b-v\b or \b-V\b has been specified and an error occurred.]"
524da2e3ebdSchin 	"[+126?\acommand\a was found but could not be invoked.]"
525da2e3ebdSchin 	"[+127?\acommand\a could not be found.]"
526da2e3ebdSchin "}"
527da2e3ebdSchin 
528da2e3ebdSchin "[+SEE ALSO?\bwhence\b(1), \bgetconf\b(1)]"
529da2e3ebdSchin ;
530da2e3ebdSchin 
531da2e3ebdSchin const char sh_optdot[]	 =
532da2e3ebdSchin "[-1c?@(#)$Id: \b.\b (AT&T Research) 2000-04-02 $\n]"
533da2e3ebdSchin USAGE_LICENSE
534da2e3ebdSchin "[+NAME?\b.\b - execute commands in the current environment]"
535da2e3ebdSchin "[+DESCRIPTION?\b.\b is a special built-in command that executes commands "
536da2e3ebdSchin 	"from a function or a file in the current environment.]"
537da2e3ebdSchin "[+?If \aname\a refers to a function defined with the \bfunction\b \aname\a "
538da2e3ebdSchin 	"syntax, the function executes in the current environment as "
539da2e3ebdSchin 	"if it had been defined with the \aname\a\b()\b syntax so that "
540da2e3ebdSchin 	"there is no scoping.  Otherwise, commands from the file defined "
541da2e3ebdSchin 	"by \aname\a are executed in the current environment.  Note that "
542da2e3ebdSchin 	"the complete script is read before it begins to execute so that "
543da2e3ebdSchin 	"any aliases defined in this script will not take effect until "
544da2e3ebdSchin 	"the script completes execution.]"
545da2e3ebdSchin "[+?When \aname\a refers to a file, the \bPATH\b variable is searched "
546da2e3ebdSchin 	"for the file containing commands.  In this case execute permission "
547da2e3ebdSchin 	"is not required for \aname\a.]"
548da2e3ebdSchin "[+?If any \aarg\as are specified, these become the positional parameters "
549da2e3ebdSchin 	"for the duration of the function or script and are restored "
550da2e3ebdSchin 	"upon completion.]"
551da2e3ebdSchin "\n"
552da2e3ebdSchin "\n name [arg ...]\n"
553da2e3ebdSchin "\n"
554da2e3ebdSchin "[+EXIT STATUS?If \aname\a is found, then the exit status is that "
555da2e3ebdSchin 	"of the last command executed.  Otherwise, since this is a special "
556da2e3ebdSchin 	"built-in, an error will cause a non-interactive shell to exit with "
557da2e3ebdSchin 	"a non-zero exit status.  An interactive shell returns a non-zero exit "
558da2e3ebdSchin 	"status to indicate an error.]"
559da2e3ebdSchin 
560da2e3ebdSchin "[+SEE ALSO?\bcommand\b(1), \bksh\b(1)]"
561da2e3ebdSchin ;
562da2e3ebdSchin 
563da2e3ebdSchin #ifndef ECHOPRINT
564da2e3ebdSchin     const char sh_optecho[]	= " [-n] [arg...]";
565da2e3ebdSchin #endif /* !ECHOPRINT */
566da2e3ebdSchin 
567da2e3ebdSchin const char sh_opteval[] =
568da2e3ebdSchin "[-1c?\n@(#)$Id: eval (AT&T Research) 1999-07-07 $\n]"
569da2e3ebdSchin USAGE_LICENSE
570da2e3ebdSchin "[+NAME?eval - create a shell command and process it]"
571da2e3ebdSchin "[+DESCRIPTION?\beval\b is a shell special built-in command that constructs "
572da2e3ebdSchin 	"a command by concatenating the \aarg\as together, separating each "
573da2e3ebdSchin 	"with a space.  The resulting string is then taken as input to "
574da2e3ebdSchin 	"the shell and evaluated in the current environment.  Note that "
575da2e3ebdSchin 	"command words are expanded twice; once to construct \aarg\a, and "
576da2e3ebdSchin 	"again when the shell executes the constructed command.]"
577da2e3ebdSchin "[+?It is not an error if \aarg\a is not given.]"
578da2e3ebdSchin "\n"
579da2e3ebdSchin "\n[arg...]\n"
580da2e3ebdSchin "\n"
581da2e3ebdSchin "[+EXIT STATUS?If \aarg\a is not specified, the exit status is \b0\b.  "
582da2e3ebdSchin 	"Otherwise, it is the exit status of the command defined by the "
583da2e3ebdSchin 	"\aarg\a operands.]"
584da2e3ebdSchin "[+SEE ALSO?\bexec\b(1), \btrap\b(1), \b.\b(1)]"
585da2e3ebdSchin ;
586da2e3ebdSchin 
587da2e3ebdSchin const char sh_optexec[] =
588da2e3ebdSchin "[-1c?\n@(#)$Id: exec (AT&T Research) 1999-07-10 $\n]"
589da2e3ebdSchin USAGE_LICENSE
590da2e3ebdSchin "[+NAME?exec - execute command, open/close and duplicate file descriptors]"
591da2e3ebdSchin "[+DESCRIPTION?\bexec\b is a special built-in command that can be used to "
592da2e3ebdSchin 	"manipulate file descriptors or to replace the current shell "
593da2e3ebdSchin 	"with a new command.]"
594da2e3ebdSchin "[+?If \acommand\a is specified, then the current shell process will be "
595da2e3ebdSchin 	"replaced by \acommand\a rather than running \acommand\a and waiting "
596da2e3ebdSchin 	"for it to complete.  Note that there is no need to use "
597da2e3ebdSchin 	"\bexec\b to enhance performance since the shell implicitly "
598da2e3ebdSchin 	"uses the exec mechanism internally whenever possible.]"
599da2e3ebdSchin "[+?If no operands are specified, \bexec\b can be used to open or "
600da2e3ebdSchin 	"close files, or to manipulate file descriptors from \b0\b to "
601da2e3ebdSchin 	"\b9\b in the current shell environment using the standard "
602da2e3ebdSchin 	"redirection mechanism available with all commands.  The "
603da2e3ebdSchin 	"close-on-exec flags will be set on file descriptor numbers "
604da2e3ebdSchin 	"greater than \b2\b that are opened this way so that they "
605da2e3ebdSchin 	"will be closed when another program is invoked.]"
606da2e3ebdSchin "[+?Because \bexec\b is a special command, any failure will cause the "
607da2e3ebdSchin 	"script that invokes it to exit.  This can be prevented by "
608da2e3ebdSchin 	"invoking \bexec\b from the \bcommand\b utility.]"
609da2e3ebdSchin "[+?\bexec\b cannot be invoked from a restricted shell to create "
610da2e3ebdSchin 	"files or to open a file for writing or appending.]"
611da2e3ebdSchin "[c?Clear all environment variables before executions except variable "
612da2e3ebdSchin 	"assignments that are part of the current \bexec\b command.]"
613da2e3ebdSchin "[a]:[name?\bargv[0]]\b will be set to \aname\a for \acommand\a]"
614da2e3ebdSchin "\n"
615da2e3ebdSchin "\n[command [arg ...]]\n"
616da2e3ebdSchin "\n"
617da2e3ebdSchin "[+EXIT STATUS?If \acommand\a is specified, \bexec\b does not return.  "
618da2e3ebdSchin 	"Otherwise, the exit status is one of the following:]{"
619da2e3ebdSchin 	"[+0?All I/O redirections were successful.]"
620da2e3ebdSchin 	"[+>0?An error occurred.]"
621da2e3ebdSchin "}"
622da2e3ebdSchin "[+SEE ALSO?\bcommand\b(1), \beval\b(1)]"
623da2e3ebdSchin ;
624da2e3ebdSchin 
625da2e3ebdSchin 
626da2e3ebdSchin const char sh_optexit[] =
627da2e3ebdSchin "[-1c?\n@(#)$Id: exit (AT&T Research) 1999-07-07 $\n]"
628da2e3ebdSchin USAGE_LICENSE
629da2e3ebdSchin "[+NAME?exit - exit the current shell]"
630da2e3ebdSchin "[+DESCRIPTION?\bexit\b is shell special built-in that causes the "
631da2e3ebdSchin 	"shell that invokes it to exit.  Before exiting the shell, if the "
632da2e3ebdSchin 	"\bEXIT\b trap is set it will be invoked.]"
633da2e3ebdSchin "[+?If \an\a is given, it will be used to set the exit status.]"
634da2e3ebdSchin "\n"
635da2e3ebdSchin "\n[n]\n"
636da2e3ebdSchin "\n"
637da2e3ebdSchin "[+EXIT STATUS?If \an\a is specified, the exit status is the least significant "
638da2e3ebdSchin 	"eight bits of the value of \an\a.  Otherwise, the exit status is the "
639da2e3ebdSchin 	"exit status of preceding command.  When invoked inside a trap, the "
640da2e3ebdSchin 	"preceding command means the command that invoked the trap.]"
641da2e3ebdSchin "[+SEE ALSO?\bbreak\b(1), \breturn\b(1)]"
642da2e3ebdSchin ;
643da2e3ebdSchin 
644da2e3ebdSchin const char sh_optexport[] =
645da2e3ebdSchin "[-1c?\n@(#)$Id: export (AT&T Research) 1999-07-07 $\n]"
646da2e3ebdSchin USAGE_LICENSE
647da2e3ebdSchin "[+NAME?export - set export attribute on variables]"
648da2e3ebdSchin "[+DESCRIPTION?\bexport\b sets the export attribute on each of "
649da2e3ebdSchin 	"the variables specified by \aname\a which causes them "
650da2e3ebdSchin 	"to be in the environment of subsequently executed commands.  "
651da2e3ebdSchin 	"If \b=\b\avalue\a is specified, the variable \aname\a is "
652da2e3ebdSchin 	"set to \avalue\a.]"
653da2e3ebdSchin "[+?If no \aname\as are specified then the names and values of all "
654da2e3ebdSchin 	"exported variables are written to standard output.]"
655da2e3ebdSchin "[+?\bexport\b is built-in to the shell as a declaration command so that "
656da2e3ebdSchin 	"field splitting and pathname expansion are not performed on "
657da2e3ebdSchin 	"the arguments.  Tilde expansion occurs on \avalue\a.]"
658da2e3ebdSchin "[p?Causes the output to be in the form of \bexport\b commands that can be "
659da2e3ebdSchin 	"used as input to the shell to recreate the current exports.]"
660da2e3ebdSchin "\n"
661da2e3ebdSchin "\n[name[=value]...]\n"
662da2e3ebdSchin "\n"
663da2e3ebdSchin "[+EXIT STATUS?]{"
664da2e3ebdSchin         "[+0?Successful completion.]"
665da2e3ebdSchin         "[+>0?An error occurred.]"
666da2e3ebdSchin "}"
667da2e3ebdSchin 
668da2e3ebdSchin "[+SEE ALSO?\bsh\b(1), \btypeset\b(1)]"
669da2e3ebdSchin ;
670da2e3ebdSchin 
671da2e3ebdSchin const char sh_optgetopts[] =
672da2e3ebdSchin ":[-1c?\n@(#)$Id: getopts (AT&T Research) 2005-01-01 $\n]"
673da2e3ebdSchin "[-author?Glenn Fowler <gsf@research.att.com>]"
674da2e3ebdSchin USAGE_LICENSE
675da2e3ebdSchin "[+NAME?\f?\f - parse utility options]"
676da2e3ebdSchin "[+DESCRIPTION?The \bgetopts\b utility can be used to retrieve options and "
677da2e3ebdSchin   "arguments from a list of arguments given by \aargs\a or the positional "
678da2e3ebdSchin   "parameters if \aargs\a is omitted.  It can also generate usage messages "
679da2e3ebdSchin   "and a man page for the command based on the information in \aoptstring\a.]"
680da2e3ebdSchin "[+?Each time it is invoked, the \bgetopts\b utility places the value "
681da2e3ebdSchin   "of the next option in the shell variable specified by the \aname\a "
682da2e3ebdSchin   "operand and the index of the next argument to be processed in the "
683da2e3ebdSchin   "shell variable \bOPTIND\b.  When the shell is invoked \bOPTIND\b "
684da2e3ebdSchin   "is initialized to \b1\b.  When an option requires or permits an option "
685da2e3ebdSchin   "argument, \bgetopts\b places the option argument in the shell "
686da2e3ebdSchin   "variable \bOPTARG\b. Otherwise \bOPTARG\b is set to \b1\b when the "
687da2e3ebdSchin   "option is set and \b0\b when the option is unset.]"
688da2e3ebdSchin "[+?The \aoptstring\a string consists of alpha-numeric characters, "
689da2e3ebdSchin   "the special characters +, -, ?, :, and <space>, or character groups "
690da2e3ebdSchin   "enclosed in [...]].  Character groups may be nested in {...}. "
691da2e3ebdSchin   "Outside of a [...]] group, a single new-line followed by zero or "
692da2e3ebdSchin   "more blanks is ignored.  One or more blank lines separate the "
693da2e3ebdSchin   "options from the command argument synopsis.]"
694da2e3ebdSchin "[+?Each [...]] group consists of an optional label, "
695da2e3ebdSchin   "optional attributes separated by :, and an "
696da2e3ebdSchin   "optional description string following ?.  The characters from the ? "
697da2e3ebdSchin   "to the end of the next ]] are ignored for option parsing and short "
698da2e3ebdSchin   "usage messages.  They are used for generating verbose help or man pages. "
699da2e3ebdSchin   "The : character may not appear in the label. "
700da2e3ebdSchin   "The ? character must be specified as ?? in the label and the ]] character "
701da2e3ebdSchin   "must be specified as ]]]] in the description string. "
702da2e3ebdSchin   "Text between two \\b (backspace) characters indicates "
703da2e3ebdSchin   "that the text should be emboldened when displayed. "
704da2e3ebdSchin   "Text between two \\a (bell) characters indicates that the text should "
7057c2fbfb3SApril Chin   "be emphasized or italicized when displayed. "
706da2e3ebdSchin   "Text between two \\v (vertical tab) characters indicates "
707da2e3ebdSchin   "that the text should displayed in a fixed width font. "
708da2e3ebdSchin   "Text between two \\f (formfeed) characters will be replaced by the "
709da2e3ebdSchin     "output from the shell function whose name is that of the enclosed text.]"
710da2e3ebdSchin "[+?All output from this interface is written to the standard error.]"
711da2e3ebdSchin "[+?There are several group types:]{"
712da2e3ebdSchin   "[+1.?A group of the form "
713da2e3ebdSchin     "[-[\aversion\a]][\aflag\a[\anumber\a]]]]...[?\atext\a]]]] "
714da2e3ebdSchin     "appearing as the first group enables the extended interface. \aversion\a "
715da2e3ebdSchin     "specifies the interface version, currently \b1\b. The latest version is "
716da2e3ebdSchin     "assumed if \aversion\a is omitted. Future enhancements "
717da2e3ebdSchin     "may increment \aversion\a, but all versions will be supported. \atext\a "
718da2e3ebdSchin     "typically specifies an SCCS or CVS identification string. Zero or more "
719da2e3ebdSchin     "\aflags\a with optional \anumber\a values may be specified to control "
720da2e3ebdSchin     "option parsing. "
721da2e3ebdSchin     "The flags are:]{"
72234f9b3eeSRoland Mainz       "[++?Arguments beginning with + are considered options.]"
723da2e3ebdSchin       "[+c?Cache this \aoptstring\a for multiple passes. Used to optimize "
724da2e3ebdSchin 	"builtins that may be called many times within the same process.]"
725da2e3ebdSchin       "[+i?Ignore this \aoptstring\a when generating help. Used when "
726da2e3ebdSchin 	"combining \aoptstring\a values from multiple passes.]"
727da2e3ebdSchin       "[+l?Display only \alongname\a options in help messages.]"
7287c2fbfb3SApril Chin       "[+n?Associate -\anumber\a and +\anumber\a options with the first "
7297c2fbfb3SApril Chin         "option with numeric arguments.]"
730da2e3ebdSchin       "[+o?The \b-\b option character prefix is optional (supports "
731da2e3ebdSchin         "obsolete \bps\b(1) option syntax.)]"
732da2e3ebdSchin       "[+p?\anumber\a specifies the number of \b-\b characters that must "
733da2e3ebdSchin 	"prefix long option names. The default is \b2\b; \b0\b, \b1\b or "
734da2e3ebdSchin 	"\b2\b are accepted (e.g., \bp0\b for \bdd\b(1) and \bp1\b for "
735da2e3ebdSchin 	"\bfind\b(1).)]"
736da2e3ebdSchin       "[+s?\anumber\a specifies the \b--??man\b section number, "
737da2e3ebdSchin         "\b1\b by default.]"
738da2e3ebdSchin   "}"
739da2e3ebdSchin   "[+2.?An option specification of the form "
740da2e3ebdSchin     "[\aoption\a[!]][=\anumber\a]][:\alongname\a]][?\atext\a]]]]. In this "
741da2e3ebdSchin     "case the first field is the option character; this is the value returned "
742da2e3ebdSchin     "in the \aname\a operand when the option is matched.  If there is no "
743da2e3ebdSchin     "option character then a two or more digit number should be specified. "
744da2e3ebdSchin     "This number will be returned as the value of the \aname\a operand if the "
745da2e3ebdSchin     "long option is matched. If \aoption\a is followed by \b!\b then the option "
746da2e3ebdSchin     "character sense is the inverse of the longname sense. For options that do "
747da2e3ebdSchin     "not take values \bOPTARG\b will be set to \b0\b for \b!\b inverted option "
748da2e3ebdSchin     "characters and \b1\b otherwise. =\anumber\a optionally specifies a number to "
749da2e3ebdSchin     "be returned in the \aname\a operand instead of the option character. A "
750da2e3ebdSchin     "longname is specified by \b--\b\alongname\a and is matched by the shortest "
751da2e3ebdSchin     "non-ambiguous prefix of all long options. * in the \alongname\a field "
752da2e3ebdSchin     "indicates that only characters up to that point need to match, provided "
753da2e3ebdSchin     "any additional characters match exactly. The enclosing [ and ]] can be "
754da2e3ebdSchin     "omitted for an option that does not have a longname or descriptive text.]"
755da2e3ebdSchin   "[+3.?An option argument specification. "
756da2e3ebdSchin     "Options that take arguments can be followed by : (string value) or # "
757da2e3ebdSchin     "(numeric value) and an option argument specification.  An option argument "
758da2e3ebdSchin     "specification consists of the option argument name as field 1. "
759da2e3ebdSchin     "The remaining \b:\b separated fields are a type name and zero or more of "
760da2e3ebdSchin     "the special attribute words \blistof\b, \boneof\b, and \bignorecase\b. "
761da2e3ebdSchin     "A default option value may be specified in the final field as "
762da2e3ebdSchin     "\b:=\b\adefault\a. The option argument specification may be followed "
763da2e3ebdSchin     "by a list of option value descriptions enclosed in braces. "
764da2e3ebdSchin     "A long option that takes an argument is specified as "
765da2e3ebdSchin     "\b--\b\alongname\a=\avalue\a. If the : or # is followed by ? then the "
766da2e3ebdSchin     "option argument is optional. If only the option character form is "
767da2e3ebdSchin     "specified then the optional argument value is not set if the next "
768*b30d1939SAndy Fiddaman     "argument starts with - or +. The special attributes are currently "
769*b30d1939SAndy Fiddaman     "informational with respect to \boptget\b(3), but may be useful to "
770*b30d1939SAndy Fiddaman     "applications that parse \b--api\b output. The special attributes are:]{"
771*b30d1939SAndy Fiddaman     	"[+listof?zero or more of the possible option values may be specified, "
772*b30d1939SAndy Fiddaman 		"separated by \b,\b or space.]"
773*b30d1939SAndy Fiddaman     	"[+oneof?exactly one of the possible option values must be specified]"
774*b30d1939SAndy Fiddaman     	"[+ignorecase?case ignored in matching the long option name]"
775*b30d1939SAndy Fiddaman     "}"
776da2e3ebdSchin   "[+4.?A option value description.]"
777da2e3ebdSchin   "[+5.?A argument specification. A list of valid option argument values "
778da2e3ebdSchin     "can be specified by enclosing them inside a {...} following "
779da2e3ebdSchin     "the option argument specification.  Each of the permitted "
780da2e3ebdSchin     "values can be specified with a [...]] containing the "
781da2e3ebdSchin     "value followed by a description.]"
782da2e3ebdSchin   "[+6.?A group of the form [+\\n...]] will display the characters "
783da2e3ebdSchin     "representing ... in fixed with font without adding line breaks.]"
784da2e3ebdSchin   "[+7.?A group of the form [+\aname\a?\atext\a]] specifies a section "
785da2e3ebdSchin     "\aname\a with descriptive \atext\a. If \aname\a is omitted then "
786da2e3ebdSchin     "\atext\a is placed in a new paragraph.]"
787da2e3ebdSchin   "[+8.?A group of the form [-\aname\a?\atext\a]] specifies entries "
788da2e3ebdSchin     "for the \bIMPLEMENTATION\b section.]"
789da2e3ebdSchin "}"
79034f9b3eeSRoland Mainz "[+?A leading : character in \aoptstring\a "
791da2e3ebdSchin   "affects the way errors are handled.  If an option character or longname "
792da2e3ebdSchin   "argument not specified in \aoptstring\a is encountered when processing "
793da2e3ebdSchin   "options, the shell variable whose name is \aname\a will be set to the ? "
794da2e3ebdSchin   "character.  The shell variable \bOPTARG\b will be set to "
795da2e3ebdSchin   "the character found.  If an option argument is missing or has an invalid "
796da2e3ebdSchin   "value, then \aname\a will be set to the : character and the shell variable "
797da2e3ebdSchin   "\bOPTARG\b will be set to the option character found. "
798da2e3ebdSchin   "Without the leading :, \aname\a will be set to the ? character, \bOPTARG\b "
799da2e3ebdSchin   "will be unset, and an error message will be written to standard error "
800da2e3ebdSchin   "when errors are encountered.]"
80134f9b3eeSRoland Mainz "[+?A leading + character or a + following a leading : in \aoptstring\a "
80234f9b3eeSRoland Mainz   "specifies that arguments beginning with + will also be considered options.]"
803da2e3ebdSchin "[+?The end of options occurs when:]{"
804da2e3ebdSchin 	"[+1.?The special argument \b--\b is encountered.]"
805da2e3ebdSchin 	"[+2.?An argument that does not begin with a \b-\b is encountered.]"
806da2e3ebdSchin 	"[+3.?A help argument is specified.]"
807da2e3ebdSchin 	"[+4.?An error is encountered.]"
808da2e3ebdSchin "}"
809da2e3ebdSchin "[+?If \bOPTIND\b is set to the value \b1\b, a new set of arguments "
810da2e3ebdSchin   "can be used.]"
811da2e3ebdSchin "[+?\bgetopts\b can also be used to generate help messages containing command "
812da2e3ebdSchin   "usage and detailed descriptions.  Specify \aargs\a as:]"
813da2e3ebdSchin "{ "
814da2e3ebdSchin 	"[+-???To generate a usage synopsis.]"
815da2e3ebdSchin 	"[+--?????To generate a verbose usage message.]"
816da2e3ebdSchin 	"[+--????man?To generate a formatted man page.]"
817da2e3ebdSchin 	"[+--????api?To generate an easy to parse usage message.]"
818da2e3ebdSchin 	"[+--????html?To generate a man page in \bhtml\b format.]"
819da2e3ebdSchin 	"[+--????nroff?To generate a man page in \bnroff\b format.]"
820da2e3ebdSchin 	"[+--????usage?List the current \aoptstring\a.]"
821da2e3ebdSchin 	"[+--??????\aname\a?List \bversion=\b\an\a, \an\a>0, "
822da2e3ebdSchin 	  "if the option \aname\a is recognized by \bgetopts\b.]"
823da2e3ebdSchin "}"
824da2e3ebdSchin "[+?When the end of options is encountered, \bgetopts\b exits with a "
825da2e3ebdSchin   "non-zero return value and the variable \bOPTIND\b is set to the "
826da2e3ebdSchin   "index of the first non-option argument.]"
827*b30d1939SAndy Fiddaman "[+?The obsolete long option forms \aflag\a(\along-name\a) and "
828*b30d1939SAndy Fiddaman   "\aflag\a:(\along-name\a) for options that take arguments is supported "
829*b30d1939SAndy Fiddaman   "for backwards compatibility.]"
830da2e3ebdSchin "a:[name?Use \aname\a instead of the command name in usage messages.]"
831da2e3ebdSchin "\n"
832da2e3ebdSchin "\nopstring name [args...]\n"
833da2e3ebdSchin "\n"
834da2e3ebdSchin "[+EXIT STATUS]{"
835da2e3ebdSchin 	"[+0?An option specified was found.]"
836da2e3ebdSchin 	"[+1?An end of options was encountered.]"
837da2e3ebdSchin 	"[+2?A usage or information message was generated.]"
838da2e3ebdSchin "}"
839da2e3ebdSchin ;
840da2e3ebdSchin 
841da2e3ebdSchin const char sh_optbg[] =
842da2e3ebdSchin "[-1c?@(#)$Id: bg (AT&T Research) 2000-04-02 $\n]"
843da2e3ebdSchin USAGE_LICENSE
844da2e3ebdSchin "[+NAME?bg - resume jobs in the background]"
845da2e3ebdSchin "[+DESCRIPTION?\bbg\b places the given \ajob\as into the background "
846da2e3ebdSchin 	"and sends them a \bCONT\b signal to start them running.]"
847da2e3ebdSchin "[+?If \ajob\a is omitted, the most recently started or stopped "
848da2e3ebdSchin 	"background job is resumed or continued in the background.]"
849*b30d1939SAndy Fiddaman _JOB_
850da2e3ebdSchin "\n"
851da2e3ebdSchin "\n[job ...]\n"
852da2e3ebdSchin "\n"
853da2e3ebdSchin "[+EXIT STATUS?]{"
854da2e3ebdSchin 	"[+0?If all background jobs are started.]"
855da2e3ebdSchin 	"[+>0?If one more jobs does not exist or there are no background "
856da2e3ebdSchin 		"jobs.]"
857da2e3ebdSchin "}"
858da2e3ebdSchin 
859da2e3ebdSchin "[+SEE ALSO?\bwait\b(1), \bfg\b(1), \bdisown\b(1), \bjobs\b(1)]"
860da2e3ebdSchin ;
861da2e3ebdSchin 
862da2e3ebdSchin const char sh_optfg[] =
863da2e3ebdSchin "[-1c?@(#)$Id: fg (AT&T Research) 2000-04-02 $\n]"
864da2e3ebdSchin USAGE_LICENSE
865da2e3ebdSchin "[+NAME?fg - move jobs to the foreground]"
866da2e3ebdSchin "[+DESCRIPTION?\bfg\b places the given \ajob\as into the foreground "
867da2e3ebdSchin 	"in sequence and sends them a \bCONT\b signal to start each running.]"
868da2e3ebdSchin "[+?If \ajob\a is omitted, the most recently started or stopped "
869da2e3ebdSchin 	"background job is moved to the foreground.]"
870*b30d1939SAndy Fiddaman _JOB_
871da2e3ebdSchin "\n"
872da2e3ebdSchin "\n[job ...]\n"
873da2e3ebdSchin "\n"
874da2e3ebdSchin "[+EXIT STATUS?If \bfg\b brings one or more jobs into the foreground, "
875da2e3ebdSchin 	"the exit status of \bfg\b  will be that of the last \ajob\a.  "
876da2e3ebdSchin 	"If one or more jobs does not exist or has completed, \bfg\b will "
877da2e3ebdSchin 	"return a non-zero exit status.]"
878da2e3ebdSchin "}"
879da2e3ebdSchin 
880da2e3ebdSchin "[+SEE ALSO?\bwait\b(1), \bbg\b(1), \bjobs\b(1)]"
881da2e3ebdSchin ;
882da2e3ebdSchin 
883da2e3ebdSchin const char sh_optdisown[] =
884da2e3ebdSchin "[-1c?@(#)$Id: disown (AT&T Research) 2000-04-02 $\n]"
885da2e3ebdSchin USAGE_LICENSE
886da2e3ebdSchin "[+NAME?disown - disassociate a job with the current shell]"
887da2e3ebdSchin "[+DESCRIPTION?\bdisown\b prevents the current shell from sending "
888da2e3ebdSchin 	"a \bHUP\b signal to each of the given \ajob\as when "
889da2e3ebdSchin 	"the current shell terminates a login session.]"
890da2e3ebdSchin "[+?If \ajob\a is omitted, the most recently started or stopped "
891da2e3ebdSchin 	"background job is used.]"
892*b30d1939SAndy Fiddaman _JOB_
893da2e3ebdSchin "\n"
894da2e3ebdSchin "\n[job ...]\n"
895da2e3ebdSchin "\n"
896da2e3ebdSchin "[+EXIT STATUS?]{"
8977c2fbfb3SApril Chin 	"[+0?If all jobs are successfully disowned.]"
898da2e3ebdSchin 	"[+>0?If one more \ajob\as does not exist.]"
899da2e3ebdSchin "}"
900da2e3ebdSchin 
901da2e3ebdSchin "[+SEE ALSO?\bwait\b(1), \bbg\b(1), \bjobs\b(1)]"
902da2e3ebdSchin ;
903da2e3ebdSchin 
904da2e3ebdSchin const char sh_optjobs[] =
905da2e3ebdSchin "[-1c?@(#)$Id: jobs (AT&T Research) 2000-04-02 $\n]"
906da2e3ebdSchin USAGE_LICENSE
907da2e3ebdSchin "[+NAME?jobs - display status of jobs]"
908da2e3ebdSchin "[+DESCRIPTION?\bjobs\b displays information about specified \ajob\as "
909da2e3ebdSchin 	"that were started by the current shell environment on standard "
910da2e3ebdSchin 	"output.  The information contains the job number enclosed in "
911da2e3ebdSchin 	"[...]], the status, and the command line that started the job.]"
912da2e3ebdSchin "[+?If \ajob\a is omitted, \bjobs\b displays the status of all stopped jobs, "
913da2e3ebdSchin 	"background jobs, and all jobs whose status has changed since last "
914da2e3ebdSchin 	"reported by the shell.]"
915da2e3ebdSchin "[+?When \bjobs\b reports the termination status of a job, the "
916da2e3ebdSchin 	"shell removes the jobs from the list of known jobs in "
917da2e3ebdSchin 	"the current shell environment.]"
918*b30d1939SAndy Fiddaman _JOB_
919da2e3ebdSchin "[l?\bjobs\b displays process id's after the job number in addition "
920da2e3ebdSchin 	"to the usual information]"
921da2e3ebdSchin "[n?Only the jobs whose status has changed since the last prompt "
922da2e3ebdSchin 	"is displayed.]"
923da2e3ebdSchin "[p?The process group leader id's for the specified jobs are displayed.]"
924da2e3ebdSchin "\n"
925da2e3ebdSchin "\n[job ...]\n"
926da2e3ebdSchin "\n"
927da2e3ebdSchin "[+EXIT STATUS?]{"
928da2e3ebdSchin 	"[+0?The information for each job is written to standard output.]"
929da2e3ebdSchin 	"[+>0?One or more jobs does not exist.]"
930da2e3ebdSchin "}"
931da2e3ebdSchin 
932da2e3ebdSchin "[+SEE ALSO?\bwait\b(1), \bps\b(1), \bfg\b(1), \bbg\b(1)]"
933da2e3ebdSchin ;
934da2e3ebdSchin 
935da2e3ebdSchin const char sh_opthist[]	=
9367c2fbfb3SApril Chin "[-1cn?@(#)$Id: hist (AT&T Research) 2000-04-02 $\n]"
937da2e3ebdSchin USAGE_LICENSE
938da2e3ebdSchin "[+NAME?\f?\f - process command history list]"
939da2e3ebdSchin "[+DESCRIPTION?\b\f?\f\b lists, edits, or re-executes, commands  "
940da2e3ebdSchin 	"previously entered into the current shell environment.]"
941da2e3ebdSchin "[+?The command history list references commands by number. The first number "
942da2e3ebdSchin 	"in the list is selected arbitrarily.  The relationship of a number "
943da2e3ebdSchin 	"to its command does not change during a login session.  When the "
944da2e3ebdSchin 	"number reaches 32767 the number wraps around to 1 but "
945da2e3ebdSchin 	"maintains the ordering.]"
946da2e3ebdSchin "[+?When commands are edited (when the \b-l\b option is not specified), the "
947da2e3ebdSchin 	"resulting lines will be entered at the end of the history list and "
948da2e3ebdSchin 	"then reexecuted by the current shell.  The \b\f?\f\b command that "
949da2e3ebdSchin 	"caused the editing will not be entered into the history list.  If the "
950da2e3ebdSchin 	"editor returns a non-zero exit status, this will suppress the "
951da2e3ebdSchin 	"entry into the history list and the command reexecution.  Command "
952da2e3ebdSchin 	"line variable assignments and redirections affect both the \f?\f "
953da2e3ebdSchin 	"command and the commands that are reexecuted.]"
954da2e3ebdSchin "[+?\afirst\a and \alast\a define the range of commands. \afirst\a and "
955da2e3ebdSchin 		"\alast\a can be one of the following:]{"
956da2e3ebdSchin 		"[+\anumber\a?A positive number representing a command "
957da2e3ebdSchin 			"number.  A \b+\b sign can precede \anumber\a.]"
958da2e3ebdSchin 		"[+-\anumber\a?A negative number representing a command "
959da2e3ebdSchin 			"that was executed \anumber\a commands previously. "
960da2e3ebdSchin 			"For example, \b-1\b is the previous command.]"
961da2e3ebdSchin 		"[+\astring\a?\astring\a indicates the most recently "
962da2e3ebdSchin 			"entered command that begins with \astring\a. "
963da2e3ebdSchin 			"\astring\a should not contain an \b=\b.]"
964da2e3ebdSchin 	"}"
965da2e3ebdSchin "[+?If \afirst\a is omitted, the previous command is used, unless \b-l\b "
966da2e3ebdSchin 	"is specified, in which case it will default to \b-16\b and \alast\a "
967da2e3ebdSchin 	"will default to \b-1\b.]"
968da2e3ebdSchin "[+?If \afirst\a is specified and \alast\a is omitted, then \alast\a will "
969da2e3ebdSchin 	"default to \afirst\a unless \b-l\b is specified in which case "
970da2e3ebdSchin 	"it will default to \b-1\b.]"
971da2e3ebdSchin "[+?If no editor is specified, then the editor specfied by the \bHISTEDIT\b "
972da2e3ebdSchin 	"variable will be used if set, or the \bFCEDIT\b variable will be "
973da2e3ebdSchin 	"used if set, otherwise, \bed\b will be used.]"
974da2e3ebdSchin "[e]:[editor?\aeditor\a specifies the editor to use to edit the history "
975da2e3ebdSchin 	"command.   A value of \b-\b for \aeditor\a is equivalent to "
976da2e3ebdSchin 	"specifiying the \b-s\b option.]"
977da2e3ebdSchin "[l?List the commands rather than editing and reexecuting them.]"
978da2e3ebdSchin "[N]#[num?Start at \anum\a commands back.]"
979da2e3ebdSchin "[n?Suppress the command numbers when the commands are listed.]"
980da2e3ebdSchin #if SHOPT_HISTEXPAND
981da2e3ebdSchin "[p?Writes the result of history expansion for each operand to standard "
982da2e3ebdSchin 	"output.  All other options are ignored.]"
983da2e3ebdSchin #endif
984da2e3ebdSchin "[r?Reverse the order of the commands.]"
985da2e3ebdSchin "[s?Reexecute the command without invoking an editor.  In this case "
986da2e3ebdSchin 	"an operand of the form \aold\a\b=\b\anew\a can be specified "
987da2e3ebdSchin 	"to change the first occurrence of the string \aold\a in the "
988da2e3ebdSchin 	"command to \anew\a before reexecuting the command.]"
989da2e3ebdSchin 
990da2e3ebdSchin "\n"
991da2e3ebdSchin "\n[first [last] ]\n"
992da2e3ebdSchin "\n"
993da2e3ebdSchin "[+EXIT STATUS?If a command is reexecuted, the exit status is that of "
994da2e3ebdSchin 	"the command that gets reexecuted.  Otherwise, it is one of the "
995da2e3ebdSchin 	"following:]{"
996da2e3ebdSchin 	"[+0?Successfully completion of the listing.]"
997da2e3ebdSchin 	"[+>0?An error occurred.]"
998da2e3ebdSchin "}"
999da2e3ebdSchin 
1000da2e3ebdSchin "[+SEE ALSO?\bksh\b(1), \bsh\b(1), \bed\b(1)]"
1001da2e3ebdSchin ;
1002da2e3ebdSchin 
1003da2e3ebdSchin const char sh_optkill[]	 =
1004*b30d1939SAndy Fiddaman "[-1c?\n@(#)$Id: kill (AT&T Research) 2012-04-13 $\n]"
1005da2e3ebdSchin USAGE_LICENSE
1006da2e3ebdSchin "[+NAME?kill - terminate or signal process]"
1007da2e3ebdSchin "[+DESCRIPTION?With the first form in which \b-l\b is not specified, "
1008da2e3ebdSchin 	"\bkill\b sends a signal to one or more processes specified by "
1009da2e3ebdSchin 	"\ajob\a.  This normally terminates the processes unless the signal "
1010da2e3ebdSchin 	"is being caught or ignored.]"
1011*b30d1939SAndy Fiddaman _JOB_
1012da2e3ebdSchin "[+?If the signal is not specified with either the \b-n\b or the \b-s\b  "
1013da2e3ebdSchin 	"option, the \bSIGTERM\b signal is used.]"
1014da2e3ebdSchin "[+?If \b-l\b is specified, and no \aarg\a is specified, then \bkill\b "
1015da2e3ebdSchin 	"writes the list of signals to standard output.  Otherwise, \aarg\a "
1016da2e3ebdSchin 	"can be either a signal name, or a number representing either a "
1017da2e3ebdSchin 	"signal number or exit status for a process that was terminated "
1018da2e3ebdSchin 	"due to a signal.  If a name is given the corresponding signal "
1019da2e3ebdSchin 	"number will be written to standard output.  If a number is given "
1020da2e3ebdSchin 	"the corresponding signal name will be written to standard output.]"
1021da2e3ebdSchin "[l?List signal names or signal numbers rather than sending signals as "
1022da2e3ebdSchin 	"described above.  "
1023da2e3ebdSchin 	"The \b-n\b and \b-s\b options cannot be specified.]"
1024*b30d1939SAndy Fiddaman "[L?Same as \b-l\b except that of no argument is specified the signals will "
1025*b30d1939SAndy Fiddaman 	"be listed in menu format as with select compound command.]"
1026da2e3ebdSchin "[n]#[signum?Specify a signal number to send.  Signal numbers are not "
1027da2e3ebdSchin 	"portable across platforms, except for the following:]{"
1028da2e3ebdSchin 		"[+0?No signal]"
1029da2e3ebdSchin 		"[+1?\bHUP\b]"
1030da2e3ebdSchin 		"[+2?\bINT\b]"
1031da2e3ebdSchin 		"[+3?\bQUIT\b]"
1032da2e3ebdSchin 		"[+6?\bABRT\b]"
1033da2e3ebdSchin 		"[+9?\bKILL\b]"
1034da2e3ebdSchin 		"[+14?\bALRM\b]"
1035da2e3ebdSchin 		"[+15?\bTERM\b]"
1036da2e3ebdSchin 	"}"
1037da2e3ebdSchin "[s]:[signame?Specify a signal name to send.  The signal names are derived "
1038da2e3ebdSchin 	"from their names in \b<signal.h>\b without the \bSIG\b prefix and "
1039da2e3ebdSchin 	"are case insensitive.  \bkill -l\b will generate the list of "
1040da2e3ebdSchin 	"signals on the current platform.]"
1041da2e3ebdSchin "\n"
1042da2e3ebdSchin "\njob ...\n"
1043da2e3ebdSchin " -l [arg ...]\n"
1044da2e3ebdSchin "\n"
1045da2e3ebdSchin "[+EXIT STATUS?]{"
1046da2e3ebdSchin 	"[+0?At least one matching process was found for each \ajob\a "
1047da2e3ebdSchin 	"operand, and the specified signal was successfully sent to at "
1048da2e3ebdSchin 	"least one matching process.]"
1049da2e3ebdSchin 	"[+>0?An error occurred.]"
1050da2e3ebdSchin "}"
1051da2e3ebdSchin "[+SEE ALSO?\bps\b(1), \bjobs\b(1), \bkill\b(2), \bsignal\b(2)]"
1052da2e3ebdSchin ;
1053da2e3ebdSchin 
1054da2e3ebdSchin const char sh_optlet[]	=
1055da2e3ebdSchin "[-1c?@(#)$Id: let (AT&T Research) 2000-04-02 $\n]"
1056da2e3ebdSchin USAGE_LICENSE
1057da2e3ebdSchin "[+NAME?let - evaluate arithmetic expressions]"
1058da2e3ebdSchin "[+DESCRIPTION?\blet\b evaluates each \aexpr\a in the current "
1059da2e3ebdSchin 	"shell environment as an arithmetic expression using ANSI C "
1060da2e3ebdSchin 	"syntax.  Variables names are shell variables and they "
1061da2e3ebdSchin 	"are recursively evaluated as arithmetic expressions to "
1062da2e3ebdSchin 	"get numerical values.]"
1063da2e3ebdSchin "[+?\blet\b has been made obsolete by the \b((\b...\b))\b syntax "
1064da2e3ebdSchin 	"of \bksh\b(1) which does not require quoting of the operators "
1065da2e3ebdSchin 	"to pass them as command arguments.]"
1066da2e3ebdSchin "\n"
1067da2e3ebdSchin "\n[expr ...]\n"
1068da2e3ebdSchin "\n"
1069da2e3ebdSchin "[+EXIT STATUS?]{"
1070da2e3ebdSchin 	"[+0?The last \aexpr\a evaluates to a non-zero value.]"
1071da2e3ebdSchin 	"[+>0?The last \aexpr\a evaluates to \b0\b or an error occurred.]"
1072da2e3ebdSchin "}"
1073da2e3ebdSchin 
1074da2e3ebdSchin "[+SEE ALSO?\bexpr\b(1), \btest\b(1), \bksh\b(1)]"
1075da2e3ebdSchin ;
1076da2e3ebdSchin 
1077da2e3ebdSchin const char sh_optprint[] =
107834f9b3eeSRoland Mainz "[-1c?\n@(#)$Id: print (AT&T Research) 2008-11-26 $\n]"
1079da2e3ebdSchin USAGE_LICENSE
1080da2e3ebdSchin "[+NAME?print - write arguments to standard output]"
1081da2e3ebdSchin "[+DESCRIPTION?By default, \bprint\b writes each \astring\a operand to "
1082da2e3ebdSchin 	"standard output and appends a newline character.]"
10837c2fbfb3SApril Chin "[+?Unless, the \b-r\b or \b-f\b option is specified, each \b\\\b "
1084da2e3ebdSchin 	"character in each \astring\a operand is processed specially as "
1085da2e3ebdSchin 	"follows:]{"
1086da2e3ebdSchin 		"[+\\a?Alert character.]"
1087da2e3ebdSchin 		"[+\\b?Backspace character.]"
1088da2e3ebdSchin 		"[+\\c?Terminate output without appending newline.  The "
1089da2e3ebdSchin 			"remaining \astring\a operands are ignored.]"
1090da2e3ebdSchin 		"[+\\f?Formfeed character.]"
1091da2e3ebdSchin 		"[+\\n?Newline character.]"
1092da2e3ebdSchin 		"[+\\t?Tab character.]"
1093da2e3ebdSchin 		"[+\\v?Vertical tab character.]"
1094da2e3ebdSchin 		"[+\\\\?Backslash character.]"
1095da2e3ebdSchin 		"[+\\E?Escape character (ASCII octal 033).]"
1096da2e3ebdSchin 		"[+\\0\ax\a?The 8-bit character whose ASCII code is the "
1097da2e3ebdSchin 			"1-, 2-, or 3-digit octal number \ax\a.]"
1098da2e3ebdSchin 	"}"
1099da2e3ebdSchin "[+?If both \b-e\b and \b-r\b are specified, the last one specified is "
1100da2e3ebdSchin 	"the one that is used.]"
1101da2e3ebdSchin "[+?When the \b-f\b option is specified and there are more \astring\a "
1102da2e3ebdSchin 	"operands than format specifiers, the format string is "
1103da2e3ebdSchin 	"reprocessed from the beginning.  If there are fewer \astring\a "
1104da2e3ebdSchin 	"operands than format specifiers, then outputting will end "
1105da2e3ebdSchin 	"at the first unneeded format specifier.]"
1106da2e3ebdSchin "[e?Unless \b-f\b is specified, process \b\\\b sequences in each \astring\a "
1107da2e3ebdSchin 	"operand as described above. This is the default behavior.]"
1108da2e3ebdSchin "[n?Do not append a new-line character to the output.]"
1109da2e3ebdSchin "[f]:[format?Write the \astring\a arguments using the format string "
1110da2e3ebdSchin 	"\aformat\a and do not append a new-line.  See \bprintf\b for "
1111da2e3ebdSchin 	"details on how to specify \aformat\a.]"
1112da2e3ebdSchin "[p?Write to the current co-process instead of standard output.]"
1113da2e3ebdSchin "[r?Do not process \b\\\b sequences in each \astring\a operand as described "
1114da2e3ebdSchin 	"above.]"
1115da2e3ebdSchin "[s?Write the output as an entry in the shell history file instead of "
1116da2e3ebdSchin 	"standard output.]"
1117da2e3ebdSchin "[u]:[fd:=1?Write to file descriptor number \afd\a instead of standard output.]"
11187c2fbfb3SApril Chin "[v?Treat each \astring\a as a variable name and write the value in \b%B\b "
11197c2fbfb3SApril Chin 	"format.  Cannot be used with \b-f\b.]"
112034f9b3eeSRoland Mainz "[C?Treat each \astring\a as a variable name and write the value in \b%#B\b "
112134f9b3eeSRoland Mainz 	"format.  Cannot be used with \b-f\b.]"
1122da2e3ebdSchin "\n"
1123da2e3ebdSchin "\n[string ...]\n"
1124da2e3ebdSchin "\n"
1125da2e3ebdSchin "[+EXIT STATUS?]{"
1126da2e3ebdSchin 	"[+0?Successful completion.]"
1127da2e3ebdSchin 	"[+>0?An error occurred.]"
1128da2e3ebdSchin "}"
1129da2e3ebdSchin "[+SEE ALSO?\becho\b(1), \bprintf\b(1), \bread\b(1)]"
1130da2e3ebdSchin ;
1131da2e3ebdSchin 
1132da2e3ebdSchin const char sh_optprintf[] =
113334f9b3eeSRoland Mainz "[-1c?\n@(#)$Id: printf (AT&T Research) 2009-02-02 $\n]"
1134da2e3ebdSchin USAGE_LICENSE
1135da2e3ebdSchin "[+NAME?printf - write formatted output]"
1136da2e3ebdSchin "[+DESCRIPTION?\bprintf\b writes each \astring\a operand to "
1137da2e3ebdSchin 	"standard output using \aformat\a to control the output format.]"
1138da2e3ebdSchin "[+?The \aformat\a operands supports the full range of ANSI C formatting "
1139da2e3ebdSchin 	"specifiers plus the following additional specifiers:]{"
1140da2e3ebdSchin 	"[+%b?Each character in the \astring\a operand is processed "
1141da2e3ebdSchin 		"specially as follows:]{"
1142da2e3ebdSchin 			"[+\\a?Alert character.]"
1143da2e3ebdSchin 			"[+\\b?Backspace character.]"
1144da2e3ebdSchin 			"[+\\c?Terminate output without appending newline. "
1145da2e3ebdSchin 			    "The remaining \astring\a operands are ignored.]"
1146da2e3ebdSchin 			"[+\\f?Formfeed character.]"
1147da2e3ebdSchin 			"[+\\n?Newline character.]"
1148da2e3ebdSchin 			"[+\\t?Tab character.]"
1149da2e3ebdSchin 			"[+\\v?Vertical tab character.]"
1150da2e3ebdSchin 			"[+\\\\?Backslash character.]"
1151da2e3ebdSchin 			"[+\\E?Escape character (ASCII octal 033).]"
1152da2e3ebdSchin 			"[+\\0\ax\a?The 8-bit character whose ASCII code is "
1153da2e3ebdSchin 				"the 1-, 2-, or 3-digit octal number \ax\a.]"
1154da2e3ebdSchin 		"}"
1155da2e3ebdSchin 	"[+%q?Output \astring\a quoted in a manner that it can be read in "
1156da2e3ebdSchin 		"by the shell to get back the same string.  However, empty "
1157da2e3ebdSchin 		"strings resulting from missing \astring\a operands will "
1158*b30d1939SAndy Fiddaman 		"not be quoted. When \bq\b is preceded by the alternative "
1159*b30d1939SAndy Fiddaman 		"format specifier, \b#\b, the string is quoted in manner "
1160*b30d1939SAndy Fiddaman 		" suitable as a field in a \b.csv\b format file.]"
1161da2e3ebdSchin 	"[+%B?Treat the argument as a variable name and output the value "
1162da2e3ebdSchin 		"without converting it to a string.  This is most useful for "
1163da2e3ebdSchin 		"variables of type \b-b\b.]"
1164da2e3ebdSchin 	"[+%H?Output \astring\a with characters \b<\b, \b&\b, \b>\b, "
1165da2e3ebdSchin 		"\b\"\b, and non-printable characters properly escaped for "
1166*b30d1939SAndy Fiddaman 		"use in HTML and XML documents.  The alternate flag \b#\b "
1167*b30d1939SAndy Fiddaman 		"formats the output for use as a URI.]"
1168da2e3ebdSchin 	"[+%P?Treat \astring\a as an extended regular expression and  "
1169da2e3ebdSchin 		"convert it to a shell pattern.]"
1170da2e3ebdSchin 	"[+%R?Treat \astring\a as an shell pattern expression and  "
1171da2e3ebdSchin 		"convert it to an extended regular expression.]"
1172da2e3ebdSchin 	"[+%T?Treat \astring\a as a date/time string and format it.  The "
1173da2e3ebdSchin 		"\bT\b can be preceded by \b(\b\adformat\a\b)\b, where "
1174da2e3ebdSchin 		"\adformat\a is a date format as defined by the \bdate\b "
1175da2e3ebdSchin 		"command.]"
1176da2e3ebdSchin 	"[+%Z?Output a byte whose value is \b0\b.]"
1177*b30d1939SAndy Fiddaman 	"\fextra\f"
1178da2e3ebdSchin "}"
1179*b30d1939SAndy Fiddaman "[+?The format modifier flag \bL\b can precede the width and/or precision "
1180*b30d1939SAndy Fiddaman 	"specifiers for the \bc\b and \bs\b to cause the width and/or "
1181*b30d1939SAndy Fiddaman 	"precision to be measured in character width rather than byte count.]"
1182da2e3ebdSchin "[+?When performing conversions of \astring\a to satisfy a numeric "
1183da2e3ebdSchin 	"format specifier, if the first character of \astring\a "
1184da2e3ebdSchin 	"is \b\"\b or \b'\b, then the value will be the numeric value "
1185da2e3ebdSchin 	"in the underlying code set of the character following the "
1186da2e3ebdSchin 	"\b\"\b or \b'\b.  Otherwise, \astring\a is treated like a shell "
1187da2e3ebdSchin 	"arithmetic expression and evaluated.]"
118834f9b3eeSRoland Mainz "[+?If a \astring\a operand cannot be completely converted into a value "
1189da2e3ebdSchin 	"appropriate for that format specifier, an error will occur, "
1190da2e3ebdSchin 	"but remaining \astring\a operands will continue to be processed.]"
1191da2e3ebdSchin "[+?In addition to the format specifier extensions, the following "
1192da2e3ebdSchin 	"extensions of ANSI-C are permitted in format specifiers:]{"
1193da2e3ebdSchin 	"[+-?The escape sequences \b\\E\b and \b\\e\b expand to the escape "
1194da2e3ebdSchin 		"character which is octal \b033\b in ASCII.]"
1195da2e3ebdSchin 	"[+-?The escape sequence \b\\c\b\ax\a expands to Control-\ax\a.]"
1196da2e3ebdSchin 	"[+-?The escape sequence \b\\C[.\b\aname\a\b.]]\b expands to "
1197da2e3ebdSchin 		"the collating element \aname\a.]"
1198da2e3ebdSchin 	"[+-?The escape sequence \b\\x{\b\ahex\a\b}\b expands to the "
1199da2e3ebdSchin 		"character corresponding to the hexidecimal value \ahex\a.]"
1200*b30d1939SAndy Fiddaman 	"[+-?The escape sequence \b\\u{\b\ahex\a\b}\b expands to the unicode "
1201*b30d1939SAndy Fiddaman 		"character corresponding to the hexidecimal value \ahex\a.]"
1202da2e3ebdSchin 	"[+-?The format modifier flag \b=\b can be used to center a field to "
120334f9b3eeSRoland Mainz 		"a specified width.]"
120434f9b3eeSRoland Mainz 	"[+-?The format modifier flag \bL\b can be used with the \bc\b and "
120534f9b3eeSRoland Mainz 		"\bs\b formats to treat precision as character width instead "
120634f9b3eeSRoland Mainz 		"of byte count.]"
1207*b30d1939SAndy Fiddaman 	"[+-?The format modifier flag \b,\b can be used with \bd\b and \bf\b "
1208*b30d1939SAndy Fiddaman 		"formats to cause group of digits.]"
1209da2e3ebdSchin 	"[+-?Each of the integral format specifiers can have a third "
1210da2e3ebdSchin 		"modifier after width and precision that specifies the "
1211da2e3ebdSchin 		"base of the conversion from 2 to 64.  In this case the "
1212da2e3ebdSchin 		"\b#\b modifier will cause \abase\a\b#\b to be prepended to "
1213da2e3ebdSchin 		"the value.]"
1214da2e3ebdSchin 	"[+-?The \b#\b modifier can be used with the \bd\b specifier when "
1215da2e3ebdSchin 		"no base is specified cause the output to be written in units "
1216da2e3ebdSchin 		"of \b1000\b with a suffix of one of \bk M G T P E\b.]"
1217da2e3ebdSchin 	"[+-?The \b#\b modifier can be used with the \bi\b specifier to "
1218da2e3ebdSchin 		"cause the output to be written in units of \b1024\b with "
1219da2e3ebdSchin 		"a suffix of one of \bKi Mi Gi Ti Pi Ei\b.]"
1220da2e3ebdSchin 	"}"
1221da2e3ebdSchin "[+?If there are more \astring\a operands than format specifiers, the "
1222da2e3ebdSchin 	"\aformat\a string is reprocessed from the beginning.  If there are "
1223da2e3ebdSchin 	"fewer \astring\a operands than format specifiers, then string "
1224da2e3ebdSchin 	"specifiers will be treated as if empty strings were supplied, "
1225da2e3ebdSchin 	"numeric conversions will be treated as if 0 were supplied, and "
1226da2e3ebdSchin 	"time conversions will be treated as if \bnow\b were supplied.]"
1227da2e3ebdSchin "[+?\bprintf\b is equivalent to \bprint -f\b which allows additional "
1228da2e3ebdSchin 	"options to be specified.]"
1229da2e3ebdSchin "\n"
1230da2e3ebdSchin "\nformat [string ...]\n"
1231da2e3ebdSchin "\n"
1232da2e3ebdSchin "[+EXIT STATUS?]{"
1233da2e3ebdSchin 	"[+0?Successful completion.]"
1234da2e3ebdSchin 	"[+>0?An error occurred.]"
1235da2e3ebdSchin "}"
1236da2e3ebdSchin "[+SEE ALSO?\bdate\b(1), \bprint\b(1), \bread\b(1)]"
1237da2e3ebdSchin ;
1238da2e3ebdSchin 
1239da2e3ebdSchin const char sh_optpwd[] =
1240da2e3ebdSchin "[-1c?\n@(#)$Id: pwd (AT&T Research) 1999-06-07 $\n]"
1241da2e3ebdSchin USAGE_LICENSE
1242da2e3ebdSchin "[+NAME?pwd - write working directory name]"
1243da2e3ebdSchin "[+DESCRIPTION?\bpwd\b writes an absolute pathname of the current working "
1244da2e3ebdSchin 	"directory to standard output.   An absolute pathname is a "
1245da2e3ebdSchin 	"pathname that begins with \b/\b that does not contains any "
1246da2e3ebdSchin 	"\b.\b  or \b..\b components.]"
1247da2e3ebdSchin "[+?If both \b-L\b and \b-P\b are specified, the last one specified will "
1248da2e3ebdSchin 	"be used.  If neither \b-P\b or \b-L\b is specified then the "
1249da2e3ebdSchin 	"behavior will be determined by the \bgetconf\b parameter "
1250da2e3ebdSchin 	"\bPATH_RESOLVE\b.  If \bPATH_RESOLVE\b is \bphysical\b, "
1251da2e3ebdSchin 	"then the behavior will be as if \b-P\b were specified.  Otherwise, "
1252da2e3ebdSchin 	"the behavior will be as if  \b-L\b were specified.]"
1253da2e3ebdSchin "[L?The absolute pathname may contains symbolic link components.  This is "
1254da2e3ebdSchin 	"the default.]"
1255da2e3ebdSchin "[P?The absolute pathname will not contain any symbolic link components.]"
1256da2e3ebdSchin "[+EXIT STATUS?]{"
1257da2e3ebdSchin 	"[+0?Successful completion.]"
1258da2e3ebdSchin 	"[+>0?An error occurred.]"
1259da2e3ebdSchin "}"
1260da2e3ebdSchin "[+SEE ALSO?\bcd\b(1), \bgetconf\b(1)]"
1261da2e3ebdSchin ;
1262da2e3ebdSchin 
1263da2e3ebdSchin const char sh_optread[] =
1264da2e3ebdSchin "[-1c?\n@(#)$Id: read (AT&T Research) 2006-12-19 $\n]"
1265da2e3ebdSchin USAGE_LICENSE
1266da2e3ebdSchin "[+NAME?read - read a line from standard input]"
1267da2e3ebdSchin "[+DESCRIPTION?\bread\b reads a line from standard input and breaks it "
1268da2e3ebdSchin 	"into fields using the characters in value of the \bIFS\b variable "
1269da2e3ebdSchin 	"as separators.  The escape character, \b\\\b, is used to remove "
1270da2e3ebdSchin 	"any special meaning for the next character and for line continuation "
1271da2e3ebdSchin 	"unless the \b-r\b option is specified.]"
1272da2e3ebdSchin "[+?If there are more variables than fields, the remaining variables are "
1273da2e3ebdSchin 	"set to empty strings.  If there are fewer variables than fields, "
1274da2e3ebdSchin 	"the leftover fields and their intervening separators are assigned "
12757c2fbfb3SApril Chin 	"to the last variable.  If no \avar\a is specified then the variable "
1276da2e3ebdSchin 	"\bREPLY\b is used.]"
1277da2e3ebdSchin "[+?When \avar\a has the binary attribute and \b-n\b or \b-N\b is specified, "
1278da2e3ebdSchin 	"the bytes that are read are stored directly into \bvar\b.]"
1279da2e3ebdSchin "[+?If you specify \b?\b\aprompt\a after the first \avar\a, then \bread\b "
1280da2e3ebdSchin 	"will display \aprompt\a on standard error when standard input "
1281da2e3ebdSchin 	"is a terminal or pipe.]"
1282*b30d1939SAndy Fiddaman "[+?If an end of file is encountered while reading a line the data is "
1283*b30d1939SAndy Fiddaman 	"read and processed but \bread\b returns with a non-zero exit status.]"
1284da2e3ebdSchin "[A?Unset \avar\a and then create an indexed array containing each field in "
1285da2e3ebdSchin 	"the line starting at index 0.]"
12867c2fbfb3SApril Chin "[C?Unset \avar\a and read  \avar\a as a compound variable.]"
1287da2e3ebdSchin "[d]:[delim?Read until delimiter \adelim\a instead of to the end of line.]"
1288da2e3ebdSchin "[p?Read from the current co-process instead of standard input.  An end of "
1289da2e3ebdSchin 	"file causes \bread\b to disconnect the co-process so that another "
1290da2e3ebdSchin 	"can be created.]"
1291da2e3ebdSchin "[r?Do not treat \b\\\b specially when processing the input line.]"
1292da2e3ebdSchin "[s?Save a copy of the input as an entry in the shell history file.]"
1293*b30d1939SAndy Fiddaman "[S?Treat the input as if it was saved from a spreasheet in csv format.]"
1294da2e3ebdSchin "[u]#[fd:=0?Read from file descriptor number \afd\a instead of standard input.]"
1295da2e3ebdSchin "[t]:[timeout?Specify a timeout \atimeout\a in seconds when reading from "
1296da2e3ebdSchin 	"a terminal or pipe.]"
1297*b30d1939SAndy Fiddaman "[n]#[count?Read at most \acount\a characters.  For binary fields \acount\a "
1298*b30d1939SAndy Fiddaman 	"is the number of bytes.]"
1299*b30d1939SAndy Fiddaman "[N]#[count?Read exactly \ancount\a characters.  For binary fields \acount\a "
1300*b30d1939SAndy Fiddaman 	"is the number of bytes.]"
1301da2e3ebdSchin "[v?When reading from a terminal the value of the first variable is displayed "
1302da2e3ebdSchin 	"and used as a default value.]"
1303da2e3ebdSchin "\n"
1304da2e3ebdSchin "\n[var?prompt] [var ...]\n"
1305da2e3ebdSchin "\n"
1306da2e3ebdSchin "[+EXIT STATUS?]{"
1307da2e3ebdSchin 	"[+0? Successful completion.]"
1308da2e3ebdSchin 	"[+>0?End of file was detected or an error occurred.]"
1309da2e3ebdSchin "}"
1310da2e3ebdSchin "[+SEE ALSO?\bprint\b(1), \bprintf\b(1), \bcat\b(1)]"
1311da2e3ebdSchin ;
1312da2e3ebdSchin 
1313da2e3ebdSchin const char sh_optreadonly[] =
13147c2fbfb3SApril Chin "[-1c?\n@(#)$Id: readonly (AT&T Research) 2008-06-16 $\n]"
1315da2e3ebdSchin USAGE_LICENSE
1316da2e3ebdSchin "[+NAME?readonly - set readonly attribute on variables]"
1317da2e3ebdSchin "[+DESCRIPTION?\breadonly\b sets the readonly attribute on each of "
1318da2e3ebdSchin 	"the variables specified by \aname\a which prevents their "
1319da2e3ebdSchin 	"values from being changed.  If \b=\b\avalue\a is specified, "
1320da2e3ebdSchin 	"the variable \aname\a is set to \avalue\a before the variable "
1321da2e3ebdSchin 	"is made readonly.]"
13227c2fbfb3SApril Chin "[+?Within a type definition, if the value is not specified, then a "
13237c2fbfb3SApril Chin 	"value must be specified when creating each instance of the type "
13247c2fbfb3SApril Chin         "and the value is readonly for each instance.]"
1325da2e3ebdSchin "[+?If no \aname\as are specified then the names and values of all "
1326da2e3ebdSchin 	"readonly variables are written to standard output.]"
1327da2e3ebdSchin "[+?\breadonly\b is built-in to the shell as a declaration command so that "
1328da2e3ebdSchin 	"field splitting and pathname expansion are not performed on "
1329da2e3ebdSchin 	"the arguments.  Tilde expansion occurs on \avalue\a.]"
1330da2e3ebdSchin "[p?Causes the output to be in a form of \breadonly\b commands that can be "
1331da2e3ebdSchin 	"used as input to the shell to recreate the current set of "
1332da2e3ebdSchin 	"readonly variables.]"
1333da2e3ebdSchin "\n"
1334da2e3ebdSchin "\n[name[=value]...]\n"
1335da2e3ebdSchin "\n"
1336da2e3ebdSchin "[+EXIT STATUS?]{"
1337da2e3ebdSchin         "[+0?Successful completion.]"
1338da2e3ebdSchin         "[+>0?An error occurred.]"
1339da2e3ebdSchin "}"
1340da2e3ebdSchin 
1341da2e3ebdSchin "[+SEE ALSO?\bsh\b(1), \btypeset\b(1)]"
1342da2e3ebdSchin ;
1343da2e3ebdSchin 
1344da2e3ebdSchin const char sh_optreturn[] =
1345da2e3ebdSchin "[-1c?\n@(#)$Id: return (AT&T Research) 1999-07-07 $\n]"
1346da2e3ebdSchin USAGE_LICENSE
1347da2e3ebdSchin "[+NAME?return - return from a function or dot script ]"
1348da2e3ebdSchin "[+DESCRIPTION?\breturn\b is a shell special built-in that causes the "
1349da2e3ebdSchin 	"function or dot script that invokes it to exit.  "
1350da2e3ebdSchin 	"If \breturn\b is invoked outside of a function or dot script "
1351da2e3ebdSchin 	"it is equivalent to \bexit\b.]"
1352da2e3ebdSchin "[+?If \breturn\b is invoked inside a function defined with the \bfunction\b "
1353da2e3ebdSchin 	"reserved word syntax, then any \bEXIT\b trap set within the "
1354da2e3ebdSchin 	"then function will be invoked in the context of the caller "
1355da2e3ebdSchin 	"before the function returns.]"
1356da2e3ebdSchin "[+?If \an\a is given, it will be used to set the exit status.]"
1357da2e3ebdSchin "\n"
1358da2e3ebdSchin "\n[n]\n"
1359da2e3ebdSchin "\n"
1360da2e3ebdSchin "[+EXIT STATUS?If \an\a is specified, the exit status is the least significant "
1361da2e3ebdSchin 	"eight bits of the value of \an\a.  Otherwise, the exit status is the "
1362da2e3ebdSchin 	"exit status of preceding command.]"
1363da2e3ebdSchin "[+SEE ALSO?\bbreak\b(1), \bexit\b(1)]"
1364da2e3ebdSchin ;
1365da2e3ebdSchin 
1366da2e3ebdSchin 
1367da2e3ebdSchin const char sh_optksh[] =
1368*b30d1939SAndy Fiddaman "+[-1?\n@(#)$Id: sh (AT&T Research) "SH_RELEASE" $\n]"
1369da2e3ebdSchin USAGE_LICENSE
1370da2e3ebdSchin "[+NAME?\b\f?\f\b - Shell, the standard command language interpreter]"
1371da2e3ebdSchin "[+DESCRIPTION?\b\f?\f\b is a command language interpreter that "
1372da2e3ebdSchin 	"executes commands read from a command line string, the "
1373da2e3ebdSchin 	"standard input, or a specified file.]"
1374da2e3ebdSchin "[+?If the \b-i\b option is present, or there are no \aarg\as and "
1375da2e3ebdSchin 	"the standard input and standard error are attached to a "
1376da2e3ebdSchin 	"terminal, the shell is considered to be interactive.]"
1377da2e3ebdSchin "[+?The \b-s\b and \b-c\b options are mutually exclusive.  If the \b-c\b "
1378da2e3ebdSchin 	"option is specified, the first \aarg\a is the command-line string "
1379da2e3ebdSchin 	"and must be specified.  Any remaining \aarg\as will be used "
1380da2e3ebdSchin 	"to initialize \b$0\b and positional parameters.]"
1381da2e3ebdSchin "[+?If the neither \b-s\b nor \b-c\b is specified, then the first \barg\b "
1382da2e3ebdSchin 	"will be the pathname of the file containing commands and \b$0\b "
1383da2e3ebdSchin 	"will be set to this value.  If there is no file with this pathname, "
1384da2e3ebdSchin 	"and this pathame does not contain a \b/\b, then the \bPATH\b "
1385da2e3ebdSchin 	"will be searched for an executable with this name.  Any remaining "
1386da2e3ebdSchin 	"\aarg\as will be used to initialize the positional parmaeters.]"
1387da2e3ebdSchin "[+?Any option can use a \b+\b instead of a \b-\b to disable the corresponding "
1388da2e3ebdSchin 	"option.]"
1389da2e3ebdSchin "[c?Read the commands from the first \aarg\a.]"
1390da2e3ebdSchin "[i?Specifies that the shell is interactive.]"
1391da2e3ebdSchin "[l?Invoke the shell as a login shell; \b/etc/profile\b and \b$HOME/.profile\b, "
1392da2e3ebdSchin 	"if they exist, are read before the first command.]"
1393da2e3ebdSchin "[r\f:restricted\f?Invoke the shell in a restricted mode.  A restricted "
1394da2e3ebdSchin 	"shell does not permit any of the following:]{"
1395da2e3ebdSchin 	"[+-?Changing the working directory.]"
1396da2e3ebdSchin 	"[+-?Setting values or attributes of the variables \bSHELL\b, "
1397da2e3ebdSchin 		"\bENV\b, \bFPATH\b, or \bPATH\b.]"
1398da2e3ebdSchin 	"[+-?Executing any command whose name as a \b/\b in it.]"
1399da2e3ebdSchin 	"[+-?Redirecting output of a command with \b>\b, \b>|\b, "
1400da2e3ebdSchin 		"\b<>\b, or \b>>\b.]"
1401da2e3ebdSchin 	"[+-?Adding or deleting built-in commands or libraries with "
1402da2e3ebdSchin 		"\bbuiltin\b.]"
1403da2e3ebdSchin 	"[+-?Executing \bcommand -p\b \a...\a .]"
1404da2e3ebdSchin 	"}"
1405da2e3ebdSchin "[s?Read the commands from standard input.  The positional parameters will be "
1406da2e3ebdSchin 	"initialized from \aarg\a.]"
1407da2e3ebdSchin "[D\f:dump-strings\f?Do not execute the script, but output the set of double "
1408da2e3ebdSchin 	"quoted strings preceded by a \b$\b.  These strings are needed for "
1409da2e3ebdSchin 	"localization of the script to different locales.]"
14107c2fbfb3SApril Chin "[E?Reads the file "
14117c2fbfb3SApril Chin #if SHOPT_SYSRC
14127c2fbfb3SApril Chin 	"\b/etc/ksh.kshrc\b, if it exists, as a profile, followed by "
14137c2fbfb3SApril Chin #endif
14147c2fbfb3SApril Chin 	"\b${ENV-$HOME/.kshrc}\b, if it exists, as a profile. "
1415da2e3ebdSchin 	"On by default for interactive shells; use \b+E\b to disable.]"
1416da2e3ebdSchin #if SHOPT_PFSH
1417da2e3ebdSchin "[P?Invoke the shell as a profile shell.  See \bpfexec\b(1).]"
1418da2e3ebdSchin #endif
1419da2e3ebdSchin #if SHOPT_KIA
1420da2e3ebdSchin "[R]:[file?Do not execute the script, but create a cross reference database "
14217c2fbfb3SApril Chin 	"in \afile\a that can be used a separate shell script browser.  The "
14227c2fbfb3SApril Chin 	"-R option requires a script to be specified as the first operand.]"
1423da2e3ebdSchin #endif /* SHOPT_KIA */
142434f9b3eeSRoland Mainz #if SHOPT_REGRESS
142534f9b3eeSRoland Mainz "[I:regress]:[intercept?Enable the regression test \aintercept\a. Must be "
142634f9b3eeSRoland Mainz 	"the first command line option(s).]"
142734f9b3eeSRoland Mainz #endif
1428da2e3ebdSchin #if SHOPT_BASH
1429da2e3ebdSchin    "\fbash2\f"
1430da2e3ebdSchin #endif
1431da2e3ebdSchin "\fabc\f"
143234f9b3eeSRoland Mainz "?"
143334f9b3eeSRoland Mainz "[T?Enable implementation specific test code defined by mask.]#[mask]"
1434da2e3ebdSchin "\n"
1435da2e3ebdSchin "\n[arg ...]\n"
1436da2e3ebdSchin "\n"
1437da2e3ebdSchin "[+EXIT STATUS?If \b\f?\f\b executes command, the exit status will be that "
1438da2e3ebdSchin         "of the last command executed.  Otherwise, it will be one of "
1439da2e3ebdSchin         "the following:]{"
1440da2e3ebdSchin         "[+0?The script or command line to be executed consists entirely "
1441da2e3ebdSchin 		"of zero or more blank lines or comments.]"
1442da2e3ebdSchin         "[+>1-125?A noninteractive shell detected a syntax error, a variable "
1443da2e3ebdSchin 		"assignment error, or an error in a special built-in.]"
1444da2e3ebdSchin 	"[+126?\b-c\b and \b-s\b were not specified and the command script "
1445da2e3ebdSchin 		"was found on \bPATH\b but was not executable.]"
1446da2e3ebdSchin 	"[+127?\b-c\b and \b-s\b were not specified and the command script "
1447da2e3ebdSchin 		"corresponding to \aarg\a could not be found.]"
1448da2e3ebdSchin "}"
1449da2e3ebdSchin 
1450da2e3ebdSchin "[+SEE ALSO?\bset\b(1), \bbuiltin\b(1)]"
1451da2e3ebdSchin ;
1452da2e3ebdSchin const char sh_optset[] =
1453da2e3ebdSchin "+[-1c?\n@(#)$Id: set (AT&T Research) 1999-09-28 $\n]"
1454da2e3ebdSchin USAGE_LICENSE
1455da2e3ebdSchin "[+NAME?set - set/unset options and positional parameters]"
1456da2e3ebdSchin "[+DESCRIPTION?\bset\b sets or unsets options and positional parameters.  "
1457da2e3ebdSchin 	"Options that are specified with a \b-\b cause the options to "
1458da2e3ebdSchin 	"be set.  Options that are specified with a \b+\b cause the "
1459da2e3ebdSchin 	"option to be unset.]"
1460da2e3ebdSchin "[+?\bset\b without any options or arguments displays the names and "
1461da2e3ebdSchin 	"values of all shell variables in the order of the collation "
1462da2e3ebdSchin 	"sequence in the current locale.  The values are quoted so that "
1463da2e3ebdSchin 	"they are suitable for reinput to the shell.]"
1464da2e3ebdSchin "[+?If no \aarg\as are specified, not even the end of options argument \b--\b, "
1465da2e3ebdSchin 	"the positional parameters are unchanged.  Otherwise, unless "
1466da2e3ebdSchin 	"the \b-A\b options has been specified, the positional parameters "
1467da2e3ebdSchin 	"are replaced by the list of \aarg\as.  A first \aarg\a of "
1468da2e3ebdSchin 	"\b--\b is ignored when setting positional parameters.]"
1469da2e3ebdSchin "[+?For backward compatibility, a \bset\b command without any options "
1470da2e3ebdSchin 	"specified whose first \aarg\a is \b-\b will turn off "
1471da2e3ebdSchin 	"the \b-v\b and \b-x\b options.  If any additional \aarg\as "
1472da2e3ebdSchin 	"are specified, they will replace the positional parameters.]"
1473da2e3ebdSchin "[s?Sort the positional parameters.]"
1474da2e3ebdSchin "[A]:[name?Assign the arguments sequentially to the array named by \aname\a "
1475da2e3ebdSchin 	"starting at subscript 0 rather than to the positional parameters.]"
1476da2e3ebdSchin "\fabc\f"
14777c2fbfb3SApril Chin "[06:default?Restore all non-command line options to the default settings.]"
14787c2fbfb3SApril Chin "[07:state?List the current option state in the form of a \bset\b command "
14797c2fbfb3SApril Chin 	"that can be executed to restore the state.]"
1480da2e3ebdSchin "\n"
1481da2e3ebdSchin "\n[arg ...]\n"
1482da2e3ebdSchin "\n"
1483da2e3ebdSchin "[+EXIT STATUS?]{"
1484da2e3ebdSchin         "[+0?No errors occurred.]"
1485da2e3ebdSchin         "[+>0?An error occurred.]"
1486da2e3ebdSchin "}"
1487da2e3ebdSchin 
1488da2e3ebdSchin "[+SEE ALSO?\btypeset\b(1), \bshift\b(1)]"
1489da2e3ebdSchin ;
1490da2e3ebdSchin 
1491da2e3ebdSchin 
1492da2e3ebdSchin 
1493da2e3ebdSchin const char sh_optshift[] =
1494da2e3ebdSchin "[-1c?\n@(#)$Id: shift (AT&T Research) 1999-07-07 $\n]"
1495da2e3ebdSchin USAGE_LICENSE
1496da2e3ebdSchin "[+NAME?shift - shift positional parameters]"
1497da2e3ebdSchin "[+DESCRIPTION?\bshift\b is a shell special built-in that shifts the "
1498da2e3ebdSchin 	"positional parameters to the left by the number of places "
1499da2e3ebdSchin 	"defined by \an\a, or \b1\b if \an\a is omitted.  The number of "
1500da2e3ebdSchin 	"positional parameters remaining will be reduced by the "
1501da2e3ebdSchin 	"number of places that are shifted.]"
1502da2e3ebdSchin "[+?If \an\a is given, it will be evaluated as an arithmetic expression "
1503da2e3ebdSchin 	"to determinate the number of places to shift.  It is an error "
1504da2e3ebdSchin 	"to shift more than the number of positional parameters or a "
1505da2e3ebdSchin 	"negative number of places.]"
1506da2e3ebdSchin "\n"
1507da2e3ebdSchin "\n[n]\n"
1508da2e3ebdSchin "\n"
1509da2e3ebdSchin "[+EXIT STATUS?]{"
1510da2e3ebdSchin         "[+0?The positional parameters were successfully shifted.]"
1511da2e3ebdSchin         "[+>0?An error occurred.]"
1512da2e3ebdSchin "}"
1513da2e3ebdSchin "[+SEE ALSO?\bset\b(1)]"
1514da2e3ebdSchin ;
1515da2e3ebdSchin 
1516da2e3ebdSchin const char sh_optsleep[] =
151734f9b3eeSRoland Mainz "[-1c?\n@(#)$Id: sleep (AT&T Research) 2009-03-12 $\n]"
1518da2e3ebdSchin USAGE_LICENSE
1519da2e3ebdSchin "[+NAME?sleep - suspend execution for an interval]"
1520da2e3ebdSchin "[+DESCRIPTION?\bsleep\b suspends execution for at least the time specified "
152134f9b3eeSRoland Mainz 	"by \aduration\a or until a \bSIGALRM\b signal is received. "
152234f9b3eeSRoland Mainz 	"\aduration\a may be one of the following:]"
152334f9b3eeSRoland Mainz "{"
152434f9b3eeSRoland Mainz 	"[+integer?The number of seconds to sleep.]"
152534f9b3eeSRoland Mainz 	"[+floating point?The number of seconds to sleep. The actual "
152634f9b3eeSRoland Mainz 		"granularity depends on the underlying system, normally "
152734f9b3eeSRoland Mainz 		"around 1 millisecond.]"
152834f9b3eeSRoland Mainz 	"[+P\an\a\bY\b\an\a\bM\b\an\a\bDT\b\an\a\bH\b\an\a\bM\b\an\a\bS?An ISO 8601 duration "
152934f9b3eeSRoland Mainz 		"where at least one of the duration parts must be specified.]"
153034f9b3eeSRoland Mainz 	"[+P\an\a\bW?An ISO 8601 duration specifying \an\a weeks.]"
153134f9b3eeSRoland Mainz 	"[+p\an\a\bY\b\an\a\bM\b\an\a\bDT\b\an\a\bH\b\an\a\bm\b\an\a\bS?A case insensitive "
153234f9b3eeSRoland Mainz 		"ISO 8601 duration except that \bM\b specifies months, \bm\b before \bs\b or \bS\b "
153334f9b3eeSRoland Mainz 		"specifies minutes and after specifies milliseconds, \bu\b or \bU\b specifies "
153434f9b3eeSRoland Mainz 		"microseconds, and \bn\b specifies nanoseconds.]"
153534f9b3eeSRoland Mainz 	"[+date/time?Sleep until the \bdate\b(1) compatible date/time.]"
153634f9b3eeSRoland Mainz "}"
153734f9b3eeSRoland Mainz "[s?Sleep until a signal or a timeout is received. If \aduration\a is omitted "
153834f9b3eeSRoland Mainz 	"or 0 then no timeout will be used.]"
1539da2e3ebdSchin "\n"
154034f9b3eeSRoland Mainz "\n[ duration ]\n"
1541da2e3ebdSchin "\n"
1542da2e3ebdSchin "[+EXIT STATUS?]{"
154334f9b3eeSRoland Mainz 	"[+0?The execution was successfully suspended for at least \aduration\a "
154434f9b3eeSRoland Mainz 	"or a \bSIGALRM\b signal was received.]"
1545da2e3ebdSchin 	"[+>0?An error occurred.]"
1546da2e3ebdSchin "}"
154734f9b3eeSRoland Mainz "[+SEE ALSO?\bdate\b(1), \btime\b(1), \bwait\b(1)]"
1548da2e3ebdSchin ;
1549da2e3ebdSchin 
1550da2e3ebdSchin const char sh_opttrap[] =
1551da2e3ebdSchin "[-1c?\n@(#)$Id: trap (AT&T Research) 1999-07-17 $\n]"
1552da2e3ebdSchin USAGE_LICENSE
1553da2e3ebdSchin "[+NAME?trap - trap signals and conditions]"
1554da2e3ebdSchin "[+DESCRIPTION?\btrap\b is a special built-in that defines actions to be "
1555da2e3ebdSchin 	"taken when conditions such as receiving a signal occur.  Also, "
1556da2e3ebdSchin 	"\btrap\b can be used to display the current trap settings on "
1557da2e3ebdSchin 	"standard output.]"
1558da2e3ebdSchin "[+?If \aaction\a is \b-\b, \btrap\b resets each \acondition\a "
1559da2e3ebdSchin 	"to the default value.  If \aaction\a is an empty string, the "
1560da2e3ebdSchin 	"shell ignores each of the \acondition\as if they arise. "
1561da2e3ebdSchin 	"Otherwise, the argument \aaction\a will be read and executed "
1562da2e3ebdSchin 	"by the shell as if it were processed by \beval\b(1) when one "
1563da2e3ebdSchin 	"of the corresponding conditions arise.  The action of the trap "
1564da2e3ebdSchin 	"will override any previous action associated with each specified "
1565da2e3ebdSchin 	"\acondition\a.  The value of \b$?\b is not altered by the trap "
1566da2e3ebdSchin 	"execution.]"
1567da2e3ebdSchin "[+?\acondition\a can be the name or number of a signal, or one of the "
1568da2e3ebdSchin 	"following:]{"
1569da2e3ebdSchin 	"[+EXIT?This trap is executed when the shell exits.  If defined "
1570da2e3ebdSchin 		"within a function defined with the \bfunction\b reserved "
1571da2e3ebdSchin 		"word, the trap is executed in the caller's environment "
1572da2e3ebdSchin 		"when the function returns and the trap action is restored "
1573da2e3ebdSchin 		"to the value it had when it called the function.]"
1574da2e3ebdSchin 	"[+0?Same as EXIT.]"
1575da2e3ebdSchin 	"[+DEBUG?Executed before each simple command is executed but after "
1576da2e3ebdSchin 		"the arguments are expanded.]"
1577da2e3ebdSchin 	"[+ERR?Executed whenever \bset -e\b would cause the shell to exit.]"
1578da2e3ebdSchin 	"[+KEYBD?Executed when a key is entered from a terminal device.]"
1579da2e3ebdSchin "}"
1580da2e3ebdSchin "[+?Signal names are case insensitive and the \bsig\b prefix is optional.  "
1581da2e3ebdSchin 	"Signals that were ignored on entry to a noninteractive shell cannot "
1582da2e3ebdSchin 	"trapped or reset although doing so will not report an error.  The "
1583da2e3ebdSchin 	"use of signal numbers other than \b1\b, \b2\b, \b3\b, \b6\b, "
1584da2e3ebdSchin 	"\b9\b, \b14\b, and \b15\b is not portable.]"
1585da2e3ebdSchin "[+?Although \btrap\b is a special built-in, specifying a condition that "
1586da2e3ebdSchin 	"the shell does not know about causes \btrap\b to exit with a "
1587