summaryrefslogtreecommitdiff
path: root/usr/src/lib/libshell/common/data/builtins.c
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2009-10-28 10:36:39 -0700
committerRoland Mainz <roland.mainz@nrubsig.org>2009-10-28 10:36:39 -0700
commit34f9b3eef6fdadbda0a846aa4d68691ac40eace5 (patch)
tree0b0fdfb35f8eb9324728de5a99e50e939aca650f /usr/src/lib/libshell/common/data/builtins.c
parent14969419acb89bb74e6c95fa472119b710224440 (diff)
downloadillumos-joyent-34f9b3eef6fdadbda0a846aa4d68691ac40eace5.tar.gz
Portions contributed by Olga Kryzhanovska <olga.kryzhanovska@gmail.com>
PSARC/2009/063 ksh93 update 2 PSARC/2009/248 ksh93 update to 2009-03-10 PSARC/2009/249 more ksh93 command conversions 6888396 libast sources should not include localedef.h 6605478 ksh93 profile shell option does not work 6631006 ksh93 hangs in situations that ksh handles okay 6661487 logname reports nothing after running the script command 6705126 first call to read doesn't honor new setting of HISTFILE 6764665 *libpp* Array overrun in libpp 6765756 *libast* Array overruns in libast 6769332 Recursive function+command substitutions terminate shell after 257 iterations 6777491 *ksh93* lacks arithmetric function iszero() 6778077 *ksh93* does not understand "THAW" as a signal for use with trap 6789247 [ku1] libast/ksh93 1-digit hexfloat base conversion rounds incorrectly 6791838 *ksh93* unset of a variable which is not set should return 0 6793714 RFE: Update /usr/bin/comm to AT&T AST "comm" 6793719 RFE: Update /usr/bin/cut to AT&T AST "cut" 6793721 RFE: Update /usr/bin/paste to AT&T AST "paste" 6793722 RFE: Update /usr/bin/cmp to AT&T AST "cmp" 6793726 RFE: Update /usr/bin/uniq to AT&T AST "uniq" 6793735 RFE: Update /usr/bin/wc to AT&T AST "wc" 6793744 RFE: Add /usr/share/doc/ksh/ for ksh93 documentation 6793747 RFE: Provide "print" builtin as /usr/bin/print for external applications 6793763 RFE: Update /usr/bin/ksh93 to ast-ksh.2009-05-05 6794952 RFE: Enable "globstar" mode in /etc/ksh.kshrc (= interactive ksh93 shells) 6805792 [ku1] Moving local compound var into array does not work 6805794 [ku1] printf returns "invalid character constant" for $ printf "%d\n" "'<euro>" 6805795 [ku1] ksh93 does not differ between -0 and +0 6805797 [ku1]Can't append to nodes of an array of compound vars if addressing them via nameref 6805799 Indexed compound variable arrays do not work... 6805800 [ku1] Declaring associative compound array does not work 6805813 RFE: Update /usr/bin/join to AT&T AST "join". 6805819 RFE: Update /usr/bin/tee to AT&T AST "tee". 6809663 shlint missing ending newline on errors 6811916 ksh93 repeatedly segfaults when "tee" builtin is interrupted via <ctrl-c> in interactive mode 6821113 SUNWosdem package issues 6828644 RFE: Update /usr/bin/logname to AT&T AST "logname". 6828692 RFE: Update /usr/bin/cksum to AT&T AST "cksum". 6834184 ksh93 gets SIGSEGV if HISTFILE is changed in place. 6834207 ksh93 gets SIGSEGV on interactive function definition with HISTSIZE unset 6835835 ksh93 "cat" builtin does not handle "-n" correctly 6841442 Need exception list for OS/Net trees managed via Subversion 6848486 "echo ${test}" with test undefined crashes the shell 6850672 ksh93 (VISUAL=vi) crashes with memory fault while scrolling through history 6855875 typeset -X x ; print $x # does not print sufficient digits to restore value 6857344 /usr/bin/hash core dump with invalid arguments 6866676 Need test suite module to test the kernel support for compiled shell scripts 6881017 Subshell doesn't exit, holds pipe open preventing callers from exiting 6884409 fts functions in libast library can result in segv with deep dir trees (similar to CERT VU#590371)
Diffstat (limited to 'usr/src/lib/libshell/common/data/builtins.c')
-rw-r--r--usr/src/lib/libshell/common/data/builtins.c73
1 files changed, 51 insertions, 22 deletions
diff --git a/usr/src/lib/libshell/common/data/builtins.c b/usr/src/lib/libshell/common/data/builtins.c
index dad24caf31..94b34c77dd 100644
--- a/usr/src/lib/libshell/common/data/builtins.c
+++ b/usr/src/lib/libshell/common/data/builtins.c
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -139,6 +139,9 @@ const struct shtable3 shtab_builtins[] =
CMDLIST(wc)
CMDLIST(sync)
#endif
+#if SHOPT_REGRESS
+ "__regress__", NV_BLTIN|BLT_ENV, bltin(__regress__),
+#endif
"", 0, 0
};
@@ -677,6 +680,7 @@ USAGE_LICENSE
"\aflags\a with optional \anumber\a values may be specified to control "
"option parsing. "
"The flags are:]{"
+ "[++?Arguments beginning with + are considered options.]"
"[+c?Cache this \aoptstring\a for multiple passes. Used to optimize "
"builtins that may be called many times within the same process.]"
"[+i?Ignore this \aoptstring\a when generating help. Used when "
@@ -737,9 +741,7 @@ USAGE_LICENSE
"[+8.?A group of the form [-\aname\a?\atext\a]] specifies entries "
"for the \bIMPLEMENTATION\b section.]"
"}"
-"[+?If the leading character of \aoptstring\a is +, then arguments "
- "beginning with + will also be considered options.]"
-"[+?A leading : character or a : following a leading + in \aoptstring\a "
+"[+?A leading : character in \aoptstring\a "
"affects the way errors are handled. If an option character or longname "
"argument not specified in \aoptstring\a is encountered when processing "
"options, the shell variable whose name is \aname\a will be set to the ? "
@@ -750,6 +752,8 @@ USAGE_LICENSE
"Without the leading :, \aname\a will be set to the ? character, \bOPTARG\b "
"will be unset, and an error message will be written to standard error "
"when errors are encountered.]"
+"[+?A leading + character or a + following a leading : in \aoptstring\a "
+ "specifies that arguments beginning with + will also be considered options.]"
"[+?The end of options occurs when:]{"
"[+1.?The special argument \b--\b is encountered.]"
"[+2.?An argument that does not begin with a \b-\b is encountered.]"
@@ -1060,7 +1064,7 @@ USAGE_LICENSE
;
const char sh_optprint[] =
-"[-1c?\n@(#)$Id: print (AT&T Research) 1999-04-07 $\n]"
+"[-1c?\n@(#)$Id: print (AT&T Research) 2008-11-26 $\n]"
USAGE_LICENSE
"[+NAME?print - write arguments to standard output]"
"[+DESCRIPTION?By default, \bprint\b writes each \astring\a operand to "
@@ -1102,6 +1106,8 @@ USAGE_LICENSE
"[u]:[fd:=1?Write to file descriptor number \afd\a instead of standard output.]"
"[v?Treat each \astring\a as a variable name and write the value in \b%B\b "
"format. Cannot be used with \b-f\b.]"
+"[C?Treat each \astring\a as a variable name and write the value in \b%#B\b "
+ "format. Cannot be used with \b-f\b.]"
"\n"
"\n[string ...]\n"
"\n"
@@ -1113,7 +1119,7 @@ USAGE_LICENSE
;
const char sh_optprintf[] =
-"[-1c?\n@(#)$Id: printf (AT&T Research) 2006-10-26 $\n]"
+"[-1c?\n@(#)$Id: printf (AT&T Research) 2009-02-02 $\n]"
USAGE_LICENSE
"[+NAME?printf - write formatted output]"
"[+DESCRIPTION?\bprintf\b writes each \astring\a operand to "
@@ -1161,7 +1167,7 @@ USAGE_LICENSE
"in the underlying code set of the character following the "
"\b\"\b or \b'\b. Otherwise, \astring\a is treated like a shell "
"arithmetic expression and evaluated.]"
-"[+?If a \astring\a operand cannot be completed converted into a value "
+"[+?If a \astring\a operand cannot be completely converted into a value "
"appropriate for that format specifier, an error will occur, "
"but remaining \astring\a operands will continue to be processed.]"
"[+?In addition to the format specifier extensions, the following "
@@ -1174,8 +1180,10 @@ USAGE_LICENSE
"[+-?The escape sequence \b\\x{\b\ahex\a\b}\b expands to the "
"character corresponding to the hexidecimal value \ahex\a.]"
"[+-?The format modifier flag \b=\b can be used to center a field to "
- "a specified width. When the output is a terminal, the "
- "character width is used rather than the number of bytes.]"
+ "a specified width.]"
+ "[+-?The format modifier flag \bL\b can be used with the \bc\b and "
+ "\bs\b formats to treat precision as character width instead "
+ "of byte count.]"
"[+-?Each of the integral format specifiers can have a third "
"modifier after width and precision that specifies the "
"base of the conversion from 2 to 64. In this case the "
@@ -1388,10 +1396,16 @@ USAGE_LICENSE
"in \afile\a that can be used a separate shell script browser. The "
"-R option requires a script to be specified as the first operand.]"
#endif /* SHOPT_KIA */
+#if SHOPT_REGRESS
+"[I:regress]:[intercept?Enable the regression test \aintercept\a. Must be "
+ "the first command line option(s).]"
+#endif
#if SHOPT_BASH
"\fbash2\f"
#endif
"\fabc\f"
+"?"
+"[T?Enable implementation specific test code defined by mask.]#[mask]"
"\n"
"\n[arg ...]\n"
"\n"
@@ -1475,23 +1489,37 @@ USAGE_LICENSE
;
const char sh_optsleep[] =
-"[-1c?\n@(#)$Id: sleep (AT&T Research) 1999-04-07 $\n]"
+"[-1c?\n@(#)$Id: sleep (AT&T Research) 2009-03-12 $\n]"
USAGE_LICENSE
"[+NAME?sleep - suspend execution for an interval]"
"[+DESCRIPTION?\bsleep\b suspends execution for at least the time specified "
- "by \aseconds\a or until a \bSIGALRM\b signal is received. "
- "\aseconds\a can be specified as a floating point number but the "
- "actual granularity depends on the underlying system, normally "
- "around 1 millisecond.]"
+ "by \aduration\a or until a \bSIGALRM\b signal is received. "
+ "\aduration\a may be one of the following:]"
+"{"
+ "[+integer?The number of seconds to sleep.]"
+ "[+floating point?The number of seconds to sleep. The actual "
+ "granularity depends on the underlying system, normally "
+ "around 1 millisecond.]"
+ "[+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 "
+ "where at least one of the duration parts must be specified.]"
+ "[+P\an\a\bW?An ISO 8601 duration specifying \an\a weeks.]"
+ "[+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 "
+ "ISO 8601 duration except that \bM\b specifies months, \bm\b before \bs\b or \bS\b "
+ "specifies minutes and after specifies milliseconds, \bu\b or \bU\b specifies "
+ "microseconds, and \bn\b specifies nanoseconds.]"
+ "[+date/time?Sleep until the \bdate\b(1) compatible date/time.]"
+"}"
+"[s?Sleep until a signal or a timeout is received. If \aduration\a is omitted "
+ "or 0 then no timeout will be used.]"
"\n"
-"\nseconds\n"
+"\n[ duration ]\n"
"\n"
"[+EXIT STATUS?]{"
- "[+0?The execution was successfully suspended for at least \atime\a "
- "seconds, or a \bSIGALRM\b signal was received.]"
+ "[+0?The execution was successfully suspended for at least \aduration\a "
+ "or a \bSIGALRM\b signal was received.]"
"[+>0?An error occurred.]"
"}"
-"[+SEE ALSO?\btime\b(1), \bwait\b(1)]"
+"[+SEE ALSO?\bdate\b(1), \btime\b(1), \bwait\b(1)]"
;
const char sh_opttrap[] =
@@ -1566,9 +1594,10 @@ USAGE_LICENSE
"options \b-i\b, \b-E\b, and \b-F\b cannot be specified with "
"the justification options \b-L\b, \b-R\b, and \b-Z\b.]"
"[+?Note that the following preset aliases are set by the shell:]{"
- "[+float?\b\f?\f -E\b.]"
+ "[+compound?\b\f?\f -C\b.]"
+ "[+float?\b\f?\f -lE\b.]"
"[+functions?\b\f?\f -f\b.]"
- "[+integer?\b\f?\f -i\b.]"
+ "[+integer?\b\f?\f -li\b.]"
"[+nameref?\b\f?\f -n\b.]"
"}"
"[+?If no \aname\as are specified then variables that have the specified "
@@ -1640,8 +1669,8 @@ USAGE_LICENSE
"[R]#?[n?Right justify. If \an\a is given it represents the field width. If "
"the \b-Z\b attribute is also specified, then zeros will "
"be used as the fill character. Otherwise, spaces are used.]"
-"[X]#?[n:=10?Floating point number represented in hexadecimal notation. "
- "\an\a specifies the number of significant figures when the "
+"[X]#?[n:=2*sizeof(long long)?Floating point number represented in hexadecimal "
+ "notation. \an\a specifies the number of significant figures when the "
"value is expanded.]"
#ifdef SHOPT_TYPEDEF