xref: /onnv-gate/usr/src/lib/libshell/common/data/builtins.c (revision 12068:08a39a083754)
14887Schin /***********************************************************************
24887Schin *                                                                      *
34887Schin *               This software is part of the ast package               *
4*12068SRoger.Faulkner@Oracle.COM *          Copyright (c) 1982-2010 AT&T Intellectual Property          *
54887Schin *                      and is licensed under the                       *
64887Schin *                  Common Public License, Version 1.0                  *
78462SApril.Chin@Sun.COM *                    by AT&T Intellectual Property                     *
84887Schin *                                                                      *
94887Schin *                A copy of the License is available at                 *
104887Schin *            http://www.opensource.org/licenses/cpl1.0.txt             *
114887Schin *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
124887Schin *                                                                      *
134887Schin *              Information and Software Systems Research               *
144887Schin *                            AT&T Research                             *
154887Schin *                           Florham Park NJ                            *
164887Schin *                                                                      *
174887Schin *                  David Korn <dgk@research.att.com>                   *
184887Schin *                                                                      *
194887Schin ***********************************************************************/
204887Schin #pragma prototyped
214887Schin 
224887Schin #include	<shell.h>
234887Schin #include	<signal.h>
244887Schin #include	"defs.h"
254887Schin #include	"shtable.h"
264887Schin #include	"ulimit.h"
274887Schin #include	"name.h"
284887Schin #include	"version.h"
294887Schin #if KSHELL
304887Schin #   include	"builtins.h"
314887Schin #   include	"jobs.h"
324887Schin #   include	"FEATURE/cmds"
334887Schin #   define	bltin(x)	(b_##x)
344887Schin     /* The following is for builtins that do not accept -- options */
354887Schin #   define	Bltin(x)	(B_##x)
364887Schin #else
374887Schin #   define bltin(x)	0
384887Schin #endif
394887Schin 
404887Schin #if defined(SHOPT_CMDLIB_DIR) && !defined(SHOPT_CMDLIB_HDR)
414887Schin #	define SHOPT_CMDLIB_HDR	<cmdlist.h>
424887Schin #endif
434887Schin #define Q(f)		#f	/* libpp cpp workaround -- fixed 2005-04-11 */
448462SApril.Chin@Sun.COM #define CMDLIST(f)	SH_CMDLIB_DIR "/" Q(f), NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f),
454887Schin 
464887Schin #undef	basename
474887Schin #undef	dirname
484887Schin 
494887Schin /*
504887Schin  * The order up through "[" is significant
514887Schin  */
524887Schin const struct shtable3 shtab_builtins[] =
534887Schin {
544887Schin 	"login",	NV_BLTIN|BLT_ENV|BLT_SPC,	Bltin(login),
554887Schin 	"exec",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(exec),
564887Schin 	"set",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(set),
574887Schin 	":",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(true),
584887Schin 	"true",		NV_BLTIN|BLT_ENV,		bltin(true),
594887Schin 	"command",	NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(command),
604887Schin 	"cd",		NV_BLTIN|BLT_ENV,		bltin(cd),
614887Schin 	"break",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(break),
624887Schin 	"continue",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(break),
634887Schin 	"typeset",	NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(typeset),
648462SApril.Chin@Sun.COM 	"test",		NV_BLTIN|BLT_ENV,		bltin(test),
654887Schin 	"[",		NV_BLTIN|BLT_ENV,		bltin(test),
664887Schin 	"let",		NV_BLTIN|BLT_ENV,		bltin(let),
678462SApril.Chin@Sun.COM 	"export",	NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(readonly),
688462SApril.Chin@Sun.COM 	".",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(dot_cmd),
698462SApril.Chin@Sun.COM 	"return",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(return),
704887Schin #if SHOPT_BASH
714887Schin 	"local",	NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(typeset),
724887Schin #endif
734887Schin #if _bin_newgrp || _usr_bin_newgrp
744887Schin 	"newgrp",	NV_BLTIN|BLT_ENV|BLT_SPC,	Bltin(login),
754887Schin #endif	/* _bin_newgrp || _usr_bin_newgrp */
764887Schin 	"alias",	NV_BLTIN|BLT_SPC|BLT_DCL,	bltin(alias),
774887Schin 	"hash",		NV_BLTIN|BLT_SPC|BLT_DCL,	bltin(alias),
788462SApril.Chin@Sun.COM 	"enum",		NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(enum),
798462SApril.Chin@Sun.COM 	"eval",		NV_BLTIN|BLT_ENV|BLT_SPC|BLT_EXIT,bltin(eval),
804887Schin 	"exit",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(return),
814887Schin 	"fc",		NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(hist),
824887Schin 	"hist",		NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(hist),
834887Schin 	"readonly",	NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(readonly),
844887Schin 	"shift",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(shift),
854887Schin 	"trap",		NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(trap),
864887Schin 	"unalias",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(unalias),
874887Schin 	"unset",	NV_BLTIN|BLT_ENV|BLT_SPC,	bltin(unset),
884887Schin 	"builtin",	NV_BLTIN,			bltin(builtin),
894887Schin #if SHOPT_ECHOPRINT
904887Schin 	"echo",		NV_BLTIN|BLT_ENV,		bltin(print),
914887Schin #else
924887Schin 	"echo",		NV_BLTIN|BLT_ENV,		Bltin(echo),
934887Schin #endif /* SHOPT_ECHOPRINT */
944887Schin #ifdef JOBS
954887Schin #   ifdef SIGTSTP
964887Schin 	"bg",		NV_BLTIN|BLT_ENV,		bltin(bg),
974887Schin 	"fg",		NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(bg),
984887Schin 	"disown",	NV_BLTIN|BLT_ENV,		bltin(bg),
998462SApril.Chin@Sun.COM 	"kill",		NV_BLTIN|BLT_ENV,		bltin(kill),
1004887Schin #   else
1018462SApril.Chin@Sun.COM 	"/bin/kill",	NV_BLTIN|BLT_ENV,		bltin(kill),
1024887Schin #   endif	/* SIGTSTP */
1034887Schin 	"jobs",		NV_BLTIN|BLT_ENV,		bltin(jobs),
1044887Schin #endif	/* JOBS */
1054887Schin 	"false",	NV_BLTIN|BLT_ENV,		bltin(false),
1064887Schin 	"getopts",	NV_BLTIN|BLT_ENV,		bltin(getopts),
1074887Schin 	"print",	NV_BLTIN|BLT_ENV,		bltin(print),
1088462SApril.Chin@Sun.COM 	"printf",	NV_BLTIN|BLT_ENV,		bltin(printf),
1098462SApril.Chin@Sun.COM 	"pwd",		NV_BLTIN,			bltin(pwd),
1104887Schin 	"read",		NV_BLTIN|BLT_ENV,		bltin(read),
1118462SApril.Chin@Sun.COM 	"sleep",	NV_BLTIN,			bltin(sleep),
1124887Schin 	"alarm",	NV_BLTIN,			bltin(alarm),
1134887Schin 	"ulimit",	NV_BLTIN|BLT_ENV,		bltin(ulimit),
1144887Schin 	"umask",	NV_BLTIN|BLT_ENV,		bltin(umask),
1154887Schin #ifdef _cmd_universe
1164887Schin 	"universe",	NV_BLTIN|BLT_ENV,		bltin(universe),
1174887Schin #endif /* _cmd_universe */
1184887Schin #if SHOPT_FS_3D
1194887Schin 	"vpath",	NV_BLTIN|BLT_ENV,		bltin(vpath),
1204887Schin 	"vmap",		NV_BLTIN|BLT_ENV,		bltin(vpath),
1214887Schin #endif /* SHOPT_FS_3D */
1224887Schin 	"wait",		NV_BLTIN|BLT_ENV|BLT_EXIT,	bltin(wait),
1234887Schin 	"type",		NV_BLTIN|BLT_ENV,		bltin(whence),
1244887Schin 	"whence",	NV_BLTIN|BLT_ENV,		bltin(whence),
1254887Schin #ifdef SHOPT_CMDLIB_HDR
1264887Schin #include SHOPT_CMDLIB_HDR
1274887Schin #else
1284887Schin 	CMDLIST(basename)
1294887Schin 	CMDLIST(chmod)
1304887Schin 	CMDLIST(dirname)
1318462SApril.Chin@Sun.COM 	CMDLIST(getconf)
1324887Schin 	CMDLIST(head)
1334887Schin 	CMDLIST(mkdir)
1344887Schin 	CMDLIST(logname)
1354887Schin 	CMDLIST(cat)
1364887Schin 	CMDLIST(cmp)
1374887Schin 	CMDLIST(cut)
1384887Schin 	CMDLIST(uname)
1394887Schin 	CMDLIST(wc)
1404887Schin 	CMDLIST(sync)
1414887Schin #endif
14210898Sroland.mainz@nrubsig.org #if SHOPT_REGRESS
14310898Sroland.mainz@nrubsig.org 	"__regress__",		NV_BLTIN|BLT_ENV,	bltin(__regress__),
14410898Sroland.mainz@nrubsig.org #endif
1454887Schin 	"",		0, 0
1464887Schin };
1474887Schin 
1484887Schin 
1494887Schin const char sh_set[] =
1504887Schin "[a?Set the export attribute for each variable whose name does not "
1514887Schin 	"contain a \b.\b that you assign a value in the current shell "
1524887Schin 	"environment.]"
1534887Schin "[b?The shell writes a message to standard error as soon it detects that "
1544887Schin 	"a background job completes rather than waiting until the next prompt.]"
1554887Schin "[e?A simple command that has an non-zero exit status will cause the shell "
1564887Schin 	"to exit unless the simple command is:]{"
1574887Schin 	"[++?contained in an \b&&\b or \b||\b list.]"
1584887Schin 	"[++?the command immediately following \bif\b, \bwhile\b, or \buntil\b.]"
1594887Schin 	"[++?contained in the pipeline following \b!\b.]"
1604887Schin "}"
1614887Schin "[f?Pathname expansion is disabled.]"
1624887Schin "[h?Obsolete.  Causes each command whose name has the syntax of an "
1638462SApril.Chin@Sun.COM 	"alias to become a tracked alias when it is first encountered.]"
1644887Schin "[k?This is obsolete.  All arguments of the form \aname\a\b=\b\avalue\a "
1654887Schin 	"are removed and placed in the variable assignment list for "
1664887Schin 	"the command.  Ordinarily, variable assignments must precede "
1674887Schin 	"command arguments.]"
1684887Schin "[m?When enabled, the shell runs background jobs in a separate process "
1694887Schin 	"group and displays a line upon completion.  This mode is enabled "
1704887Schin 	"by default for interactive shells on systems that support job "
1714887Schin 	"control.]"
1724887Schin "[n?The shell reads commands and checks for syntax errors, but does "
1734887Schin 	"not execute the command.  Usually specified on command invocation.]"
1744887Schin "[o]:?[option?If \aoption\a is not specified, the list of options and "
1754887Schin 	"their current settings will be written to standard output.  When "
1764887Schin 	"invoked with a \b+\b the options will be written in a format "
1774887Schin 	"that can be reinput to the shell to restore the settings. "
1784887Schin 	"This option can be repeated to enable/disable multiple options. "
1794887Schin 	"The value of \aoption\a must be one of the following:]{"
1804887Schin 		"[+allexport?Equivalent to \b-a\b.]"
1814887Schin 		"[+bgnice?Runs background jobs at lower priorities.]"
1824887Schin 		"[+braceexpand?Equivalent to \b-B\b.] "
1834887Schin 		"[+emacs?Enables/disables \bemacs\b editing mode.]"
1844887Schin 		"[+errexit?Equivalent to \b-e\b.]"
1854887Schin 		"[+globstar?Equivalent to \b-G\b.]"
1864887Schin 		"[+gmacs?Enables/disables \bgmacs\b editing mode.  \bgmacs\b "
1874887Schin 			"editing mode is the same as \bemacs\b editing mode "
1884887Schin 			"except for the handling of \b^T\b.]"
1894887Schin #if SHOPT_BASH
1904887Schin 		"[+hashall?Equivalent to \b-h\b and \b-o trackall\b. Available "
1914887Schin 		"in bash compatibility mode only.]"
1924887Schin 		"[+history?Enable command history. Available in bash "
1934887Schin 		"compatibility mode only. On by default in interactive "
1944887Schin 		"shells.]"
1954887Schin #endif
1964887Schin #if SHOPT_HISTEXPAND
1974887Schin 		"[+histexpand?Equivalent to \b-H\b.]"
1984887Schin #endif
1994887Schin 		"[+ignoreeof?Prevents an interactive shell from exiting on "
2004887Schin 			"reading an end-of-file.]"
2014887Schin 		"[+keyword?Equivalent to \b-k\b.]"
2024887Schin 		"[+markdirs?A trailing \b/\b is appended to directories "
2034887Schin 			"resulting from pathname expansion.]"
2044887Schin 		"[+monitor?Equivalent to \b-m\b.]"
2054887Schin 		"[+multiline?Use multiple lines when editing lines that are "
2064887Schin 			"longer than the window width.]"
2074887Schin 		"[+noclobber?Equivalent to \b-C\b.]"
2084887Schin 		"[+noexec?Equivalent to \b-n\b.]"
2094887Schin 		"[+noglob?Equivalent to \b-f\b.]"
2104887Schin 		"[+nolog?This has no effect.  It is provided for backward "
2114887Schin 			"compatibility.]"
2124887Schin 		"[+notify?Equivalent to \b-b\b.]"
2134887Schin 		"[+nounset?Equivalent to \b-u\b.]"
2144887Schin #if SHOPT_BASH
2154887Schin 		"[+onecmd?Equivalent to \b-t\b. Available in bash compatibility "
2164887Schin 		"mode only.]"
2174887Schin 		"[+physical?Equivalent to \b-P\b. Available in bash "
2184887Schin 		"compatibility mode only.]"
2194887Schin 		"[+posix?Turn on POSIX compatibility. Available in bash "
2204887Schin 		"compatibility mode only. Bash in POSIX mode is not the "
2214887Schin 		"same as ksh.]"
2224887Schin #endif
2234887Schin 		"[+pipefail?A pipeline will not complete until all components "
2244887Schin 			"of the pipeline have completed, and the exit status "
2254887Schin 			"of the pipeline will be the value of the last "
2264887Schin 			"command to exit with non-zero exit status, or will "
2274887Schin 			"be zero if all commands return zero exit status.]"
2284887Schin 		"[+privileged?Equivalent to \b-p\b.]"
2294887Schin 		"[+showme?Simple commands preceded by a \b;\b will be traced "
2304887Schin 			"as if \b-x\b were enabled but not executed.]"
2314887Schin 		"[+trackall?Equivalent to \b-h\b.]"
2324887Schin 		"[+verbose?Equivalent to \b-v\b.]"
2334887Schin 		"[+vi?Enables/disables \bvi\b editing mode.]"
2344887Schin 		"[+viraw?Does not use canonical input mode when using \bvi\b "
2354887Schin 			"edit mode.]"
2364887Schin 		"[+xtrace?Equivalent to \b-x\b.]"
2374887Schin "}"
2384887Schin "[p?Privileged mode.  Disabling \b-p\b sets the effective user id to the "
2394887Schin 	"real user id, and the effective group id to the real group id.  "
2404887Schin 	"Enabling \b-p\b restores the effective user and group ids to their "
2414887Schin 	"values when the shell was invoked.  The \b-p\b option is on "
2424887Schin 	"whenever the real and effective user id is not equal or the "
2434887Schin 	"real and effective group id is not equal.  User profiles are "
2444887Schin 	"not processed when \b-p\b is enabled.]"
2454887Schin "[r?restricted.  Enables restricted shell.  This option cannot be unset once "
2464887Schin 	"enabled.]"
2474887Schin "[t?Obsolete.  The shell reads one command and then exits.]"
2484887Schin "[u?If enabled, the shell displays an error message when it tries to expand "
2494887Schin 	"a variable that is unset.]"
2504887Schin "[v?Verbose.  The shell displays its input onto standard error as it "
2514887Schin 	"reads it.]"
2524887Schin "[x?Execution trace.  The shell will display each command after all "
2534887Schin 	"expansion and before execution preceded by the expanded value "
2544887Schin 	"of the \bPS4\b parameter.]"
2554887Schin #if SHOPT_BASH
2564887Schin 	"\fbash1\f"
2574887Schin #endif
2584887Schin #if SHOPT_BRACEPAT
2594887Schin "[B?Enable {...} group expansion. On by default.]"
2604887Schin #endif
2614887Schin "[C?Prevents existing regular files from being overwritten using the \b>\b "
2624887Schin 	"redirection operator.  The \b>|\b redirection overrides this "
2634887Schin 	"\bnoclobber\b option.]"
2644887Schin "[G?Causes \b**\b by itself to also match all sub-directories during pathname "
2654887Schin 	"expansion.]"
2664887Schin #if SHOPT_HISTEXPAND
2674887Schin    "[H?Enable \b!\b-style history expansion similar to \bcsh\b.]"
2684887Schin #endif
2694887Schin ;
2704887Schin 
2714887Schin const char sh_optbreak[] =
2724887Schin "[-1c?\n@(#)$Id: break (AT&T Research) 1999-04-07 $\n]"
2734887Schin USAGE_LICENSE
2744887Schin "[+NAME?break - break out of loop ]"
2754887Schin "[+DESCRIPTION?\bbreak\b is a shell special built-in that exits the "
2764887Schin 	"smallest enclosing \bfor\b, \bselect\b, \bwhile\b, or \buntil\b loop, "
2774887Schin 	"or the \an\a-th enclosing loop if \an\a is specified.  "
2784887Schin 	"Execution continues at the command following the loop(s).]"
2794887Schin "[+?If \an\a is given, it must be a positive integer >= 1. If \an\a "
2804887Schin 	"is larger than the number of enclosing loops, the last enclosing "
2814887Schin 	"loop will be exited.]"
2824887Schin "\n"
2834887Schin "\n[n]\n"
2844887Schin "\n"
2854887Schin "[+EXIT STATUS?0]"
2864887Schin "[+SEE ALSO?\bcontinue\b(1), \breturn\b(1)]"
2874887Schin ;
2884887Schin 
2894887Schin const char sh_optcont[] =
2904887Schin "[-1c?\n@(#)$Id: continue (AT&T Research) 1999-04-07 $\n]"
2914887Schin USAGE_LICENSE
2924887Schin "[+NAME?continue - continue execution at top of the loop]"
2934887Schin "[+DESCRIPTION?\bcontinue\b is a shell special built-in that continues "
2944887Schin 	"execution at the top of smallest enclosing enclosing \bfor\b, "
2954887Schin 	"\bselect\b, \bwhile\b, or \buntil\b loop, if any; or the top of "
2964887Schin 	"the \an\a-th enclosing loop if \an\a is specified.]"
2974887Schin "[+?If \an\a is given, it must be a positive integer >= 1. If \an\a "
2984887Schin 	"is larger than the number of enclosing loops, the last enclosing "
2994887Schin 	" loop will be used.]"
3004887Schin 
3014887Schin "\n"
3024887Schin "\n[n]\n"
3034887Schin "\n"
3044887Schin "[+SEE ALSO?\bbreak\b(1)]"
3054887Schin ;
3064887Schin 
3074887Schin const char sh_optalarm[]	= "r [varname seconds]";
3084887Schin const char sh_optalias[] =
3094887Schin "[-1c?\n@(#)$Id: alias (AT&T Research) 1999-07-07 $\n]"
3104887Schin USAGE_LICENSE
3114887Schin "[+NAME?alias - define or display aliases]"
3124887Schin "[+DESCRIPTION?\balias\b creates or redefines alias definitions "
3134887Schin 	"or writes the existing alias definitions to standard output.  "
3144887Schin 	"An alias definitions provides a string value that will replace "
3154887Schin 	"a command name when the command is read.  Alias names can "
3164887Schin 	"contain any printable character which is not special to the shell.  "
3174887Schin 	"If an alias value ends in a space or tab, then the word "
3184887Schin 	"following the command name the alias replaces is also checked "
3194887Schin 	"to see whether it is an alias.]"
3204887Schin "[+?If no \aname\as are specified then the names and values of all "
3214887Schin 	"aliases are written to standard output.  Otherwise, for "
3224887Schin 	"each \aname\a that is specified, and \b=\b\avalue\a  is not "
3234887Schin 	"specified, the current value of the alias corresponding to "
3244887Schin 	"\aname\a is written to standard output.  If \b=\b\avalue\a is "
3254887Schin 	"specified, the alias \aname\a will be created or redefined.]"
3264887Schin "[+?\balias\b is built-in to the shell as a declaration command so that "
3274887Schin 	"field splitting and pathname expansion are not performed on "
3284887Schin 	"the arguments.  Tilde expansion occurs on \avalue\a.  An alias "
3294887Schin 	"definition only affects scripts read by the current shell "
3304887Schin 	"environment.  It does not effect scripts run by this shell.]"
3314887Schin "[p?Causes the output to be in the form of alias commands that can be used "
3324887Schin 	"as input to the shell to recreate the current aliases.]"
3334887Schin "[t?Used for tracked aliases.  These are aliases that connect a "
3344887Schin 	"command name to the pathname of the command and are reset "
3354887Schin 	"when the \bPATH\b variable is unset.  The tracked aliases feature is "
3364887Schin 	"now obsolete.]"
3374887Schin "[x?Ignored, this option is obsolete.]"
3384887Schin "\n"
3394887Schin "\n[name[=value]...]\n"
3404887Schin "\n"
3414887Schin "[+EXIT STATUS?]{"
3424887Schin         "[+0?Successful completion.]"
3434887Schin         "[+>0?One or more \aname\a operands did not have an alias "
3444887Schin 		"definition, or an error occurred.]"
3454887Schin "}"
3464887Schin 
3474887Schin "[+SEE ALSO?\bsh\b(1), \bunalias\b(1)]"
3484887Schin ;
3494887Schin 
3504887Schin const char sh_optbuiltin[] =
3514887Schin "[-1c?\n@(#)$Id: builtin (AT&T Research) 1999-07-10 $\n]"
3524887Schin USAGE_LICENSE
3534887Schin "[+NAME?builtin - add, delete, or display shell built-ins]"
3544887Schin "[+DESCRIPTION?\bbuiltin\b can be used to add, delete, or display "
3554887Schin     "built-in commands in the current shell environment. A built-in command "
3564887Schin     "executes in the current shell process and can have side effects in the "
3574887Schin     "current shell. On most systems, the invocation time for built-in "
3584887Schin     "commands is one or two orders of magnitude less than commands that "
3594887Schin     "create a separate process.]"
3604887Schin "[+?For each \apathname\a specified, the basename of the pathname "
3614887Schin     "determines the name of the built-in. For each basename, the shell looks "
3624887Schin     "for a C level function in the current shell whose name is determined by "
3634887Schin     "prepending \bb_\b to the built-in name. If \apathname\a contains a "
3644887Schin     "\b/\b, then the built-in is bound to this pathname. A built-in bound to "
3654887Schin     "a pathname will only be executed if \apathname\a is the first "
3664887Schin     "executable found during a path search. Otherwise, built-ins are found "
3674887Schin     "prior to performing the path search.]"
3684887Schin "[+?If no \apathname\a operands are specified, then \bbuiltin\b displays "
3694887Schin     "the current list of built-ins, or just the special built-ins if \b-s\b "
3704887Schin     "is specified, on standard output. The full pathname for built-ins that "
3714887Schin     "are bound to pathnames are displayed.]"
3724887Schin "[+?Libraries containing built-ins can be specified with the \b-f\b "
3734887Schin     "option. If the library contains a function named \blib_init\b(), this "
3744887Schin     "function will be invoked with argument \b0\b when the library is "
3754887Schin     "loaded. The \blib_init\b() function can load built-ins by invoking an "
3764887Schin     "appropriate C level function. In this case there is no restriction on "
3774887Schin     "the C level function name.]"
3784887Schin "[+?The C level function will be invoked with three arguments. The first "
3794887Schin     "two are the same as \bmain\b() and the third one is a pointer.]"
3804887Schin "[+?\bbuiltin\b cannot be invoked from a restricted shell.]"
3814887Schin "[d?Deletes each of the specified built-ins. Special built-ins cannot be "
3824887Schin     "deleted.]"
3834887Schin "[f]:[lib?On systems with dynamic linking, \alib\a names a shared "
3844887Schin     "library to load and search for built-ins. Libraries are search for in "
3854887Schin     "\b$PATH\b and system dependent library directories. The system "
3864887Schin     "dependent shared library prefix and/or suffix may be omitted. Once a "
3874887Schin     "library is loaded, its symbols become available for the current and "
3884887Schin     "subsequent invocations of \bbuiltin\b. Multiple libraries can be "
3894887Schin     "specified with separate invocations of \bbuiltin\b. Libraries are "
3904887Schin     "searched in the reverse order in which they are specified.]"
3914887Schin "[s?Display only the special built-ins.]"
3924887Schin "\n"
3934887Schin "\n[pathname ...]\n"
3944887Schin "\n"
3954887Schin "[+EXIT STATUS?]{"
3964887Schin 	"[+0?All \apathname\a operands and \b-f\b options processed "
3974887Schin 	"successfully.]"
3984887Schin 	"[+>0?An error occurred.]"
3994887Schin "}"
4004887Schin "[+SEE ALSO?\bwhence\b(1)]"
4014887Schin ;
4024887Schin 
4034887Schin const char sh_optcd[] =
4044887Schin "[-1c?\n@(#)$Id: cd (AT&T Research) 1999-06-05 $\n]"
4054887Schin USAGE_LICENSE
4064887Schin "[+NAME?cd - change working directory ]"
4074887Schin "[+DESCRIPTION?\bcd\b changes the current working directory of the "
4084887Schin 	"current shell environment.]"
4094887Schin "[+?In the first form with one operand, if \adirectory\a begins with "
4104887Schin 	"\b/\b, or if the first component is \b.\b or \b..\b, the "
4114887Schin 	"directory will be changed to this directory.  If directory is \b-\b, "
4124887Schin 	"the directory will be changed to the last directory visited.  "
4134887Schin 	"Otherwise, if the \bCDPATH\b environment variable is set, \bcd\b "
4144887Schin 	"searches for \adirectory\a relative to each directory named in "
4154887Schin 	"the colon separated list of directories defined by \bCDPATH\b.  "
4164887Schin 	"If \bCDPATH\b not set, \bcd\b changes to the directory specified "
4174887Schin 	"by \adirectory\a.]"
4184887Schin "[+?In the second form, the first occurrence of the string \aold\a "
4194887Schin 	"contained in the pathname of the present working directory "
4204887Schin 	"is replaced by the string \anew\a and the resulting string "
4214887Schin 	"is used as the directory to which to change.]"
4224887Schin "[+?When invoked without operands and when the \bHOME\b environment "
4234887Schin 	"variable is set to a nonempty value,  the directory named by "
4244887Schin 	"the \bHOME\b environment variable will be used.  If \bHOME\b "
4254887Schin 	"is empty or unset, \bcd\b will fail.]"
4264887Schin "[+?When \bcd\b is successful, the \bPWD\b environment variable will be set "
4274887Schin 	"to the name of an absolute pathname that does not contain any "
4284887Schin 	"\b..\b components corresponding to the new directory.  The "
4294887Schin 	"environment variable \bOLDPWD\b will be set to the previous "
4304887Schin 	"value of \bPWD\b.  If the new directory is found by searching "
4314887Schin 	"the directories named by \bCDPATH\b, or if \adirectory\a is \b-\b, "
4324887Schin 	"or if the two operand form is used, the new value of \bPWD\b will be "
4334887Schin 	"written to standard output.]"
4344887Schin "[+?If both \b-L\b and \b-P\b are specified, the last one specified will "
4354887Schin 	"be used.  If neither \b-P\b or \b-L\b is specified then the "
4364887Schin 	"behavior will be determined by the \bgetconf\b parameter "
4374887Schin 	"\bPATH_RESOLVE\b.  If \bPATH_RESOLVE\b is \bphysical\b, "
4384887Schin 	"then the behavior will be as if \b-P\b were specified.  Otherwise, "
4394887Schin 	"the behavior will be as if  \b-L\b were specified.]"
4404887Schin "[L?Handle each pathname component \b..\b in a logical fashion by moving "
4414887Schin 	"up one level by name in the present working directory.]"
4424887Schin "[P?The present working directory is first converted to an absolute pathname "
4434887Schin 	"that does not contain symbolic link components and symbolic name "
4444887Schin 	"components are expanded in the resulting directory name.]"
4454887Schin "\n"
4464887Schin "\n[directory]\n"
4474887Schin "old new\n"
4484887Schin "\n"
4494887Schin "[+EXIT STATUS?]{"
4504887Schin 	"[+0?Directory successfully changed.]"
4514887Schin 	"[+>0?An error occurred.]"
4524887Schin "}"
4534887Schin "[+SEE ALSO?\bpwd\b(1), \bgetconf\b(1)]"
4544887Schin ;
4554887Schin 
4564887Schin const char sh_optcommand[] =
4574887Schin "[-1c?\n@(#)$Id: command (AT&T Research) 2003-08-01 $\n]"
4584887Schin USAGE_LICENSE
4594887Schin "[+NAME?command - execute a simple command]"
4604887Schin "[+DESCRIPTION?Without \b-v\b or \b-V\b,  \bcommand\b executes \acommand\a "
4614887Schin 	"with arguments given by \aarg\a, suppressing the shell function lookup "
4624887Schin 	"that normally occurs.  In addition, if \acommand\a is a special "
4634887Schin 	"built-in command, then the special properties are removed so that "
4644887Schin 	"failures will not cause the script that executes it to terminate.]"
4654887Schin "[+?With the \b-v\b or \b-V\b options, \bcommand\b is equivalent to the "
4664887Schin 	"\bwhence\b(1) command.]"
4674887Schin "[p?Causes a default path to be searched rather than the one defined by the "
4684887Schin 	"value of \bPATH\b.]"
4694887Schin "[v?Equivalent to \bwhence\b \acommand\a [\aarg\a ...]].]"
4704887Schin "[x?If \acommand\a fails because there are too many \aarg\as, it will be "
4714887Schin 	"invoked multiple times with a subset of the arguments on each "
4724887Schin 	"invocation.  Arguments that occur prior to the first word that expand "
4734887Schin 	"to multiple arguments and arguments that occur after the last word "
4744887Schin 	"that expands to multiple arguments will be passed on each invocation. "
4754887Schin 	"The exit status will be the maximum invocation exit status.]"
4764887Schin "[V?Equivalent to \bwhence \b-v\b \acommand\a [\aarg\a ...]].]"
4774887Schin "\n"
4784887Schin "\n[command [arg ...]]\n"
4794887Schin "\n"
4804887Schin "[+EXIT STATUS?If \acommand\a is invoked, the exit status of \bcommand\b "
4814887Schin 	"will be that of \acommand\a.  Otherwise, it will be one of "
4824887Schin 	"the following:]{"
4834887Schin 	"[+0?\bcommand\b completed successfully.]"
4844887Schin 	"[+>0?\b-v\b or \b-V\b has been specified and an error occurred.]"
4854887Schin 	"[+126?\acommand\a was found but could not be invoked.]"
4864887Schin 	"[+127?\acommand\a could not be found.]"
4874887Schin "}"
4884887Schin 
4894887Schin "[+SEE ALSO?\bwhence\b(1), \bgetconf\b(1)]"
4904887Schin ;
4914887Schin 
4924887Schin const char sh_optdot[]	 =
4934887Schin "[-1c?@(#)$Id: \b.\b (AT&T Research) 2000-04-02 $\n]"
4944887Schin USAGE_LICENSE
4954887Schin "[+NAME?\b.\b - execute commands in the current environment]"
4964887Schin "[+DESCRIPTION?\b.\b is a special built-in command that executes commands "
4974887Schin 	"from a function or a file in the current environment.]"
4984887Schin "[+?If \aname\a refers to a function defined with the \bfunction\b \aname\a "
4994887Schin 	"syntax, the function executes in the current environment as "
5004887Schin 	"if it had been defined with the \aname\a\b()\b syntax so that "
5014887Schin 	"there is no scoping.  Otherwise, commands from the file defined "
5024887Schin 	"by \aname\a are executed in the current environment.  Note that "
5034887Schin 	"the complete script is read before it begins to execute so that "
5044887Schin 	"any aliases defined in this script will not take effect until "
5054887Schin 	"the script completes execution.]"
5064887Schin "[+?When \aname\a refers to a file, the \bPATH\b variable is searched "
5074887Schin 	"for the file containing commands.  In this case execute permission "
5084887Schin 	"is not required for \aname\a.]"
5094887Schin "[+?If any \aarg\as are specified, these become the positional parameters "
5104887Schin 	"for the duration of the function or script and are restored "
5114887Schin 	"upon completion.]"
5124887Schin "\n"
5134887Schin "\n name [arg ...]\n"
5144887Schin "\n"
5154887Schin "[+EXIT STATUS?If \aname\a is found, then the exit status is that "
5164887Schin 	"of the last command executed.  Otherwise, since this is a special "
5174887Schin 	"built-in, an error will cause a non-interactive shell to exit with "
5184887Schin 	"a non-zero exit status.  An interactive shell returns a non-zero exit "
5194887Schin 	"status to indicate an error.]"
5204887Schin 
5214887Schin "[+SEE ALSO?\bcommand\b(1), \bksh\b(1)]"
5224887Schin ;
5234887Schin 
5244887Schin #ifndef ECHOPRINT
5254887Schin     const char sh_optecho[]	= " [-n] [arg...]";
5264887Schin #endif /* !ECHOPRINT */
5274887Schin 
5284887Schin const char sh_opteval[] =
5294887Schin "[-1c?\n@(#)$Id: eval (AT&T Research) 1999-07-07 $\n]"
5304887Schin USAGE_LICENSE
5314887Schin "[+NAME?eval - create a shell command and process it]"
5324887Schin "[+DESCRIPTION?\beval\b is a shell special built-in command that constructs "
5334887Schin 	"a command by concatenating the \aarg\as together, separating each "
5344887Schin 	"with a space.  The resulting string is then taken as input to "
5354887Schin 	"the shell and evaluated in the current environment.  Note that "
5364887Schin 	"command words are expanded twice; once to construct \aarg\a, and "
5374887Schin 	"again when the shell executes the constructed command.]"
5384887Schin "[+?It is not an error if \aarg\a is not given.]"
5394887Schin "\n"
5404887Schin "\n[arg...]\n"
5414887Schin "\n"
5424887Schin "[+EXIT STATUS?If \aarg\a is not specified, the exit status is \b0\b.  "
5434887Schin 	"Otherwise, it is the exit status of the command defined by the "
5444887Schin 	"\aarg\a operands.]"
5454887Schin "[+SEE ALSO?\bexec\b(1), \btrap\b(1), \b.\b(1)]"
5464887Schin ;
5474887Schin 
5484887Schin const char sh_optexec[] =
5494887Schin "[-1c?\n@(#)$Id: exec (AT&T Research) 1999-07-10 $\n]"
5504887Schin USAGE_LICENSE
5514887Schin "[+NAME?exec - execute command, open/close and duplicate file descriptors]"
5524887Schin "[+DESCRIPTION?\bexec\b is a special built-in command that can be used to "
5534887Schin 	"manipulate file descriptors or to replace the current shell "
5544887Schin 	"with a new command.]"
5554887Schin "[+?If \acommand\a is specified, then the current shell process will be "
5564887Schin 	"replaced by \acommand\a rather than running \acommand\a and waiting "
5574887Schin 	"for it to complete.  Note that there is no need to use "
5584887Schin 	"\bexec\b to enhance performance since the shell implicitly "
5594887Schin 	"uses the exec mechanism internally whenever possible.]"
5604887Schin "[+?If no operands are specified, \bexec\b can be used to open or "
5614887Schin 	"close files, or to manipulate file descriptors from \b0\b to "
5624887Schin 	"\b9\b in the current shell environment using the standard "
5634887Schin 	"redirection mechanism available with all commands.  The "
5644887Schin 	"close-on-exec flags will be set on file descriptor numbers "
5654887Schin 	"greater than \b2\b that are opened this way so that they "
5664887Schin 	"will be closed when another program is invoked.]"
5674887Schin "[+?Because \bexec\b is a special command, any failure will cause the "
5684887Schin 	"script that invokes it to exit.  This can be prevented by "
5694887Schin 	"invoking \bexec\b from the \bcommand\b utility.]"
5704887Schin "[+?\bexec\b cannot be invoked from a restricted shell to create "
5714887Schin 	"files or to open a file for writing or appending.]"
5724887Schin "[c?Clear all environment variables before executions except variable "
5734887Schin 	"assignments that are part of the current \bexec\b command.]"
5744887Schin "[a]:[name?\bargv[0]]\b will be set to \aname\a for \acommand\a]"
5754887Schin "\n"
5764887Schin "\n[command [arg ...]]\n"
5774887Schin "\n"
5784887Schin "[+EXIT STATUS?If \acommand\a is specified, \bexec\b does not return.  "
5794887Schin 	"Otherwise, the exit status is one of the following:]{"
5804887Schin 	"[+0?All I/O redirections were successful.]"
5814887Schin 	"[+>0?An error occurred.]"
5824887Schin "}"
5834887Schin "[+SEE ALSO?\bcommand\b(1), \beval\b(1)]"
5844887Schin ;
5854887Schin 
5864887Schin 
5874887Schin const char sh_optexit[] =
5884887Schin "[-1c?\n@(#)$Id: exit (AT&T Research) 1999-07-07 $\n]"
5894887Schin USAGE_LICENSE
5904887Schin "[+NAME?exit - exit the current shell]"
5914887Schin "[+DESCRIPTION?\bexit\b is shell special built-in that causes the "
5924887Schin 	"shell that invokes it to exit.  Before exiting the shell, if the "
5934887Schin 	"\bEXIT\b trap is set it will be invoked.]"
5944887Schin "[+?If \an\a is given, it will be used to set the exit status.]"
5954887Schin "\n"
5964887Schin "\n[n]\n"
5974887Schin "\n"
5984887Schin "[+EXIT STATUS?If \an\a is specified, the exit status is the least significant "
5994887Schin 	"eight bits of the value of \an\a.  Otherwise, the exit status is the "
6004887Schin 	"exit status of preceding command.  When invoked inside a trap, the "
6014887Schin 	"preceding command means the command that invoked the trap.]"
6024887Schin "[+SEE ALSO?\bbreak\b(1), \breturn\b(1)]"
6034887Schin ;
6044887Schin 
6054887Schin const char sh_optexport[] =
6064887Schin "[-1c?\n@(#)$Id: export (AT&T Research) 1999-07-07 $\n]"
6074887Schin USAGE_LICENSE
6084887Schin "[+NAME?export - set export attribute on variables]"
6094887Schin "[+DESCRIPTION?\bexport\b sets the export attribute on each of "
6104887Schin 	"the variables specified by \aname\a which causes them "
6114887Schin 	"to be in the environment of subsequently executed commands.  "
6124887Schin 	"If \b=\b\avalue\a is specified, the variable \aname\a is "
6134887Schin 	"set to \avalue\a.]"
6144887Schin "[+?If no \aname\as are specified then the names and values of all "
6154887Schin 	"exported variables are written to standard output.]"
6164887Schin "[+?\bexport\b is built-in to the shell as a declaration command so that "
6174887Schin 	"field splitting and pathname expansion are not performed on "
6184887Schin 	"the arguments.  Tilde expansion occurs on \avalue\a.]"
6194887Schin "[p?Causes the output to be in the form of \bexport\b commands that can be "
6204887Schin 	"used as input to the shell to recreate the current exports.]"
6214887Schin "\n"
6224887Schin "\n[name[=value]...]\n"
6234887Schin "\n"
6244887Schin "[+EXIT STATUS?]{"
6254887Schin         "[+0?Successful completion.]"
6264887Schin         "[+>0?An error occurred.]"
6274887Schin "}"
6284887Schin 
6294887Schin "[+SEE ALSO?\bsh\b(1), \btypeset\b(1)]"
6304887Schin ;
6314887Schin 
6324887Schin const char sh_optgetopts[] =
6334887Schin ":[-1c?\n@(#)$Id: getopts (AT&T Research) 2005-01-01 $\n]"
6344887Schin "[-author?Glenn Fowler <gsf@research.att.com>]"
6354887Schin USAGE_LICENSE
6364887Schin "[+NAME?\f?\f - parse utility options]"
6374887Schin "[+DESCRIPTION?The \bgetopts\b utility can be used to retrieve options and "
6384887Schin   "arguments from a list of arguments given by \aargs\a or the positional "
6394887Schin   "parameters if \aargs\a is omitted.  It can also generate usage messages "
6404887Schin   "and a man page for the command based on the information in \aoptstring\a.]"
6414887Schin "[+?Each time it is invoked, the \bgetopts\b utility places the value "
6424887Schin   "of the next option in the shell variable specified by the \aname\a "
6434887Schin   "operand and the index of the next argument to be processed in the "
6444887Schin   "shell variable \bOPTIND\b.  When the shell is invoked \bOPTIND\b "
6454887Schin   "is initialized to \b1\b.  When an option requires or permits an option "
6464887Schin   "argument, \bgetopts\b places the option argument in the shell "
6474887Schin   "variable \bOPTARG\b. Otherwise \bOPTARG\b is set to \b1\b when the "
6484887Schin   "option is set and \b0\b when the option is unset.]"
6494887Schin "[+?The \aoptstring\a string consists of alpha-numeric characters, "
6504887Schin   "the special characters +, -, ?, :, and <space>, or character groups "
6514887Schin   "enclosed in [...]].  Character groups may be nested in {...}. "
6524887Schin   "Outside of a [...]] group, a single new-line followed by zero or "
6534887Schin   "more blanks is ignored.  One or more blank lines separate the "
6544887Schin   "options from the command argument synopsis.]"
6554887Schin "[+?Each [...]] group consists of an optional label, "
6564887Schin   "optional attributes separated by :, and an "
6574887Schin   "optional description string following ?.  The characters from the ? "
6584887Schin   "to the end of the next ]] are ignored for option parsing and short "
6594887Schin   "usage messages.  They are used for generating verbose help or man pages. "
6604887Schin   "The : character may not appear in the label. "
6614887Schin   "The ? character must be specified as ?? in the label and the ]] character "
6624887Schin   "must be specified as ]]]] in the description string. "
6634887Schin   "Text between two \\b (backspace) characters indicates "
6644887Schin   "that the text should be emboldened when displayed. "
6654887Schin   "Text between two \\a (bell) characters indicates that the text should "
6668462SApril.Chin@Sun.COM   "be emphasized or italicized when displayed. "
6674887Schin   "Text between two \\v (vertical tab) characters indicates "
6684887Schin   "that the text should displayed in a fixed width font. "
6694887Schin   "Text between two \\f (formfeed) characters will be replaced by the "
6704887Schin     "output from the shell function whose name is that of the enclosed text.]"
6714887Schin "[+?All output from this interface is written to the standard error.]"
6724887Schin "[+?There are several group types:]{"
6734887Schin   "[+1.?A group of the form "
6744887Schin     "[-[\aversion\a]][\aflag\a[\anumber\a]]]]...[?\atext\a]]]] "
6754887Schin     "appearing as the first group enables the extended interface. \aversion\a "
6764887Schin     "specifies the interface version, currently \b1\b. The latest version is "
6774887Schin     "assumed if \aversion\a is omitted. Future enhancements "
6784887Schin     "may increment \aversion\a, but all versions will be supported. \atext\a "
6794887Schin     "typically specifies an SCCS or CVS identification string. Zero or more "
6804887Schin     "\aflags\a with optional \anumber\a values may be specified to control "
6814887Schin     "option parsing. "
6824887Schin     "The flags are:]{"
68310898Sroland.mainz@nrubsig.org       "[++?Arguments beginning with + are considered options.]"
6844887Schin       "[+c?Cache this \aoptstring\a for multiple passes. Used to optimize "
6854887Schin 	"builtins that may be called many times within the same process.]"
6864887Schin       "[+i?Ignore this \aoptstring\a when generating help. Used when "
6874887Schin 	"combining \aoptstring\a values from multiple passes.]"
6884887Schin       "[+l?Display only \alongname\a options in help messages.]"
6898462SApril.Chin@Sun.COM       "[+n?Associate -\anumber\a and +\anumber\a options with the first "
6908462SApril.Chin@Sun.COM         "option with numeric arguments.]"
6914887Schin       "[+o?The \b-\b option character prefix is optional (supports "
6924887Schin         "obsolete \bps\b(1) option syntax.)]"
6934887Schin       "[+p?\anumber\a specifies the number of \b-\b characters that must "
6944887Schin 	"prefix long option names. The default is \b2\b; \b0\b, \b1\b or "
6954887Schin 	"\b2\b are accepted (e.g., \bp0\b for \bdd\b(1) and \bp1\b for "
6964887Schin 	"\bfind\b(1).)]"
6974887Schin       "[+s?\anumber\a specifies the \b--??man\b section number, "
6984887Schin         "\b1\b by default.]"
6994887Schin   "}"
7004887Schin   "[+2.?An option specification of the form "
7014887Schin     "[\aoption\a[!]][=\anumber\a]][:\alongname\a]][?\atext\a]]]]. In this "
7024887Schin     "case the first field is the option character; this is the value returned "
7034887Schin     "in the \aname\a operand when the option is matched.  If there is no "
7044887Schin     "option character then a two or more digit number should be specified. "
7054887Schin     "This number will be returned as the value of the \aname\a operand if the "
7064887Schin     "long option is matched. If \aoption\a is followed by \b!\b then the option "
7074887Schin     "character sense is the inverse of the longname sense. For options that do "
7084887Schin     "not take values \bOPTARG\b will be set to \b0\b for \b!\b inverted option "
7094887Schin     "characters and \b1\b otherwise. =\anumber\a optionally specifies a number to "
7104887Schin     "be returned in the \aname\a operand instead of the option character. A "
7114887Schin     "longname is specified by \b--\b\alongname\a and is matched by the shortest "
7124887Schin     "non-ambiguous prefix of all long options. * in the \alongname\a field "
7134887Schin     "indicates that only characters up to that point need to match, provided "
7144887Schin     "any additional characters match exactly. The enclosing [ and ]] can be "
7154887Schin     "omitted for an option that does not have a longname or descriptive text.]"
7164887Schin   "[+3.?An option argument specification. "
7174887Schin     "Options that take arguments can be followed by : (string value) or # "
7184887Schin     "(numeric value) and an option argument specification.  An option argument "
7194887Schin     "specification consists of the option argument name as field 1. "
7204887Schin     "The remaining \b:\b separated fields are a type name and zero or more of "
7214887Schin     "the special attribute words \blistof\b, \boneof\b, and \bignorecase\b. "
7224887Schin     "A default option value may be specified in the final field as "
7234887Schin     "\b:=\b\adefault\a. The option argument specification may be followed "
7244887Schin     "by a list of option value descriptions enclosed in braces. "
7254887Schin     "A long option that takes an argument is specified as "
7264887Schin     "\b--\b\alongname\a=\avalue\a. If the : or # is followed by ? then the "
7274887Schin     "option argument is optional. If only the option character form is "
7284887Schin     "specified then the optional argument value is not set if the next "
7294887Schin     "argument starts with - or +.]"
7304887Schin   "[+4.?A option value description.]"
7314887Schin   "[+5.?A argument specification. A list of valid option argument values "
7324887Schin     "can be specified by enclosing them inside a {...} following "
7334887Schin     "the option argument specification.  Each of the permitted "
7344887Schin     "values can be specified with a [...]] containing the "
7354887Schin     "value followed by a description.]"
7364887Schin   "[+6.?A group of the form [+\\n...]] will display the characters "
7374887Schin     "representing ... in fixed with font without adding line breaks.]"
7384887Schin   "[+7.?A group of the form [+\aname\a?\atext\a]] specifies a section "
7394887Schin     "\aname\a with descriptive \atext\a. If \aname\a is omitted then "
7404887Schin     "\atext\a is placed in a new paragraph.]"
7414887Schin   "[+8.?A group of the form [-\aname\a?\atext\a]] specifies entries "
7424887Schin     "for the \bIMPLEMENTATION\b section.]"
7434887Schin "}"
74410898Sroland.mainz@nrubsig.org "[+?A leading : character in \aoptstring\a "
7454887Schin   "affects the way errors are handled.  If an option character or longname "
7464887Schin   "argument not specified in \aoptstring\a is encountered when processing "
7474887Schin   "options, the shell variable whose name is \aname\a will be set to the ? "
7484887Schin   "character.  The shell variable \bOPTARG\b will be set to "
7494887Schin   "the character found.  If an option argument is missing or has an invalid "
7504887Schin   "value, then \aname\a will be set to the : character and the shell variable "
7514887Schin   "\bOPTARG\b will be set to the option character found. "
7524887Schin   "Without the leading :, \aname\a will be set to the ? character, \bOPTARG\b "
7534887Schin   "will be unset, and an error message will be written to standard error "
7544887Schin   "when errors are encountered.]"
75510898Sroland.mainz@nrubsig.org "[+?A leading + character or a + following a leading : in \aoptstring\a "
75610898Sroland.mainz@nrubsig.org   "specifies that arguments beginning with + will also be considered options.]"
7574887Schin "[+?The end of options occurs when:]{"
7584887Schin 	"[+1.?The special argument \b--\b is encountered.]"
7594887Schin 	"[+2.?An argument that does not begin with a \b-\b is encountered.]"
7604887Schin 	"[+3.?A help argument is specified.]"
7614887Schin 	"[+4.?An error is encountered.]"
7624887Schin "}"
7634887Schin "[+?If \bOPTIND\b is set to the value \b1\b, a new set of arguments "
7644887Schin   "can be used.]"
7654887Schin "[+?\bgetopts\b can also be used to generate help messages containing command "
7664887Schin   "usage and detailed descriptions.  Specify \aargs\a as:]"
7674887Schin "{ "
7684887Schin 	"[+-???To generate a usage synopsis.]"
7694887Schin 	"[+--?????To generate a verbose usage message.]"
7704887Schin 	"[+--????man?To generate a formatted man page.]"
7714887Schin 	"[+--????api?To generate an easy to parse usage message.]"
7724887Schin 	"[+--????html?To generate a man page in \bhtml\b format.]"
7734887Schin 	"[+--????nroff?To generate a man page in \bnroff\b format.]"
7744887Schin 	"[+--????usage?List the current \aoptstring\a.]"
7754887Schin 	"[+--??????\aname\a?List \bversion=\b\an\a, \an\a>0, "
7764887Schin 	  "if the option \aname\a is recognized by \bgetopts\b.]"
7774887Schin "}"
7784887Schin "[+?When the end of options is encountered, \bgetopts\b exits with a "
7794887Schin   "non-zero return value and the variable \bOPTIND\b is set to the "
7804887Schin   "index of the first non-option argument.]"
7814887Schin "a:[name?Use \aname\a instead of the command name in usage messages.]"
7824887Schin "\n"
7834887Schin "\nopstring name [args...]\n"
7844887Schin "\n"
7854887Schin "[+EXIT STATUS]{"
7864887Schin 	"[+0?An option specified was found.]"
7874887Schin 	"[+1?An end of options was encountered.]"
7884887Schin 	"[+2?A usage or information message was generated.]"
7894887Schin "}"
7904887Schin ;
7914887Schin 
7924887Schin const char sh_optbg[] =
7934887Schin "[-1c?@(#)$Id: bg (AT&T Research) 2000-04-02 $\n]"
7944887Schin USAGE_LICENSE
7954887Schin "[+NAME?bg - resume jobs in the background]"
7964887Schin "[+DESCRIPTION?\bbg\b places the given \ajob\as into the background "
7974887Schin 	"and sends them a \bCONT\b signal to start them running.]"
7984887Schin "[+?If \ajob\a is omitted, the most recently started or stopped "
7994887Schin 	"background job is resumed or continued in the background.]"
8004887Schin "[+?Each \ajob\a can be specified as one of the following:]{"
8014887Schin 	"[+\anumber\a?\anumber\a refers to a process id.]"
8024887Schin 	"[+-\anumber\a?\anumber\a refers to a process group id.]"
8034887Schin 	"[+%\anumber\a?\anumber\a refer to a job number.]"
8044887Schin 	"[+%\astring\a?Refers to a job whose name begins with \astring\a.]"
8054887Schin 	"[+%??\astring\a?Refers to a job whose name contains \astring\a.]"
8064887Schin 	"[+%+ \bor\b %%?Refers to the current job.]"
8074887Schin 	"[+%-?Refers to the previous job.]"
8084887Schin "}"
8094887Schin "\n"
8104887Schin "\n[job ...]\n"
8114887Schin "\n"
8124887Schin "[+EXIT STATUS?]{"
8134887Schin 	"[+0?If all background jobs are started.]"
8144887Schin 	"[+>0?If one more jobs does not exist or there are no background "
8154887Schin 		"jobs.]"
8164887Schin "}"
8174887Schin 
8184887Schin "[+SEE ALSO?\bwait\b(1), \bfg\b(1), \bdisown\b(1), \bjobs\b(1)]"
8194887Schin ;
8204887Schin 
8214887Schin const char sh_optfg[] =
8224887Schin "[-1c?@(#)$Id: fg (AT&T Research) 2000-04-02 $\n]"
8234887Schin USAGE_LICENSE
8244887Schin "[+NAME?fg - move jobs to the foreground]"
8254887Schin "[+DESCRIPTION?\bfg\b places the given \ajob\as into the foreground "
8264887Schin 	"in sequence and sends them a \bCONT\b signal to start each running.]"
8274887Schin "[+?If \ajob\a is omitted, the most recently started or stopped "
8284887Schin 	"background job is moved to the foreground.]"
8294887Schin "[+?Each \ajob\a can be specified as one of the following:]{"
8304887Schin 	"[+\anumber\a?\anumber\a refers to a process id.]"
8314887Schin 	"[+-\anumber\a?\anumber\a refers to a process group id.]"
8324887Schin 	"[+%\anumber\a?\anumber\a refer to a job number.]"
8334887Schin 	"[+%\astring\a?Refers to a job whose name begins with \astring\a.]"
8344887Schin 	"[+%??\astring\a?Refers to a job whose name contains \astring\a.]"
8354887Schin 	"[+%+ \bor\b %%?Refers to the current job.]"
8364887Schin 	"[+%-?Refers to the previous job.]"
8374887Schin "}"
8384887Schin "\n"
8394887Schin "\n[job ...]\n"
8404887Schin "\n"
8414887Schin "[+EXIT STATUS?If \bfg\b brings one or more jobs into the foreground, "
8424887Schin 	"the exit status of \bfg\b  will be that of the last \ajob\a.  "
8434887Schin 	"If one or more jobs does not exist or has completed, \bfg\b will "
8444887Schin 	"return a non-zero exit status.]"
8454887Schin "}"
8464887Schin 
8474887Schin "[+SEE ALSO?\bwait\b(1), \bbg\b(1), \bjobs\b(1)]"
8484887Schin ;
8494887Schin 
8504887Schin const char sh_optdisown[] =
8514887Schin "[-1c?@(#)$Id: disown (AT&T Research) 2000-04-02 $\n]"
8524887Schin USAGE_LICENSE
8534887Schin "[+NAME?disown - disassociate a job with the current shell]"
8544887Schin "[+DESCRIPTION?\bdisown\b prevents the current shell from sending "
8554887Schin 	"a \bHUP\b signal to each of the given \ajob\as when "
8564887Schin 	"the current shell terminates a login session.]"
8574887Schin "[+?If \ajob\a is omitted, the most recently started or stopped "
8584887Schin 	"background job is used.]"
8594887Schin "[+?Each \ajob\a can be specified as one of the following:]{"
8604887Schin 	"[+\anumber\a?\anumber\a refers to a process id.]"
8614887Schin 	"[+-\anumber\a?\anumber\a refers to a process group id.]"
8624887Schin 	"[+%\anumber\a?\anumber\a refer to a job number.]"
8634887Schin 	"[+%\astring\a?Refers to a job whose name begins with \astring\a.]"
8644887Schin 	"[+%??\astring\a?Refers to a job whose name contains \astring\a.]"
8654887Schin 	"[+%+ \bor\b %%?Refers to the current job.]"
8664887Schin 	"[+%-?Refers to the previous job.]"
8674887Schin "}"
8684887Schin "\n"
8694887Schin "\n[job ...]\n"
8704887Schin "\n"
8714887Schin "[+EXIT STATUS?]{"
8728462SApril.Chin@Sun.COM 	"[+0?If all jobs are successfully disowned.]"
8734887Schin 	"[+>0?If one more \ajob\as does not exist.]"
8744887Schin "}"
8754887Schin 
8764887Schin "[+SEE ALSO?\bwait\b(1), \bbg\b(1), \bjobs\b(1)]"
8774887Schin ;
8784887Schin 
8794887Schin const char sh_optjobs[] =
8804887Schin "[-1c?@(#)$Id: jobs (AT&T Research) 2000-04-02 $\n]"
8814887Schin USAGE_LICENSE
8824887Schin "[+NAME?jobs - display status of jobs]"
8834887Schin "[+DESCRIPTION?\bjobs\b displays information about specified \ajob\as "
8844887Schin 	"that were started by the current shell environment on standard "
8854887Schin 	"output.  The information contains the job number enclosed in "
8864887Schin 	"[...]], the status, and the command line that started the job.]"
8874887Schin "[+?If \ajob\a is omitted, \bjobs\b displays the status of all stopped jobs, "
8884887Schin 	"background jobs, and all jobs whose status has changed since last "
8894887Schin 	"reported by the shell.]"
8904887Schin "[+?When \bjobs\b reports the termination status of a job, the "
8914887Schin 	"shell removes the jobs from the list of known jobs in "
8924887Schin 	"the current shell environment.]"
8934887Schin "[+?Each \ajob\a can be specified as one of the following:]{"
8944887Schin 	"[+\anumber\a?\anumber\a refers to a process id.]"
8954887Schin 	"[+-\anumber\a?\anumber\a refers to a process group id.]"
8964887Schin 	"[+%\anumber\a?\anumber\a refer to a job number.]"
8974887Schin 	"[+%\astring\a?Refers to a job whose name begins with \astring\a.]"
8984887Schin 	"[+%??\astring\a?Refers to a job whose name contains \astring\a.]"
8994887Schin 	"[+%+ \bor\b %%?Refers to the current job.]"
9004887Schin 	"[+%-?Refers to the previous job.]"
9014887Schin "}"
9024887Schin "[l?\bjobs\b displays process id's after the job number in addition "
9034887Schin 	"to the usual information]"
9044887Schin "[n?Only the jobs whose status has changed since the last prompt "
9054887Schin 	"is displayed.]"
9064887Schin "[p?The process group leader id's for the specified jobs are displayed.]"
9074887Schin "\n"
9084887Schin "\n[job ...]\n"
9094887Schin "\n"
9104887Schin "[+EXIT STATUS?]{"
9114887Schin 	"[+0?The information for each job is written to standard output.]"
9124887Schin 	"[+>0?One or more jobs does not exist.]"
9134887Schin "}"
9144887Schin 
9154887Schin "[+SEE ALSO?\bwait\b(1), \bps\b(1), \bfg\b(1), \bbg\b(1)]"
9164887Schin ;
9174887Schin 
9184887Schin const char sh_opthist[]	=
9198462SApril.Chin@Sun.COM "[-1cn?@(#)$Id: hist (AT&T Research) 2000-04-02 $\n]"
9204887Schin USAGE_LICENSE
9214887Schin "[+NAME?\f?\f - process command history list]"
9224887Schin "[+DESCRIPTION?\b\f?\f\b lists, edits, or re-executes, commands  "
9234887Schin 	"previously entered into the current shell environment.]"
9244887Schin "[+?The command history list references commands by number. The first number "
9254887Schin 	"in the list is selected arbitrarily.  The relationship of a number "
9264887Schin 	"to its command does not change during a login session.  When the "
9274887Schin 	"number reaches 32767 the number wraps around to 1 but "
9284887Schin 	"maintains the ordering.]"
9294887Schin "[+?When commands are edited (when the \b-l\b option is not specified), the "
9304887Schin 	"resulting lines will be entered at the end of the history list and "
9314887Schin 	"then reexecuted by the current shell.  The \b\f?\f\b command that "
9324887Schin 	"caused the editing will not be entered into the history list.  If the "
9334887Schin 	"editor returns a non-zero exit status, this will suppress the "
9344887Schin 	"entry into the history list and the command reexecution.  Command "
9354887Schin 	"line variable assignments and redirections affect both the \f?\f "
9364887Schin 	"command and the commands that are reexecuted.]"
9374887Schin "[+?\afirst\a and \alast\a define the range of commands. \afirst\a and "
9384887Schin 		"\alast\a can be one of the following:]{"
9394887Schin 		"[+\anumber\a?A positive number representing a command "
9404887Schin 			"number.  A \b+\b sign can precede \anumber\a.]"
9414887Schin 		"[+-\anumber\a?A negative number representing a command "
9424887Schin 			"that was executed \anumber\a commands previously. "
9434887Schin 			"For example, \b-1\b is the previous command.]"
9444887Schin 		"[+\astring\a?\astring\a indicates the most recently "
9454887Schin 			"entered command that begins with \astring\a. "
9464887Schin 			"\astring\a should not contain an \b=\b.]"
9474887Schin 	"}"
9484887Schin "[+?If \afirst\a is omitted, the previous command is used, unless \b-l\b "
9494887Schin 	"is specified, in which case it will default to \b-16\b and \alast\a "
9504887Schin 	"will default to \b-1\b.]"
9514887Schin "[+?If \afirst\a is specified and \alast\a is omitted, then \alast\a will "
9524887Schin 	"default to \afirst\a unless \b-l\b is specified in which case "
9534887Schin 	"it will default to \b-1\b.]"
9544887Schin "[+?If no editor is specified, then the editor specfied by the \bHISTEDIT\b "
9554887Schin 	"variable will be used if set, or the \bFCEDIT\b variable will be "
9564887Schin 	"used if set, otherwise, \bed\b will be used.]"
9574887Schin "[e]:[editor?\aeditor\a specifies the editor to use to edit the history "
9584887Schin 	"command.   A value of \b-\b for \aeditor\a is equivalent to "
9594887Schin 	"specifiying the \b-s\b option.]"
9604887Schin "[l?List the commands rather than editing and reexecuting them.]"
9614887Schin "[N]#[num?Start at \anum\a commands back.]"
9624887Schin "[n?Suppress the command numbers when the commands are listed.]"
9634887Schin #if SHOPT_HISTEXPAND
9644887Schin "[p?Writes the result of history expansion for each operand to standard "
9654887Schin 	"output.  All other options are ignored.]"
9664887Schin #endif
9674887Schin "[r?Reverse the order of the commands.]"
9684887Schin "[s?Reexecute the command without invoking an editor.  In this case "
9694887Schin 	"an operand of the form \aold\a\b=\b\anew\a can be specified "
9704887Schin 	"to change the first occurrence of the string \aold\a in the "
9714887Schin 	"command to \anew\a before reexecuting the command.]"
9724887Schin 
9734887Schin "\n"
9744887Schin "\n[first [last] ]\n"
9754887Schin "\n"
9764887Schin "[+EXIT STATUS?If a command is reexecuted, the exit status is that of "
9774887Schin 	"the command that gets reexecuted.  Otherwise, it is one of the "
9784887Schin 	"following:]{"
9794887Schin 	"[+0?Successfully completion of the listing.]"
9804887Schin 	"[+>0?An error occurred.]"
9814887Schin "}"
9824887Schin 
9834887Schin "[+SEE ALSO?\bksh\b(1), \bsh\b(1), \bed\b(1)]"
9844887Schin ;
9854887Schin 
9864887Schin const char sh_optkill[]	 =
9874887Schin "[-1c?\n@(#)$Id: kill (AT&T Research) 1999-06-17 $\n]"
9884887Schin USAGE_LICENSE
9894887Schin "[+NAME?kill - terminate or signal process]"
9904887Schin "[+DESCRIPTION?With the first form in which \b-l\b is not specified, "
9914887Schin 	"\bkill\b sends a signal to one or more processes specified by "
9924887Schin 	"\ajob\a.  This normally terminates the processes unless the signal "
9934887Schin 	"is being caught or ignored.]"
9944887Schin "[+?A \ajob\a can be specified as one of the following:]{"
9954887Schin 	"[+\anumber\a?\anumber\a refers to a process id.]"
9964887Schin 	"[+-\anumber\a?\anumber\a refers to a process group id.]"
9974887Schin 	"[+%\anumber\a?\anumber\a refer to a job number.]"
9984887Schin 	"[+%\astring\a?Refers to a job whose name begins with \astring\a.]"
9994887Schin 	"[+%??\astring\a?Refers to a job whose name contains \astring\a.]"
10004887Schin 	"[+%+ \bor\b %%?Refers to the current job.]"
10014887Schin 	"[+%-?Refers to the previous job.]"
10024887Schin "}"
10034887Schin "[+?If the signal is not specified with either the \b-n\b or the \b-s\b  "
10044887Schin 	"option, the \bSIGTERM\b signal is used.]"
10054887Schin "[+?If \b-l\b is specified, and no \aarg\a is specified, then \bkill\b "
10064887Schin 	"writes the list of signals to standard output.  Otherwise, \aarg\a "
10074887Schin 	"can be either a signal name, or a number representing either a "
10084887Schin 	"signal number or exit status for a process that was terminated "
10094887Schin 	"due to a signal.  If a name is given the corresponding signal "
10104887Schin 	"number will be written to standard output.  If a number is given "
10114887Schin 	"the corresponding signal name will be written to standard output.]"
10124887Schin "[l?List signal names or signal numbers rather than sending signals as "
10134887Schin 	"described above.  "
10144887Schin 	"The \b-n\b and \b-s\b options cannot be specified.]"
10154887Schin "[n]#[signum?Specify a signal number to send.  Signal numbers are not "
10164887Schin 	"portable across platforms, except for the following:]{"
10174887Schin 		"[+0?No signal]"
10184887Schin 		"[+1?\bHUP\b]"
10194887Schin 		"[+2?\bINT\b]"
10204887Schin 		"[+3?\bQUIT\b]"
10214887Schin 		"[+6?\bABRT\b]"
10224887Schin 		"[+9?\bKILL\b]"
10234887Schin 		"[+14?\bALRM\b]"
10244887Schin 		"[+15?\bTERM\b]"
10254887Schin 	"}"
10264887Schin "[s]:[signame?Specify a signal name to send.  The signal names are derived "
10274887Schin 	"from their names in \b<signal.h>\b without the \bSIG\b prefix and "
10284887Schin 	"are case insensitive.  \bkill -l\b will generate the list of "
10294887Schin 	"signals on the current platform.]"
10304887Schin "\n"
10314887Schin "\njob ...\n"
10324887Schin " -l [arg ...]\n"
10334887Schin "\n"
10344887Schin "[+EXIT STATUS?]{"
10354887Schin 	"[+0?At least one matching process was found for each \ajob\a "
10364887Schin 	"operand, and the specified signal was successfully sent to at "
10374887Schin 	"least one matching process.]"
10384887Schin 	"[+>0?An error occurred.]"
10394887Schin "}"
10404887Schin "[+SEE ALSO?\bps\b(1), \bjobs\b(1), \bkill\b(2), \bsignal\b(2)]"
10414887Schin ;
10424887Schin 
10434887Schin const char sh_optlet[]	=
10444887Schin "[-1c?@(#)$Id: let (AT&T Research) 2000-04-02 $\n]"
10454887Schin USAGE_LICENSE
10464887Schin "[+NAME?let - evaluate arithmetic expressions]"
10474887Schin "[+DESCRIPTION?\blet\b evaluates each \aexpr\a in the current "
10484887Schin 	"shell environment as an arithmetic expression using ANSI C "
10494887Schin 	"syntax.  Variables names are shell variables and they "
10504887Schin 	"are recursively evaluated as arithmetic expressions to "
10514887Schin 	"get numerical values.]"
10524887Schin "[+?\blet\b has been made obsolete by the \b((\b...\b))\b syntax "
10534887Schin 	"of \bksh\b(1) which does not require quoting of the operators "
10544887Schin 	"to pass them as command arguments.]"
10554887Schin "\n"
10564887Schin "\n[expr ...]\n"
10574887Schin "\n"
10584887Schin "[+EXIT STATUS?]{"
10594887Schin 	"[+0?The last \aexpr\a evaluates to a non-zero value.]"
10604887Schin 	"[+>0?The last \aexpr\a evaluates to \b0\b or an error occurred.]"
10614887Schin "}"
10624887Schin 
10634887Schin "[+SEE ALSO?\bexpr\b(1), \btest\b(1), \bksh\b(1)]"
10644887Schin ;
10654887Schin 
10664887Schin const char sh_optprint[] =
106710898Sroland.mainz@nrubsig.org "[-1c?\n@(#)$Id: print (AT&T Research) 2008-11-26 $\n]"
10684887Schin USAGE_LICENSE
10694887Schin "[+NAME?print - write arguments to standard output]"
10704887Schin "[+DESCRIPTION?By default, \bprint\b writes each \astring\a operand to "
10714887Schin 	"standard output and appends a newline character.]"
10728462SApril.Chin@Sun.COM "[+?Unless, the \b-r\b or \b-f\b option is specified, each \b\\\b "
10734887Schin 	"character in each \astring\a operand is processed specially as "
10744887Schin 	"follows:]{"
10754887Schin 		"[+\\a?Alert character.]"
10764887Schin 		"[+\\b?Backspace character.]"
10774887Schin 		"[+\\c?Terminate output without appending newline.  The "
10784887Schin 			"remaining \astring\a operands are ignored.]"
10794887Schin 		"[+\\f?Formfeed character.]"
10804887Schin 		"[+\\n?Newline character.]"
10814887Schin 		"[+\\t?Tab character.]"
10824887Schin 		"[+\\v?Vertical tab character.]"
10834887Schin 		"[+\\\\?Backslash character.]"
10844887Schin 		"[+\\E?Escape character (ASCII octal 033).]"
10854887Schin 		"[+\\0\ax\a?The 8-bit character whose ASCII code is the "
10864887Schin 			"1-, 2-, or 3-digit octal number \ax\a.]"
10874887Schin 	"}"
10884887Schin "[+?If both \b-e\b and \b-r\b are specified, the last one specified is "
10894887Schin 	"the one that is used.]"
10904887Schin "[+?When the \b-f\b option is specified and there are more \astring\a "
10914887Schin 	"operands than format specifiers, the format string is "
10924887Schin 	"reprocessed from the beginning.  If there are fewer \astring\a "
10934887Schin 	"operands than format specifiers, then outputting will end "
10944887Schin 	"at the first unneeded format specifier.]"
10954887Schin "[e?Unless \b-f\b is specified, process \b\\\b sequences in each \astring\a "
10964887Schin 	"operand as described above. This is the default behavior.]"
10974887Schin "[n?Do not append a new-line character to the output.]"
10984887Schin "[f]:[format?Write the \astring\a arguments using the format string "
10994887Schin 	"\aformat\a and do not append a new-line.  See \bprintf\b for "
11004887Schin 	"details on how to specify \aformat\a.]"
11014887Schin "[p?Write to the current co-process instead of standard output.]"
11024887Schin "[r?Do not process \b\\\b sequences in each \astring\a operand as described "
11034887Schin 	"above.]"
11044887Schin "[s?Write the output as an entry in the shell history file instead of "
11054887Schin 	"standard output.]"
11064887Schin "[u]:[fd:=1?Write to file descriptor number \afd\a instead of standard output.]"
11078462SApril.Chin@Sun.COM "[v?Treat each \astring\a as a variable name and write the value in \b%B\b "
11088462SApril.Chin@Sun.COM 	"format.  Cannot be used with \b-f\b.]"
110910898Sroland.mainz@nrubsig.org "[C?Treat each \astring\a as a variable name and write the value in \b%#B\b "
111010898Sroland.mainz@nrubsig.org 	"format.  Cannot be used with \b-f\b.]"
11114887Schin "\n"
11124887Schin "\n[string ...]\n"
11134887Schin "\n"
11144887Schin "[+EXIT STATUS?]{"
11154887Schin 	"[+0?Successful completion.]"
11164887Schin 	"[+>0?An error occurred.]"
11174887Schin "}"
11184887Schin "[+SEE ALSO?\becho\b(1), \bprintf\b(1), \bread\b(1)]"
11194887Schin ;
11204887Schin 
11214887Schin const char sh_optprintf[] =
112210898Sroland.mainz@nrubsig.org "[-1c?\n@(#)$Id: printf (AT&T Research) 2009-02-02 $\n]"
11234887Schin USAGE_LICENSE
11244887Schin "[+NAME?printf - write formatted output]"
11254887Schin "[+DESCRIPTION?\bprintf\b writes each \astring\a operand to "
11264887Schin 	"standard output using \aformat\a to control the output format.]"
11274887Schin "[+?The \aformat\a operands supports the full range of ANSI C formatting "
11284887Schin 	"specifiers plus the following additional specifiers:]{"
11294887Schin 	"[+%b?Each character in the \astring\a operand is processed "
11304887Schin 		"specially as follows:]{"
11314887Schin 			"[+\\a?Alert character.]"
11324887Schin 			"[+\\b?Backspace character.]"
11334887Schin 			"[+\\c?Terminate output without appending newline. "
11344887Schin 			    "The remaining \astring\a operands are ignored.]"
11354887Schin 			"[+\\f?Formfeed character.]"
11364887Schin 			"[+\\n?Newline character.]"
11374887Schin 			"[+\\t?Tab character.]"
11384887Schin 			"[+\\v?Vertical tab character.]"
11394887Schin 			"[+\\\\?Backslash character.]"
11404887Schin 			"[+\\E?Escape character (ASCII octal 033).]"
11414887Schin 			"[+\\0\ax\a?The 8-bit character whose ASCII code is "
11424887Schin 				"the 1-, 2-, or 3-digit octal number \ax\a.]"
11434887Schin 		"}"
11444887Schin 	"[+%q?Output \astring\a quoted in a manner that it can be read in "
11454887Schin 		"by the shell to get back the same string.  However, empty "
11464887Schin 		"strings resulting from missing \astring\a operands will "
11474887Schin 		"not be quoted.]"
11484887Schin 	"[+%B?Treat the argument as a variable name and output the value "
11494887Schin 		"without converting it to a string.  This is most useful for "
11504887Schin 		"variables of type \b-b\b.]"
11514887Schin 	"[+%H?Output \astring\a with characters \b<\b, \b&\b, \b>\b, "
11524887Schin 		"\b\"\b, and non-printable characters properly escaped for "
11534887Schin 		"use in HTML and XML documents.]"
11544887Schin 	"[+%P?Treat \astring\a as an extended regular expression and  "
11554887Schin 		"convert it to a shell pattern.]"
11564887Schin 	"[+%R?Treat \astring\a as an shell pattern expression and  "
11574887Schin 		"convert it to an extended regular expression.]"
11584887Schin 	"[+%T?Treat \astring\a as a date/time string and format it.  The "
11594887Schin 		"\bT\b can be preceded by \b(\b\adformat\a\b)\b, where "
11604887Schin 		"\adformat\a is a date format as defined by the \bdate\b "
11614887Schin 		"command.]"
11624887Schin 	"[+%Z?Output a byte whose value is \b0\b.]"
11634887Schin "}"
11644887Schin "[+?When performing conversions of \astring\a to satisfy a numeric "
11654887Schin 	"format specifier, if the first character of \astring\a "
11664887Schin 	"is \b\"\b or \b'\b, then the value will be the numeric value "
11674887Schin 	"in the underlying code set of the character following the "
11684887Schin 	"\b\"\b or \b'\b.  Otherwise, \astring\a is treated like a shell "
11694887Schin 	"arithmetic expression and evaluated.]"
117010898Sroland.mainz@nrubsig.org "[+?If a \astring\a operand cannot be completely converted into a value "
11714887Schin 	"appropriate for that format specifier, an error will occur, "
11724887Schin 	"but remaining \astring\a operands will continue to be processed.]"
11734887Schin "[+?In addition to the format specifier extensions, the following "
11744887Schin 	"extensions of ANSI-C are permitted in format specifiers:]{"
11754887Schin 	"[+-?The escape sequences \b\\E\b and \b\\e\b expand to the escape "
11764887Schin 		"character which is octal \b033\b in ASCII.]"
11774887Schin 	"[+-?The escape sequence \b\\c\b\ax\a expands to Control-\ax\a.]"
11784887Schin 	"[+-?The escape sequence \b\\C[.\b\aname\a\b.]]\b expands to "
11794887Schin 		"the collating element \aname\a.]"
11804887Schin 	"[+-?The escape sequence \b\\x{\b\ahex\a\b}\b expands to the "
11814887Schin 		"character corresponding to the hexidecimal value \ahex\a.]"
11824887Schin 	"[+-?The format modifier flag \b=\b can be used to center a field to "
118310898Sroland.mainz@nrubsig.org 		"a specified width.]"
118410898Sroland.mainz@nrubsig.org 	"[+-?The format modifier flag \bL\b can be used with the \bc\b and "
118510898Sroland.mainz@nrubsig.org 		"\bs\b formats to treat precision as character width instead "
118610898Sroland.mainz@nrubsig.org 		"of byte count.]"
11874887Schin 	"[+-?Each of the integral format specifiers can have a third "
11884887Schin 		"modifier after width and precision that specifies the "
11894887Schin 		"base of the conversion from 2 to 64.  In this case the "
11904887Schin 		"\b#\b modifier will cause \abase\a\b#\b to be prepended to "
11914887Schin 		"the value.]"
11924887Schin 	"[+-?The \b#\b modifier can be used with the \bd\b specifier when "
11934887Schin 		"no base is specified cause the output to be written in units "
11944887Schin 		"of \b1000\b with a suffix of one of \bk M G T P E\b.]"
11954887Schin 	"[+-?The \b#\b modifier can be used with the \bi\b specifier to "
11964887Schin 		"cause the output to be written in units of \b1024\b with "
11974887Schin 		"a suffix of one of \bKi Mi Gi Ti Pi Ei\b.]"
11984887Schin 	"}"
11994887Schin "[+?If there are more \astring\a operands than format specifiers, the "
12004887Schin 	"\aformat\a string is reprocessed from the beginning.  If there are "
12014887Schin 	"fewer \astring\a operands than format specifiers, then string "
12024887Schin 	"specifiers will be treated as if empty strings were supplied, "
12034887Schin 	"numeric conversions will be treated as if 0 were supplied, and "
12044887Schin 	"time conversions will be treated as if \bnow\b were supplied.]"
12054887Schin "[+?\bprintf\b is equivalent to \bprint -f\b which allows additional "
12064887Schin 	"options to be specified.]"
12074887Schin "\n"
12084887Schin "\nformat [string ...]\n"
12094887Schin "\n"
12104887Schin "[+EXIT STATUS?]{"
12114887Schin 	"[+0?Successful completion.]"
12124887Schin 	"[+>0?An error occurred.]"
12134887Schin "}"
12144887Schin "[+SEE ALSO?\bdate\b(1), \bprint\b(1), \bread\b(1)]"
12154887Schin ;
12164887Schin 
12174887Schin const char sh_optpwd[] =
12184887Schin "[-1c?\n@(#)$Id: pwd (AT&T Research) 1999-06-07 $\n]"
12194887Schin USAGE_LICENSE
12204887Schin "[+NAME?pwd - write working directory name]"
12214887Schin "[+DESCRIPTION?\bpwd\b writes an absolute pathname of the current working "
12224887Schin 	"directory to standard output.   An absolute pathname is a "
12234887Schin 	"pathname that begins with \b/\b that does not contains any "
12244887Schin 	"\b.\b  or \b..\b components.]"
12254887Schin "[+?If both \b-L\b and \b-P\b are specified, the last one specified will "
12264887Schin 	"be used.  If neither \b-P\b or \b-L\b is specified then the "
12274887Schin 	"behavior will be determined by the \bgetconf\b parameter "
12284887Schin 	"\bPATH_RESOLVE\b.  If \bPATH_RESOLVE\b is \bphysical\b, "
12294887Schin 	"then the behavior will be as if \b-P\b were specified.  Otherwise, "
12304887Schin 	"the behavior will be as if  \b-L\b were specified.]"
12314887Schin "[L?The absolute pathname may contains symbolic link components.  This is "
12324887Schin 	"the default.]"
12334887Schin "[P?The absolute pathname will not contain any symbolic link components.]"
12344887Schin "[+EXIT STATUS?]{"
12354887Schin 	"[+0?Successful completion.]"
12364887Schin 	"[+>0?An error occurred.]"
12374887Schin "}"
12384887Schin "[+SEE ALSO?\bcd\b(1), \bgetconf\b(1)]"
12394887Schin ;
12404887Schin 
12414887Schin const char sh_optread[] =
12424887Schin "[-1c?\n@(#)$Id: read (AT&T Research) 2006-12-19 $\n]"
12434887Schin USAGE_LICENSE
12444887Schin "[+NAME?read - read a line from standard input]"
12454887Schin "[+DESCRIPTION?\bread\b reads a line from standard input and breaks it "
12464887Schin 	"into fields using the characters in value of the \bIFS\b variable "
12474887Schin 	"as separators.  The escape character, \b\\\b, is used to remove "
12484887Schin 	"any special meaning for the next character and for line continuation "
12494887Schin 	"unless the \b-r\b option is specified.]"
12504887Schin "[+?If there are more variables than fields, the remaining variables are "
12514887Schin 	"set to empty strings.  If there are fewer variables than fields, "
12524887Schin 	"the leftover fields and their intervening separators are assigned "
12538462SApril.Chin@Sun.COM 	"to the last variable.  If no \avar\a is specified then the variable "
12544887Schin 	"\bREPLY\b is used.]"
12554887Schin "[+?When \avar\a has the binary attribute and \b-n\b or \b-N\b is specified, "
12564887Schin 	"the bytes that are read are stored directly into \bvar\b.]"
12574887Schin "[+?If you specify \b?\b\aprompt\a after the first \avar\a, then \bread\b "
12584887Schin 	"will display \aprompt\a on standard error when standard input "
12594887Schin 	"is a terminal or pipe.]"
12604887Schin "[A?Unset \avar\a and then create an indexed array containing each field in "
12614887Schin 	"the line starting at index 0.]"
12628462SApril.Chin@Sun.COM "[C?Unset \avar\a and read  \avar\a as a compound variable.]"
12634887Schin "[d]:[delim?Read until delimiter \adelim\a instead of to the end of line.]"
12644887Schin "[p?Read from the current co-process instead of standard input.  An end of "
12654887Schin 	"file causes \bread\b to disconnect the co-process so that another "
12664887Schin 	"can be created.]"
12674887Schin "[r?Do not treat \b\\\b specially when processing the input line.]"
12684887Schin "[s?Save a copy of the input as an entry in the shell history file.]"
12694887Schin "[u]#[fd:=0?Read from file descriptor number \afd\a instead of standard input.]"
12704887Schin "[t]:[timeout?Specify a timeout \atimeout\a in seconds when reading from "
12714887Schin 	"a terminal or pipe.]"
1272*12068SRoger.Faulkner@Oracle.COM "[n]#[nchar?Read at most \anchar\a characters.  For binary fields \asize\a "
12734887Schin 	"will be in bytes.]"
1274*12068SRoger.Faulkner@Oracle.COM "[N]#[nchar?Read exactly \anchar\a characters.  For binary fields \asize\a "
12754887Schin 	"will be in bytes.]"
12764887Schin "[v?When reading from a terminal the value of the first variable is displayed "
12774887Schin 	"and used as a default value.]"
12784887Schin "\n"
12794887Schin "\n[var?prompt] [var ...]\n"
12804887Schin "\n"
12814887Schin "[+EXIT STATUS?]{"
12824887Schin 	"[+0? Successful completion.]"
12834887Schin 	"[+>0?End of file was detected or an error occurred.]"
12844887Schin "}"
12854887Schin "[+SEE ALSO?\bprint\b(1), \bprintf\b(1), \bcat\b(1)]"
12864887Schin ;
12874887Schin 
12884887Schin const char sh_optreadonly[] =
12898462SApril.Chin@Sun.COM "[-1c?\n@(#)$Id: readonly (AT&T Research) 2008-06-16 $\n]"
12904887Schin USAGE_LICENSE
12914887Schin "[+NAME?readonly - set readonly attribute on variables]"
12924887Schin "[+DESCRIPTION?\breadonly\b sets the readonly attribute on each of "
12934887Schin 	"the variables specified by \aname\a which prevents their "
12944887Schin 	"values from being changed.  If \b=\b\avalue\a is specified, "
12954887Schin 	"the variable \aname\a is set to \avalue\a before the variable "
12964887Schin 	"is made readonly.]"
12978462SApril.Chin@Sun.COM "[+?Within a type definition, if the value is not specified, then a "
12988462SApril.Chin@Sun.COM 	"value must be specified when creating each instance of the type "
12998462SApril.Chin@Sun.COM         "and the value is readonly for each instance.]"
13004887Schin "[+?If no \aname\as are specified then the names and values of all "
13014887Schin 	"readonly variables are written to standard output.]"
13024887Schin "[+?\breadonly\b is built-in to the shell as a declaration command so that "
13034887Schin 	"field splitting and pathname expansion are not performed on "
13044887Schin 	"the arguments.  Tilde expansion occurs on \avalue\a.]"
13054887Schin "[p?Causes the output to be in a form of \breadonly\b commands that can be "
13064887Schin 	"used as input to the shell to recreate the current set of "
13074887Schin 	"readonly variables.]"
13084887Schin "\n"
13094887Schin "\n[name[=value]...]\n"
13104887Schin "\n"
13114887Schin "[+EXIT STATUS?]{"
13124887Schin         "[+0?Successful completion.]"
13134887Schin         "[+>0?An error occurred.]"
13144887Schin "}"
13154887Schin 
13164887Schin "[+SEE ALSO?\bsh\b(1), \btypeset\b(1)]"
13174887Schin ;
13184887Schin 
13194887Schin const char sh_optreturn[] =
13204887Schin "[-1c?\n@(#)$Id: return (AT&T Research) 1999-07-07 $\n]"
13214887Schin USAGE_LICENSE
13224887Schin "[+NAME?return - return from a function or dot script ]"
13234887Schin "[+DESCRIPTION?\breturn\b is a shell special built-in that causes the "
13244887Schin 	"function or dot script that invokes it to exit.  "
13254887Schin 	"If \breturn\b is invoked outside of a function or dot script "
13264887Schin 	"it is equivalent to \bexit\b.]"
13274887Schin "[+?If \breturn\b is invoked inside a function defined with the \bfunction\b "
13284887Schin 	"reserved word syntax, then any \bEXIT\b trap set within the "
13294887Schin 	"then function will be invoked in the context of the caller "
13304887Schin 	"before the function returns.]"
13314887Schin "[+?If \an\a is given, it will be used to set the exit status.]"
13324887Schin "\n"
13334887Schin "\n[n]\n"
13344887Schin "\n"
13354887Schin "[+EXIT STATUS?If \an\a is specified, the exit status is the least significant "
13364887Schin 	"eight bits of the value of \an\a.  Otherwise, the exit status is the "
13374887Schin 	"exit status of preceding command.]"
13384887Schin "[+SEE ALSO?\bbreak\b(1), \bexit\b(1)]"
13394887Schin ;
13404887Schin 
13414887Schin 
13424887Schin const char sh_optksh[] =
13434887Schin "+[-1c?\n@(#)$Id: sh (AT&T Research) "SH_RELEASE" $\n]"
13444887Schin USAGE_LICENSE
13454887Schin "[+NAME?\b\f?\f\b - Shell, the standard command language interpreter]"
13464887Schin "[+DESCRIPTION?\b\f?\f\b is a command language interpreter that "
13474887Schin 	"executes commands read from a command line string, the "
13484887Schin 	"standard input, or a specified file.]"
13494887Schin "[+?If the \b-i\b option is present, or there are no \aarg\as and "
13504887Schin 	"the standard input and standard error are attached to a "
13514887Schin 	"terminal, the shell is considered to be interactive.]"
13524887Schin "[+?The \b-s\b and \b-c\b options are mutually exclusive.  If the \b-c\b "
13534887Schin 	"option is specified, the first \aarg\a is the command-line string "
13544887Schin 	"and must be specified.  Any remaining \aarg\as will be used "
13554887Schin 	"to initialize \b$0\b and positional parameters.]"
13564887Schin "[+?If the neither \b-s\b nor \b-c\b is specified, then the first \barg\b "
13574887Schin 	"will be the pathname of the file containing commands and \b$0\b "
13584887Schin 	"will be set to this value.  If there is no file with this pathname, "
13594887Schin 	"and this pathame does not contain a \b/\b, then the \bPATH\b "
13604887Schin 	"will be searched for an executable with this name.  Any remaining "
13614887Schin 	"\aarg\as will be used to initialize the positional parmaeters.]"
13624887Schin "[+?Any option can use a \b+\b instead of a \b-\b to disable the corresponding "
13634887Schin 	"option.]"
13644887Schin "[c?Read the commands from the first \aarg\a.]"
13654887Schin "[i?Specifies that the shell is interactive.]"
13664887Schin "[l?Invoke the shell as a login shell; \b/etc/profile\b and \b$HOME/.profile\b, "
13674887Schin 	"if they exist, are read before the first command.]"
13684887Schin "[r\f:restricted\f?Invoke the shell in a restricted mode.  A restricted "
13694887Schin 	"shell does not permit any of the following:]{"
13704887Schin 	"[+-?Changing the working directory.]"
13714887Schin 	"[+-?Setting values or attributes of the variables \bSHELL\b, "
13724887Schin 		"\bENV\b, \bFPATH\b, or \bPATH\b.]"
13734887Schin 	"[+-?Executing any command whose name as a \b/\b in it.]"
13744887Schin 	"[+-?Redirecting output of a command with \b>\b, \b>|\b, "
13754887Schin 		"\b<>\b, or \b>>\b.]"
13764887Schin 	"[+-?Adding or deleting built-in commands or libraries with "
13774887Schin 		"\bbuiltin\b.]"
13784887Schin 	"[+-?Executing \bcommand -p\b \a...\a .]"
13794887Schin 	"}"
13804887Schin "[s?Read the commands from standard input.  The positional parameters will be "
13814887Schin 	"initialized from \aarg\a.]"
13824887Schin "[D\f:dump-strings\f?Do not execute the script, but output the set of double "
13834887Schin 	"quoted strings preceded by a \b$\b.  These strings are needed for "
13844887Schin 	"localization of the script to different locales.]"
13858462SApril.Chin@Sun.COM "[E?Reads the file "
13868462SApril.Chin@Sun.COM #if SHOPT_SYSRC
13878462SApril.Chin@Sun.COM 	"\b/etc/ksh.kshrc\b, if it exists, as a profile, followed by "
13888462SApril.Chin@Sun.COM #endif
13898462SApril.Chin@Sun.COM 	"\b${ENV-$HOME/.kshrc}\b, if it exists, as a profile. "
13904887Schin 	"On by default for interactive shells; use \b+E\b to disable.]"
13914887Schin #if SHOPT_PFSH
13924887Schin "[P?Invoke the shell as a profile shell.  See \bpfexec\b(1).]"
13934887Schin #endif
13944887Schin #if SHOPT_KIA
13954887Schin "[R]:[file?Do not execute the script, but create a cross reference database "
13968462SApril.Chin@Sun.COM 	"in \afile\a that can be used a separate shell script browser.  The "
13978462SApril.Chin@Sun.COM 	"-R option requires a script to be specified as the first operand.]"
13984887Schin #endif /* SHOPT_KIA */
139910898Sroland.mainz@nrubsig.org #if SHOPT_REGRESS
140010898Sroland.mainz@nrubsig.org "[I:regress]:[intercept?Enable the regression test \aintercept\a. Must be "
140110898Sroland.mainz@nrubsig.org 	"the first command line option(s).]"
140210898Sroland.mainz@nrubsig.org #endif
14034887Schin #if SHOPT_BASH
14044887Schin    "\fbash2\f"
14054887Schin #endif
14064887Schin "\fabc\f"
140710898Sroland.mainz@nrubsig.org "?"
140810898Sroland.mainz@nrubsig.org "[T?Enable implementation specific test code defined by mask.]#[mask]"
14094887Schin "\n"
14104887Schin "\n[arg ...]\n"
14114887Schin "\n"
14124887Schin "[+EXIT STATUS?If \b\f?\f\b executes command, the exit status will be that "
14134887Schin         "of the last command executed.  Otherwise, it will be one of "
14144887Schin         "the following:]{"
14154887Schin         "[+0?The script or command line to be executed consists entirely "
14164887Schin 		"of zero or more blank lines or comments.]"
14174887Schin         "[+>1-125?A noninteractive shell detected a syntax error, a variable "
14184887Schin 		"assignment error, or an error in a special built-in.]"
14194887Schin 	"[+126?\b-c\b and \b-s\b were not specified and the command script "
14204887Schin 		"was found on \bPATH\b but was not executable.]"
14214887Schin 	"[+127?\b-c\b and \b-s\b were not specified and the command script "
14224887Schin 		"corresponding to \aarg\a could not be found.]"
14234887Schin "}"
14244887Schin 
14254887Schin "[+SEE ALSO?\bset\b(1), \bbuiltin\b(1)]"
14264887Schin ;
14274887Schin const char sh_optset[] =
14284887Schin "+[-1c?\n@(#)$Id: set (AT&T Research) 1999-09-28 $\n]"
14294887Schin USAGE_LICENSE
14304887Schin "[+NAME?set - set/unset options and positional parameters]"
14314887Schin "[+DESCRIPTION?\bset\b sets or unsets options and positional parameters.  "
14324887Schin 	"Options that are specified with a \b-\b cause the options to "
14334887Schin 	"be set.  Options that are specified with a \b+\b cause the "
14344887Schin 	"option to be unset.]"
14354887Schin "[+?\bset\b without any options or arguments displays the names and "
14364887Schin 	"values of all shell variables in the order of the collation "
14374887Schin 	"sequence in the current locale.  The values are quoted so that "
14384887Schin 	"they are suitable for reinput to the shell.]"
14394887Schin "[+?If no \aarg\as are specified, not even the end of options argument \b--\b, "
14404887Schin 	"the positional parameters are unchanged.  Otherwise, unless "
14414887Schin 	"the \b-A\b options has been specified, the positional parameters "
14424887Schin 	"are replaced by the list of \aarg\as.  A first \aarg\a of "
14434887Schin 	"\b--\b is ignored when setting positional parameters.]"
14444887Schin "[+?For backward compatibility, a \bset\b command without any options "
14454887Schin 	"specified whose first \aarg\a is \b-\b will turn off "
14464887Schin 	"the \b-v\b and \b-x\b options.  If any additional \aarg\as "
14474887Schin 	"are specified, they will replace the positional parameters.]"
14484887Schin "[s?Sort the positional parameters.]"
14494887Schin "[A]:[name?Assign the arguments sequentially to the array named by \aname\a "
14504887Schin 	"starting at subscript 0 rather than to the positional parameters.]"
14514887Schin "\fabc\f"
14528462SApril.Chin@Sun.COM "[06:default?Restore all non-command line options to the default settings.]"
14538462SApril.Chin@Sun.COM "[07:state?List the current option state in the form of a \bset\b command "
14548462SApril.Chin@Sun.COM 	"that can be executed to restore the state.]"
14554887Schin "\n"
14564887Schin "\n[arg ...]\n"
14574887Schin "\n"
14584887Schin "[+EXIT STATUS?]{"
14594887Schin         "[+0?No errors occurred.]"
14604887Schin         "[+>0?An error occurred.]"
14614887Schin "}"
14624887Schin 
14634887Schin "[+SEE ALSO?\btypeset\b(1), \bshift\b(1)]"
14644887Schin ;
14654887Schin 
14664887Schin 
14674887Schin 
14684887Schin const char sh_optshift[] =
14694887Schin "[-1c?\n@(#)$Id: shift (AT&T Research) 1999-07-07 $\n]"
14704887Schin USAGE_LICENSE
14714887Schin "[+NAME?shift - shift positional parameters]"
14724887Schin "[+DESCRIPTION?\bshift\b is a shell special built-in that shifts the "
14734887Schin 	"positional parameters to the left by the number of places "
14744887Schin 	"defined by \an\a, or \b1\b if \an\a is omitted.  The number of "
14754887Schin 	"positional parameters remaining will be reduced by the "
14764887Schin 	"number of places that are shifted.]"
14774887Schin "[+?If \an\a is given, it will be evaluated as an arithmetic expression "
14784887Schin 	"to determinate the number of places to shift.  It is an error "
14794887Schin 	"to shift more than the number of positional parameters or a "
14804887Schin 	"negative number of places.]"
14814887Schin "\n"
14824887Schin "\n[n]\n"
14834887Schin "\n"
14844887Schin "[+EXIT STATUS?]{"
14854887Schin         "[+0?The positional parameters were successfully shifted.]"
14864887Schin         "[+>0?An error occurred.]"
14874887Schin "}"
14884887Schin "[+SEE ALSO?\bset\b(1)]"
14894887Schin ;
14904887Schin 
14914887Schin const char sh_optsleep[] =
149210898Sroland.mainz@nrubsig.org "[-1c?\n@(#)$Id: sleep (AT&T Research) 2009-03-12 $\n]"
14934887Schin USAGE_LICENSE
14944887Schin "[+NAME?sleep - suspend execution for an interval]"
14954887Schin "[+DESCRIPTION?\bsleep\b suspends execution for at least the time specified "
149610898Sroland.mainz@nrubsig.org 	"by \aduration\a or until a \bSIGALRM\b signal is received. "
149710898Sroland.mainz@nrubsig.org 	"\aduration\a may be one of the following:]"
149810898Sroland.mainz@nrubsig.org "{"
149910898Sroland.mainz@nrubsig.org 	"[+integer?The number of seconds to sleep.]"
150010898Sroland.mainz@nrubsig.org 	"[+floating point?The number of seconds to sleep. The actual "
150110898Sroland.mainz@nrubsig.org 		"granularity depends on the underlying system, normally "
150210898Sroland.mainz@nrubsig.org 		"around 1 millisecond.]"
150310898Sroland.mainz@nrubsig.org 	"[+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 "
150410898Sroland.mainz@nrubsig.org 		"where at least one of the duration parts must be specified.]"
150510898Sroland.mainz@nrubsig.org 	"[+P\an\a\bW?An ISO 8601 duration specifying \an\a weeks.]"
150610898Sroland.mainz@nrubsig.org 	"[+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 "
150710898Sroland.mainz@nrubsig.org 		"ISO 8601 duration except that \bM\b specifies months, \bm\b before \bs\b or \bS\b "
150810898Sroland.mainz@nrubsig.org 		"specifies minutes and after specifies milliseconds, \bu\b or \bU\b specifies "
150910898Sroland.mainz@nrubsig.org 		"microseconds, and \bn\b specifies nanoseconds.]"
151010898Sroland.mainz@nrubsig.org 	"[+date/time?Sleep until the \bdate\b(1) compatible date/time.]"
151110898Sroland.mainz@nrubsig.org "}"
151210898Sroland.mainz@nrubsig.org "[s?Sleep until a signal or a timeout is received. If \aduration\a is omitted "
151310898Sroland.mainz@nrubsig.org 	"or 0 then no timeout will be used.]"
15144887Schin "\n"
151510898Sroland.mainz@nrubsig.org "\n[ duration ]\n"
15164887Schin "\n"
15174887Schin "[+EXIT STATUS?]{"
151810898Sroland.mainz@nrubsig.org 	"[+0?The execution was successfully suspended for at least \aduration\a "
151910898Sroland.mainz@nrubsig.org 	"or a \bSIGALRM\b signal was received.]"
15204887Schin 	"[+>0?An error occurred.]"
15214887Schin "}"
152210898Sroland.mainz@nrubsig.org "[+SEE ALSO?\bdate\b(1), \btime\b(1), \bwait\b(1)]"
15234887Schin ;
15244887Schin 
15254887Schin const char sh_opttrap[] =
15264887Schin "[-1c?\n@(#)$Id: trap (AT&T Research) 1999-07-17 $\n]"
15274887Schin USAGE_LICENSE
15284887Schin "[+NAME?trap - trap signals and conditions]"
15294887Schin "[+DESCRIPTION?\btrap\b is a special built-in that defines actions to be "
15304887Schin 	"taken when conditions such as receiving a signal occur.  Also, "
15314887Schin 	"\btrap\b can be used to display the current trap settings on "
15324887Schin 	"standard output.]"
15334887Schin "[+?If \aaction\a is \b-\b, \btrap\b resets each \acondition\a "
15344887Schin 	"to the default value.  If \aaction\a is an empty string, the "
15354887Schin 	"shell ignores each of the \acondition\as if they arise. "
15364887Schin 	"Otherwise, the argument \aaction\a will be read and executed "
15374887Schin 	"by the shell as if it were processed by \beval\b(1) when one "
15384887Schin 	"of the corresponding conditions arise.  The action of the trap "
15394887Schin 	"will override any previous action associated with each specified "
15404887Schin 	"\acondition\a.  The value of \b$?\b is not altered by the trap "
15414887Schin 	"execution.]"
15424887Schin "[+?\acondition\a can be the name or number of a signal, or one of the "
15434887Schin 	"following:]{"
15444887Schin 	"[+EXIT?This trap is executed when the shell exits.  If defined "
15454887Schin 		"within a function defined with the \bfunction\b reserved "
15464887Schin 		"word, the trap is executed in the caller's environment "
15474887Schin 		"when the function returns and the trap action is restored "
15484887Schin 		"to the value it had when it called the function.]"
15494887Schin 	"[+0?Same as EXIT.]"
15504887Schin 	"[+DEBUG?Executed before each simple command is executed but after "
15514887Schin 		"the arguments are expanded.]"
15524887Schin 	"[+ERR?Executed whenever \bset -e\b would cause the shell to exit.]"
15534887Schin 	"[+KEYBD?Executed when a key is entered from a terminal device.]"
15544887Schin "}"
15554887Schin "[+?Signal names are case insensitive and the \bsig\b prefix is optional.  "
15564887Schin 	"Signals that were ignored on entry to a noninteractive shell cannot "
15574887Schin 	"trapped or reset although doing so will not report an error.  The "
15584887Schin 	"use of signal numbers other than \b1\b, \b2\b, \b3\b, \b6\b, "
15594887Schin 	"\b9\b, \b14\b, and \b15\b is not portable.]"
15604887Schin "[+?Although \btrap\b is a special built-in, specifying a condition that "
15614887Schin 	"the shell does not know about causes \btrap\b to exit with a "
15624887Schin 	"non-zero exit status, but does not terminate the invoking shell.]"
15634887Schin "[+?If no \aaction\a or \acondition\as are specified then all the current "
15644887Schin 	"trap settings are written to standard output.]"
15654887Schin "[p?Causes the current traps to be output in a format that can be processed "
15664887Schin 	"as input to the shell to recreate the current traps.]"
15674887Schin "\n"
15684887Schin "\n[action condition ...]\n"
15694887Schin "\n"
15704887Schin "[+EXIT STATUS?]{"
15714887Schin         "[+0?Successful completion.]"
15724887Schin         "[+>0?An error occurred.]"
15734887Schin "}"
15744887Schin 
15754887Schin "[+SEE ALSO?\bkill\b(1), \beval\b(1), \bsignal\b(3)]"
15764887Schin ;
15774887Schin 
15784887Schin const char sh_opttypeset[] =
15798462SApril.Chin@Sun.COM "+[-1c?\n@(#)$Id: typeset (AT&T Research) 2008-08-04 $\n]"
15804887Schin USAGE_LICENSE
15814887Schin "[+NAME?\f?\f - declare or display variables with attributes]"
15824887Schin "[+DESCRIPTION?Without the \b-f\b option, \b\f?\f\b sets, unsets, "
15834887Schin 	"or displays attributes of variables as specified with the "
15844887Schin 	"options.  If the first option is specified with a \b-\b "
15854887Schin 	"then the attributes are set for each of the given \aname\as. "
15864887Schin 	"If the first option is specified with a \b+\b, then the specified "
15874887Schin 	"attributes are unset.  If \b=\b\avalue\a is specified value is "
15884887Schin 	"assigned before the attributes are set.]"
15894887Schin "[+?When \b\f?\f\b is called inside a function defined with the "
15904887Schin 	"\bfunction\b reserved word, and \aname\a does not contain a "
15914887Schin 	"\b.\b, then a local variable statically scoped to  that function "
15924887Schin 	"will be created.]"
15934887Schin "[+?Not all option combinations are possible.  For example, the numeric "
15944887Schin 	"options \b-i\b, \b-E\b, and \b-F\b cannot be specified with "
15954887Schin 	"the justification options \b-L\b, \b-R\b, and \b-Z\b.]"
15964887Schin "[+?Note that the following preset aliases are set by the shell:]{"
159710898Sroland.mainz@nrubsig.org 	"[+compound?\b\f?\f -C\b.]"
159810898Sroland.mainz@nrubsig.org 	"[+float?\b\f?\f -lE\b.]"
15994887Schin 	"[+functions?\b\f?\f -f\b.]"
160010898Sroland.mainz@nrubsig.org 	"[+integer?\b\f?\f -li\b.]"
16014887Schin 	"[+nameref?\b\f?\f -n\b.]"
16024887Schin "}"
16034887Schin "[+?If no \aname\as are specified then variables that have the specified "
16044887Schin 	"options are displayed.  If the first option is specified with "
16054887Schin 	"a leading \b-\b then the name and value of each variable is "
16064887Schin 	"written to standard output.  Otherwise, only the names are "
16074887Schin 	"written.  If no options are specified or just \b-p\b is "
16084887Schin 	"specified, then the names and attributes of all variables that have "
16094887Schin 	"attributes are written to standard output.  When \b-f\b is specified, "
16104887Schin 	"the names displayed will be function names.]"
16114887Schin "[+?If \b-f\b is specified, then each \aname\a refers to a function "
16124887Schin 	"and the only valid options are \b-u\b and \b-t\b.  In this "
16134887Schin 	"case no \b=\b\avalue\a can be specified.]"
16144887Schin "[+?\b\f?\f\b is built-in to the shell as a declaration command so that "
16154887Schin 	"field splitting and pathname expansion are not performed on "
16164887Schin 	"the arguments.  Tilde expansion occurs on \avalue\a.]"
16178462SApril.Chin@Sun.COM #if 1
16188462SApril.Chin@Sun.COM "[a]:?[type?Indexed array.  This is the default. If \b[\b\atype\a\b]]\b is "
16198462SApril.Chin@Sun.COM     "specified, each subscript is interpreted as a value of type \atype\a.]"
16208462SApril.Chin@Sun.COM #else
16218462SApril.Chin@Sun.COM "[a?Indexed array. this is the default.]"
16224887Schin #endif
16234887Schin "[b?Each \aname\a may contain binary data.  Its value is the mime "
16244887Schin 	"base64 encoding of the data. It can be used with \b-Z\b, "
16254887Schin 	"to specify fixed sized fields.]"
16264887Schin "[f?Each of the options and \aname\as refers to a function.]"
16274887Schin "[i]#?[base:=10?An integer. \abase\a represents the arithmetic base "
16284887Schin 	"from 2 to 64.]"
16294887Schin "[l?Convert uppercase character to lowercase.  Unsets \b-u\b attribute.  When "
16304887Schin 	"used with \b-i\b, \b-E\b, or \b-F\b indicates long variant.]"
16318462SApril.Chin@Sun.COM "[m?Move.  The value is the name of a variable whose value will be "
16328462SApril.Chin@Sun.COM 	"moved to \aname\a.  The orignal variable will be unset.  Cannot be "
16338462SApril.Chin@Sun.COM 	"used with any other options.]"
16344887Schin "[n?Name reference.  The value is the name of a variable that \aname\a "
16358462SApril.Chin@Sun.COM 	"references.  \aname\a cannot contain a \b.\b.  Cannot be use with "
16368462SApril.Chin@Sun.COM 	"any other options.]"
16374887Schin "[p?Causes the output to be in a format that can be used as input to the "
16384887Schin 	"shell to recreate the attributes for variables.]"
16394887Schin "[r?Enables readonly.  Once enabled it cannot be disabled.  See "
16404887Schin 	"\breadonly\b(1).]"
16414887Schin "[s?Used with \b-i\b to restrict integer size to short.]"
16424887Schin "[t?When used with \b-f\b, enables tracing for each of the specified "
16434887Schin 	"functions.  Otherwise, \b-t\b is a user defined attribute and "
16444887Schin 	"has no meaning to the shell.]"
16454887Schin "[u?Without \b-f\b or \b-i\b, converts lowercase character to uppercase "
16464887Schin 	"and unsets \b-l\b.  With \b-f\b specifies that \aname\a is a function "
16474887Schin 	"that hasn't been loaded yet.  With \b-i\b specifies that the "
16484887Schin 	"value will be displayed as an unsigned integer.]"
16494887Schin "[x?Puts each \aname\a on the export list.  See \bexport\b(1).  \aname\a "
16504887Schin 	"cannot contain a \b.\b.]"
16514887Schin "[A?Associative array.  Each \aname\a will converted to an associate "
16524887Schin 	"array.  If a variable already exists, the current value will "
16534887Schin 	"become index \b0\b.]"
16548462SApril.Chin@Sun.COM "[C?Compound variable.  Each \aname\a will be a compound variable.  If "
16558462SApril.Chin@Sun.COM 	"\avalue\a names a compound variable it will be copied to \aname\a. "
16568462SApril.Chin@Sun.COM 	"Otherwise if the variable already exists, it will first be unset.]"
16574887Schin "[E]#?[n:=10?Floating point number represented in scientific notation. "
16584887Schin 	"\an\a specifies the number of significant figures when the "
16594887Schin 	"value is expanded.]"
16604887Schin "[F]#?[n:=10?Floating point.  \an\a is the number of places after the "
16614887Schin 	"decimal point when the value is expanded.]"
16624887Schin "[H?Hostname mapping.  Each \aname\a holds a native pathname.  Assigning a "
16634887Schin 	"UNIX format pathname will cause it to be converted to a pathname "
16644887Schin 	"suitable for the current host.  This has no effect when the "
16654887Schin 	"native system is UNIX.]"
16664887Schin "[L]#?[n?Left justify.  If \an\a is given it represents the field width.  If "
16674887Schin 	"the \b-Z\b attribute is also specified, then leading zeros are "
16684887Schin 	"stripped.]"
16694887Schin "[R]#?[n?Right justify.  If \an\a is given it represents the field width.  If "
16704887Schin 	"the \b-Z\b attribute is also specified, then zeros will "
16714887Schin 	"be used as the fill character.  Otherwise, spaces are used.]"
167210898Sroland.mainz@nrubsig.org "[X]#?[n:=2*sizeof(long long)?Floating point number represented in hexadecimal "
167310898Sroland.mainz@nrubsig.org 	"notation.  \an\a specifies the number of significant figures when the "
16748462SApril.Chin@Sun.COM 	"value is expanded.]"
16758462SApril.Chin@Sun.COM 
16768462SApril.Chin@Sun.COM #ifdef SHOPT_TYPEDEF
16778462SApril.Chin@Sun.COM "[h]:[string?Used within a type definition to provide a help string  "
16788462SApril.Chin@Sun.COM 	"for variable \aname\a.  Otherwise, it is ignored.]"
16798462SApril.Chin@Sun.COM "[S?Used with a type definition to indicate that the variable is shared by "
16808462SApril.Chin@Sun.COM 	"each instance of the type.  When used inside a function defined "
16818462SApril.Chin@Sun.COM 	"with the \bfunction\b reserved word, the specified variables "
16828462SApril.Chin@Sun.COM 	"will have function static scope.  Otherwise, the variable is "
16838462SApril.Chin@Sun.COM 	"unset prior to processing the assignment list.]"
16848462SApril.Chin@Sun.COM #endif
16854887Schin "[T]:[tname?\atname\a is the name of a type name given to each \aname\a.]"
16864887Schin "[Z]#?[n?Zero fill.  If \an\a is given it represents the field width.]"
16874887Schin "\n"
16884887Schin "\n[name[=value]...]\n"
16894887Schin " -f [name...]\n"
16904887Schin "\n"
16914887Schin "[+EXIT STATUS?]{"
16924887Schin         "[+0?No errors occurred.]"
16934887Schin         "[+>0?An error occurred.]"
16944887Schin "}"
16954887Schin 
16964887Schin "[+SEE ALSO?\breadonly\b(1), \bexport\b(1)]"
16974887Schin ;
16984887Schin 
16994887Schin const char sh_optulimit[] =
17004887Schin "[-1c?@(#)$Id: ulimit (AT&T Research) 2003-06-21 $\n]"
17014887Schin USAGE_LICENSE
17024887Schin "[+NAME?ulimit - set or display resource limits]"
17034887Schin "[+DESCRIPTION?\bulimit\b sets or displays resource limits.  These "
17044887Schin 	"limits apply to the current process and to each child process "
17054887Schin 	"created after the resource limit has been set.  If \alimit\a "
17064887Schin 	"is specified, the resource limit is set, otherwise, its current value "
17074887Schin 	"is displayed on standard output.]"
17084887Schin "[+?Increasing the limit for a resource usually requires special privileges.  "
17094887Schin 	"Some systems allow you to lower resource limits and later increase "
17104887Schin 	"them.  These are called soft limits.  Once a hard limit is "
17114887Schin 	"set the resource can not be increased.]"
17124887Schin "[+?Different systems allow you to specify different resources and some "
17134887Schin 	"restrict how much you can raise the limit of the resource.]"
17144887Schin "[+?The value of \alimit\a depends on the unit of the resource listed "
17154887Schin 	"for each resource.  In addition, \alimit\a can be \bunlimited\b "
17164887Schin 	"to indicate no limit for that resource.]"
17174887Schin "[+?If you do not specify \b-H\b or \b-S\b, then \b-S\b is used for "
17184887Schin 	"listing and both \b-S\b and \b-H\b are used for setting resources.]"
17194887Schin "[+?If you do not specify any resource, the default is \b-f\b.]"
17204887Schin "[H?A hard limit is set or displayed.]"
17214887Schin "[S?A soft limit is set or displayed.]"
17224887Schin "[a?Displays all current resource limits]"
17234887Schin "\flimits\f"
17244887Schin "\n"
17254887Schin "\n[limit]\n"
17264887Schin "\n"
17274887Schin "[+EXIT STATUS?]{"
17284887Schin 	"[+0?Successful completion.]"
17294887Schin 	"[+>0?A request for a higher limit was rejected or an error occurred.]"
17304887Schin "}"
17314887Schin 
17324887Schin "[+SEE ALSO?\bulimit\b(2), \bgetrlimit\b(2)]"
17334887Schin ;
17344887Schin 
17354887Schin const char sh_optumask[] =
17364887Schin "[-1c?\n@(#)$Id: umask (AT&T Research) 1999-04-07 $\n]"
17374887Schin USAGE_LICENSE
17384887Schin "[+NAME?umask - get or set the file creation mask]"
17394887Schin "[+DESCRIPTION?\bumask\b sets the file creation mask of the current "
17404887Schin 	"shell execution environment to the value specified by the "
17414887Schin 	"\amask\a operand.  This mask affects the file permission bits "
17424887Schin 	"of subsequently created files.  \amask\a can either be an "
17434887Schin 	"octal number or a symbolic value as described in \bchmod\b(1).  "
17444887Schin 	"If a symbolic value is given, the new file creation mask is the "
17454887Schin 	"complement of the result of applying \amask\a to the complement "
17464887Schin 	"of the current file creation mask.]"
17474887Schin "[+?If \amask\a is not specified, \bumask\b writes the value of the "
17484887Schin 	"file creation mask for the current process to standard output.]"
17494887Schin "[S?Causes the file creation mask to be written or treated as a symbolic value "
17504887Schin 	"rather than an octal number.]"
17514887Schin "\n"
17524887Schin "\n[mask]\n"
17534887Schin "\n"
17544887Schin "[+EXIT STATUS?]{"
17554887Schin 	"[+0?The file creation mask was successfully changed, or no "
17564887Schin 		"\amask\a operand was supplied.]"
17574887Schin 	"[+>0?An error occurred.]"
17584887Schin "}"
17594887Schin "[+SEE ALSO?\bchmod\b(1)]"
17604887Schin ;
17614887Schin const char sh_optuniverse[]	= " [name]";
17624887Schin const char sh_optunset[] =
17634887Schin "[-1c?\n@(#)$Id: unset (AT&T Research) 1999-07-07 $\n]"
17644887Schin USAGE_LICENSE
17654887Schin "[+NAME?unset - unset values and attributes of variables and functions]"
17664887Schin "[+DESCRIPTION?For each \aname\a specified, \bunset\b  unsets the variable, "
17674887Schin 	"or function if \b-f\b is specified, from the current shell "
17684887Schin 	"execution environment.  Readonly variables cannot be unset.]"
17694887Schin "[n?If \aname\a refers to variable that is a reference, the variable \aname\a "
17704887Schin 	"will be unset rather than the variable it references.  Otherwise, "
17714887Schin 	"is is equivalent to \b-v\b.]"
17724887Schin "[f?\aname\a refers to a function name and the shell will unset the "
17734887Schin 	"function definition.]"
17744887Schin "[v?\aname\a refers to a variable name and the shell will unset it and "
17754887Schin 	"remove it from the environment.  This is the default behavior.]"
17764887Schin "\n"
17774887Schin "\nname...\n"
17784887Schin "\n"
17794887Schin "[+EXIT STATUS?]{"
17804887Schin         "[+0?All \aname\as were successfully unset.]"
17814887Schin         "[+>0?One or more \aname\a operands could not be unset "
17824887Schin 	"or an error occurred.]"
17834887Schin "}"
17844887Schin 
17854887Schin "[+SEE ALSO?\btypeset\b(1)]"
17864887Schin ;
17874887Schin 
17884887Schin const char sh_optunalias[] =
17894887Schin "[-1c?\n@(#)$Id: unalias (AT&T Research) 1999-07-07 $\n]"
17904887Schin USAGE_LICENSE
17914887Schin "[+NAME?unalias - remove alias definitions]"
17924887Schin "[+DESCRIPTION?\bunalias\b removes the definition of each named alias "
17934887Schin 	"from the current shell execution environment, or all aliases if "
17944887Schin 	"\b-a\b is specified.  It will not affect any commands that "
17954887Schin 	"have already been read and subsequently executed.]"
17964887Schin "[a?Causes all alias definitions to be removed.  \aname\a operands "
17974887Schin 	"are optional and ignored in this case.]"
17984887Schin "\n"
17994887Schin "\nname...\n"
18004887Schin "\n"
18014887Schin "[+EXIT STATUS?]{"
18024887Schin         "[+0?Successful completion.]"
18034887Schin         "[+>0?\b-a\b was not specified and one or more \aname\a operands "
18044887Schin 	"did not have an alias definition, or an error occurred.]"
18054887Schin "}"
18064887Schin 
18074887Schin "[+SEE ALSO?\balias\b(1)]"
18084887Schin ;
18094887Schin 
18104887Schin const char sh_optwait[]	=
18114887Schin "[-1c?\n@(#)$Id: wait (AT&T Research) 1999-06-17 $\n]"
18124887Schin USAGE_LICENSE
18134887Schin "[+NAME?wait - wait for process or job completion]"
18144887Schin "[+DESCRIPTION?\bwait\b with no operands, waits until all jobs "
18154887Schin 	"known to the invoking shell have terminated.  If one or more "
18164887Schin 	"\ajob\a operands are specified, \bwait\b waits until all of them "
18174887Schin 	"have completed.]"
18184887Schin "[+?Each \ajob\a can be specified as one of the following:]{"
18194887Schin 	"[+\anumber\a?\anumber\a refers to a process id.]"
18204887Schin 	"[+-\anumber\a?\anumber\a refers to a process group id.]"
18214887Schin 	"[+%\anumber\a?\anumber\a refer to a job number.]"
18224887Schin 	"[+%\astring\a?Refers to a job whose name begins with \astring\a.]"
18234887Schin 	"[+%??\astring\a?Refers to a job whose name contains \astring\a.]"
18244887Schin 	"[+%+ \bor\b %%?Refers to the current job.]"
18254887Schin 	"[+%-?Refers to the previous job.]"
18264887Schin "}"
18274887Schin "[+?If one ore more \ajob\a operands is a process id or process group id "
18284887Schin 	"not known by the current shell environment, \bwait\b treats each "
18294887Schin 	"of them as if it were a process that exited with status 127.]"
18304887Schin "\n"
18314887Schin "\n[job ...]\n"
18324887Schin "\n"
18334887Schin "[+EXIT STATUS?If \await\a is invoked with one or more \ajob\as, and all of "
18344887Schin 	"them have terminated or were not known by the invoking shell, "
18354887Schin 	"the exit status of \bwait\b  will be that of the last \ajob\a.  "
18364887Schin 	"Otherwise, it will be one of the following:]{"
18374887Schin 	"[+0?\bwait\b utility was invoked with no operands and all "
18384887Schin 		"processes known by the invoking process have terminated.]"
18394887Schin 	"[+127?\ajob\a is a process id or process group id that is unknown "
18404887Schin 		"to the current shell environment.]"
18414887Schin "}"
18424887Schin 
18434887Schin "[+SEE ALSO?\bjobs\b(1), \bps\b(1)]"
18444887Schin ;
18454887Schin 
18464887Schin #if SHOPT_FS_3D
18474887Schin     const char sh_optvpath[]	= " [top] [base]";
18484887Schin     const char sh_optvmap[]	= " [dir] [list]";
18494887Schin #endif /* SHOPT_FS_3D */
18504887Schin 
18514887Schin const char sh_optwhence[] =
18528462SApril.Chin@Sun.COM "[-1c?\n@(#)$Id: whence (AT&T Research) 2007-04-24 $\n]"
18534887Schin USAGE_LICENSE
18544887Schin "[+NAME?whence - locate a command and describe its type]"
18554887Schin "[+DESCRIPTION?Without \b-v\b, \bwhence\b writes on standard output an "
18564887Schin 	"absolute pathname, if any, corresponding to \aname\a based "
18574887Schin 	"on the complete search order that the shell uses.  If \aname\a "
18584887Schin 	"is not found, then no output is produced.]"
18594887Schin "[+?If \b-v\b is specified, the output will also contain information "
18608462SApril.Chin@Sun.COM 	"that indicates how the given \aname\a would be interpreted by "
18614887Schin 	"the shell in the current execution environment.]"
18624887Schin "[a?Displays all uses for each \aname\a rather than the first.]"
18634887Schin "[f?Do not check for functions.]"
18644887Schin "[p?Do not check to see if \aname\a is a reserved word, a built-in, "
18658462SApril.Chin@Sun.COM 	"an alias, or a function.  This turns off the \b-v\b option.]"
18668462SApril.Chin@Sun.COM "[q?Quiet mode. Returns 0 if all arguments are built-ins, functions, or are "
18678462SApril.Chin@Sun.COM 	"programs found on the path.]"
18684887Schin "[v?For each name you specify, the shell displays a line that indicates "
18694887Schin 	"if that name is one of the following:]{"
18704887Schin 	"[+?Reserved word]"
18714887Schin 	"[+?Alias]"
18724887Schin 	"[+?Built-in]"
18734887Schin 	"[+?Undefined function]"
18744887Schin 	"[+?Function]"
18754887Schin 	"[+?Tracked alias]"
18764887Schin 	"[+?Program]"
18774887Schin "}"
18784887Schin "\n"
18794887Schin "\nname  ...\n"
18804887Schin "\n"
18814887Schin "[+EXIT STATUS?]{"
18824887Schin 	"[+0?Each \aname\a was found by the shell.]"
18834887Schin 	"[+1?One or more \aname\as were not found by the shell.]"
18844887Schin 	"[+>1?An error occurred.]"
18854887Schin "}"
18864887Schin 
18874887Schin "[+SEE ALSO?\bcommand\b(1)]"
18884887Schin ;
18894887Schin 
18904887Schin 
18914887Schin const char e_alrm1[]		= "alarm -r %s +%.3g\n";
18924887Schin const char e_alrm2[]		= "alarm %s %.3f\n";
18934887Schin const char e_baddisc[]		= "%s: invalid discipline function";
18944887Schin const char e_nospace[]		= "out of memory";
18954887Schin const char e_nofork[]		= "cannot fork";
18964887Schin const char e_nosignal[]		= "%s: unknown signal name";
18974887Schin const char e_condition[]	= "condition(s) required";
18984887Schin const char e_cneedsarg[]	= "-c requires argument";
1899