From d9d326b9ae3ed4c0e6bac2e0eda8c4df6dc862fb Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sun, 1 Dec 2024 15:34:56 +0000 Subject: [PATCH] Clean up more trailing whitespace (re: 03883987) --- src/cmd/INIT/cc.ibm.risc | 2 +- src/cmd/INIT/cc.ibm.risc.gcc | 2 +- src/cmd/INIT/cc.lynxos.i386 | 2 +- src/cmd/INIT/cc.lynxos.ppc | 2 +- src/cmd/INIT/make.probe | 2 +- src/cmd/ksh93/PROMO.mm | 2 +- src/cmd/ksh93/builtins.mm | 24 +++---- src/cmd/ksh93/nval.3 | 2 +- src/cmd/ksh93/sh.1 | 4 +- src/cmd/ksh93/sh.memo | 108 +++++++++++++++--------------- src/cmd/ksh93/sh/io.c | 2 +- src/cmd/ksh93/tests/arith.sh | 34 +++++----- src/cmd/ksh93/tests/arrays.sh | 2 +- src/cmd/ksh93/tests/attributes.sh | 6 +- src/cmd/ksh93/tests/basic.sh | 2 +- src/cmd/ksh93/tests/comvar.sh | 20 +++--- src/cmd/ksh93/tests/comvario.sh | 2 +- src/cmd/ksh93/tests/coprocess.sh | 4 +- src/cmd/ksh93/tests/functions.sh | 8 +-- src/cmd/ksh93/tests/io.sh | 2 +- src/cmd/ksh93/tests/locale.sh | 2 +- src/cmd/ksh93/tests/nameref.sh | 14 ++-- src/cmd/ksh93/tests/options.sh | 4 +- src/cmd/ksh93/tests/sigchld.sh | 2 +- src/cmd/ksh93/tests/signal.sh | 2 +- src/cmd/ksh93/tests/statics.sh | 16 ++--- src/cmd/ksh93/tests/subshell.sh | 8 +-- src/cmd/ksh93/tests/substring.sh | 4 +- src/cmd/ksh93/tests/types.sh | 14 ++-- src/lib/libast/features/common | 10 +-- src/lib/libast/man/LIBAST.3 | 2 +- src/lib/libast/man/ast.3 | 2 +- src/lib/libast/man/chr.3 | 2 +- src/lib/libast/man/compat.3 | 2 +- src/lib/libast/man/error.3 | 2 +- src/lib/libast/man/find.3 | 2 +- src/lib/libast/man/fmt.3 | 2 +- src/lib/libast/man/fmtls.3 | 2 +- src/lib/libast/man/getcwd.3 | 2 +- src/lib/libast/man/hash.3 | 2 +- src/lib/libast/man/iblocks.3 | 2 +- src/lib/libast/man/int.3 | 2 +- src/lib/libast/man/ip6.3 | 2 +- src/lib/libast/man/magic.3 | 2 +- src/lib/libast/man/mem.3 | 2 +- src/lib/libast/man/mime.3 | 2 +- src/lib/libast/man/modecanon.3 | 2 +- src/lib/libast/man/optget.3 | 2 +- src/lib/libast/man/path.3 | 2 +- src/lib/libast/man/proc.3 | 2 +- src/lib/libast/man/re.3 | 2 +- src/lib/libast/man/regex.3 | 2 +- src/lib/libast/man/setenviron.3 | 2 +- src/lib/libast/man/sig.3 | 2 +- src/lib/libast/man/spawnveg.3 | 2 +- src/lib/libast/man/strcopy.3 | 2 +- src/lib/libast/man/strdup.3 | 2 +- src/lib/libast/man/strelapsed.3 | 2 +- src/lib/libast/man/strerror.3 | 2 +- src/lib/libast/man/stresc.3 | 2 +- src/lib/libast/man/streval.3 | 2 +- src/lib/libast/man/strgid.3 | 2 +- src/lib/libast/man/strmatch.3 | 2 +- src/lib/libast/man/stropt.3 | 2 +- src/lib/libast/man/strperm.3 | 2 +- src/lib/libast/man/strsort.3 | 2 +- src/lib/libast/man/strtape.3 | 2 +- src/lib/libast/man/strton.3 | 2 +- src/lib/libast/man/struid.3 | 2 +- src/lib/libast/man/swap.3 | 2 +- src/lib/libast/man/tab.3 | 2 +- src/lib/libast/man/tm.3 | 2 +- src/lib/libast/man/tmx.3 | 2 +- src/lib/libast/man/tok.3 | 2 +- src/lib/libast/man/touch.3 | 2 +- src/lib/libast/man/tv.3 | 2 +- 76 files changed, 200 insertions(+), 200 deletions(-) diff --git a/src/cmd/INIT/cc.ibm.risc b/src/cmd/INIT/cc.ibm.risc index 9df88088c718..7e4d347cd7da 100755 --- a/src/cmd/INIT/cc.ibm.risc +++ b/src/cmd/INIT/cc.ibm.risc @@ -28,7 +28,7 @@ cc=$bin/xlc ccflags="-brtl -qhalt=e -qsuppress=1506-224:1506-507" case " $@ " in -*" -G "*) +*" -G "*) ccflags="$ccflags -berok" ;; esac diff --git a/src/cmd/INIT/cc.ibm.risc.gcc b/src/cmd/INIT/cc.ibm.risc.gcc index 961650db8be1..2e56a5ecb37d 100755 --- a/src/cmd/INIT/cc.ibm.risc.gcc +++ b/src/cmd/INIT/cc.ibm.risc.gcc @@ -27,7 +27,7 @@ cc=gcc ccflags= case " $@ " in -*" -shared "*) +*" -shared "*) ccflags="$ccflags -shared -Wl,-G -Wl,-berok" ;; *) ccflags="-Wl,-brtl" diff --git a/src/cmd/INIT/cc.lynxos.i386 b/src/cmd/INIT/cc.lynxos.i386 index acd0d02d620f..35e798f4b867 100755 --- a/src/cmd/INIT/cc.lynxos.i386 +++ b/src/cmd/INIT/cc.lynxos.i386 @@ -68,7 +68,7 @@ do case $1 in shift done case $link:$static in -1:0) static=n ;; +1:0) static=n ;; esac case $static in n) specs=/tmp/cc$$.specs diff --git a/src/cmd/INIT/cc.lynxos.ppc b/src/cmd/INIT/cc.lynxos.ppc index 32738f289bbb..75866426f6b8 100755 --- a/src/cmd/INIT/cc.lynxos.ppc +++ b/src/cmd/INIT/cc.lynxos.ppc @@ -72,7 +72,7 @@ do case $1 in shift done case $link:$static in -1:0) static=n ;; +1:0) static=n ;; esac case $static in n) specs=/tmp/cc$$.specs diff --git a/src/cmd/INIT/make.probe b/src/cmd/INIT/make.probe index 2fdaf48ae5c1..d7421f8361e0 100644 --- a/src/cmd/INIT/make.probe +++ b/src/cmd/INIT/make.probe @@ -1774,7 +1774,7 @@ esac # path cleanup # -for i in ar ccnative dld ld nm size stdinclude stdlib strip +for i in ar ccnative dld ld nm size stdinclude stdlib strip do eval o='$'$i v=$o case $v in diff --git a/src/cmd/ksh93/PROMO.mm b/src/cmd/ksh93/PROMO.mm index f69795510ea2..32ab77093c50 100644 --- a/src/cmd/ksh93/PROMO.mm +++ b/src/cmd/ksh93/PROMO.mm @@ -75,7 +75,7 @@ precision floating point arithmetic. Almost the complete set of C language operators are available with the same syntax and precedence. -Arithmetic expressions can be used to as an argument expansion +Arithmetic expressions can be used to as an argument expansion or as a separate command. In addition there is an arithmetic for command that works like the for statement in C. diff --git a/src/cmd/ksh93/builtins.mm b/src/cmd/ksh93/builtins.mm index 7bfe1bf8b2cb..31deeee3beb4 100644 --- a/src/cmd/ksh93/builtins.mm +++ b/src/cmd/ksh93/builtins.mm @@ -16,7 +16,7 @@ to load and link code into the current process at run time. Some examples of the systems that have this feature are Linux, System V Release 4, Solaris, Sun OS, HP-UX Release 8 and above, -AIX 3.2 and above, and Microsoft Windows systems. +AIX 3.2 and above, and Microsoft Windows systems. .P This memo describes how to write and compile programs that can be loaded into \f5ksh\fP at run time as built-in @@ -24,7 +24,7 @@ .AE \" abstract end .H 1 INTRODUCTION A built-in command is executed without creating a separate process. -Instead, the command is invoked as a C function by \f5ksh\fP. +Instead, the command is invoked as a C function by \f5ksh\fP. If this function has no side effects in the shell process, then the behavior of this built-in is identical to that of the equivalent stand-alone command. The primary difference @@ -70,7 +70,7 @@ \f5ksh\fP by adding built-in commands makes sense and allows reuse of the shell scripting ability in an application specific domain. -This memo describes how to write \f5ksh\fP extensions. +This memo describes how to write \f5ksh\fP extensions. .H 1 "WRITING BUILT-IN COMMANDS" There is a development kit available for writing \f5ksh\fP built-ins as part of the AST (AT&T Software Technology) Toolkit. @@ -143,7 +143,7 @@ of the built-in source file, where \fIidentifier\fP is any C identifier. This line provides version information to the shell \f5builtin\fP command that it uses to verify compatibility between the built-in and \f5ksh\fP -implementation versions. \f5builtin\fP fails with a diagnostic on version +implementation versions. \f5builtin\fP fails with a diagnostic on version mismatch. The diagnostic helps determine whether \f5ksh\fP is out of date and requires an upgrade or the built-in is out of date and requires recompilation. @@ -212,7 +212,7 @@ int b_hello(int argc, char *argv[], void *context) .EE will automatically find, load and install the built-in on any system. Once this command has been invoked, you can invoke \f5hello\fP -as you do any other command. +as you do any other command. If you are using \f5lib_init\fP method to add built-ins then no arguments follow the \f5\-f\fP option. .P @@ -244,7 +244,7 @@ int b_hello(int argc, char *argv[], void *context) .BR sh_ , .BR nv_ , and -.B ed_ +.B ed_ since these are used by \f5ksh\fP itself. \f5#define\fP constants in \f5ksh\fP interface files use symbols beginning with \f5SH_\fP and \f5NV_\fP, @@ -415,7 +415,7 @@ int optget(char *\fIargv\fP[], const char *\fIoptstring\fP) .LI \f5[\fP...\f5]\fP After a \f5:\fP or \f5#\fP, the characters contained inside the brackets are used to identify the option -argument when generating a \fIusage\fP message. +argument when generating a \fIusage\fP message. .LI \fIspace\fP The remainder of the string will only be used when generating usage messages. @@ -470,7 +470,7 @@ int optget(char *\fIargv\fP[], const char *\fIoptstring\fP) and which is used extensively by \f5ksh\fP itself. Objects allocated with the \f5stkalloc()\fP function are freed when you function completes -or aborts. +or aborts. The \fBstk\fP library provides a convenient way to build variable length strings and other objects dynamically. The man page for the \fBstk\fP library is contained @@ -480,7 +480,7 @@ int optget(char *\fIargv\fP[], const char *\fIoptstring\fP) the current stack location and restores it after it returns. It is not necessary to save and restore the stack -location in the \f5b_\fP entry function, +location in the \f5b_\fP entry function, but you may want to write functions that use this stack are restore it when leaving the function. The following coding convention will do this in @@ -521,7 +521,7 @@ int optget(char *\fIargv\fP[], const char *\fIoptstring\fP) with the prefix \f5nv_\fP. Each shell variable is an object in an associative table that is referenced by name. -The type \f5Namval_t*\fP is pointer to a shell variable. +The type \f5Namval_t*\fP is pointer to a shell variable. To operate on a shell variable, you first get a handle to the variable with the \f5nv_open()\fP function and then supply the handle returned as the first @@ -561,7 +561,7 @@ int optget(char *\fIargv\fP[], const char *\fIoptstring\fP) any node into an active entity by assigning functions to it that will be called whenever \f5nv_putval()\fP and/or \f5nv_getval()\fP is called. -In fact there are up to five functions that can +In fact there are up to five functions that can associated with each variable to override the default actions. The type \f5Namfun_t\fP is used to define these functions. @@ -639,7 +639,7 @@ int optget(char *\fIargv\fP[], const char *\fIoptstring\fP) to a give file stream. The tree can be executed by supplying it as the first argument to the \f5sh_trap()\fP function and giving a value of \f51\fP as the -second argument. +second argument. Alternatively, the \f5sh_trap()\fP function can parse and execute a string by passing the string as the first argument and giving \f50\fP as the second argument. diff --git a/src/cmd/ksh93/nval.3 b/src/cmd/ksh93/nval.3 index 36ca006eda40..56a34caf2501 100644 --- a/src/cmd/ksh93/nval.3 +++ b/src/cmd/ksh93/nval.3 @@ -25,7 +25,7 @@ Namdisc_t; .ft 5 Namval_t *nv_open(const char *\fIname\fP, Dt_t *\fIdict\fP, int \fIflags\fP); Namval_t *nv_create(const char *\fIname\fP, Dt_t *\fIdict\fP, int \fIflags\fP, Namfun_t *\fIfp\fP); -Namval_t *nv_namptr(void *\fIptr\fP, int \fIindx\fP); +Namval_t *nv_namptr(void *\fIptr\fP, int \fIindx\fP); void nv_delete(Namval_t *\fInp\fP, Dt_t *\fIdict\fP, int \fInofree\fP); .ft R .fi diff --git a/src/cmd/ksh93/sh.1 b/src/cmd/ksh93/sh.1 index 04dc738e9cc4..c878669aeeed 100644 --- a/src/cmd/ksh93/sh.1 +++ b/src/cmd/ksh93/sh.1 @@ -9389,14 +9389,14 @@ or .IP \[bu] specifying path or command names containing -.BR / +.BR / .IP \[bu] redirecting output .RB ( > , .BR >| , .BR <> , and -.BR >> ) +.BR >> ) .IP \[bu] adding or deleting built-in commands .IP \[bu] diff --git a/src/cmd/ksh93/sh.memo b/src/cmd/ksh93/sh.memo index b063745ffc60..8b3b68c0a77d 100644 --- a/src/cmd/ksh93/sh.memo +++ b/src/cmd/ksh93/sh.memo @@ -1,19 +1,19 @@ . \" use troff -mm .nr C 3 -.nr N 2 +.nr N 2 .SA 1 \" right justified .ND "December 21, 1993" -.TL "311466-6713" "61175" \" charging case filing case +.TL "311466-6713" "61175" \" charging case filing case Introduction to \f5ksh-93\fP .AU "David G. Korn" DGK MH 11267 7975 3C-526B "(research!dgk)" .TM 11267-931221-26 \" technical memo + TM numbers .MT 1 \" memo type .OK Shell "Command interpreter" Language UNIX \" keyword -.AS 2 \" abstract start for TM +.AS 2 \" abstract start for TM \f5ksh-93\fP is a major rewrite of \f5ksh\fP, a program that serves as a command language -(shell) for the UNIX* +(shell) for the UNIX* .FS * UNIX is a registered trademark of Novell. .FE @@ -80,7 +80,7 @@ a sample script written in \f5ksh-93\fP. The term "shell" is used to describe a program that provides a command language interface. -Because the UNIX*\ +Because the UNIX*\ .FS * UNIX is a registered trademark of USL .FE @@ -119,7 +119,7 @@ The Bourne shell is available on almost all versions of the UNIX system. The C Shell is available with all Berkeley Software Distribution (BSD) UNIX systems and on many other systems. The KornShell -is available on System V Release 4 systems. +is available on System V Release 4 systems. In addition, it is available on many other systems. The source for the KornShell language is available from the AT&T Toolchest, an electronic software distribution system. @@ -127,22 +127,22 @@ It runs on all known versions of the UNIX system and on many UNIX system look-alikes. .P There have been several articles comparing the UNIX system shells. -Jason Levitt\*(Rf +Jason Levitt\*(Rf .RS Jason Levitt, .IR "The Korn Shell: An Emerging Standard" , -UNIX/World, pp. 74-81, September 1986. +UNIX/World, pp. 74-81, September 1986. .RF highlights some of the new features introduced by the KornShell language. -Rich Bilancia\*(Rf +Rich Bilancia\*(Rf .RS Rich Bilancia, .IR "Proficiency and Power are Yours With the Korn Shell" , -UNIX/World, pp. 103-107, September 1987. +UNIX/World, pp. 103-107, September 1987. .RF explains some of the advantages of using the KornShell language. -John Sebes\*(Rf +John Sebes\*(Rf .RS John Sebes, .I "Comparing UNIX Shells," @@ -207,7 +207,7 @@ It is referred to as \f5ksh\fP in the rest of this memo. The memo describes the KornShell language based on the features of the 12/28/93 release of \f5ksh\fP. This memo is not a tutorial, only an introduction. -The second edition of reference [9] gives +The second edition of reference [9] gives a more complete treatment of the KornShell language. .P A concerted effort has been made to achieve both System V Bourne shell @@ -242,9 +242,9 @@ Most commands print an error message which shows which options are permitted when given incorrect arguments. In addition, the option sequence \f5-?\fP causes most commands -to print a usage message which lists the valid options. +to print a usage message which lists the valid options. .P -Ordinarily, \f5ksh\fP executes a command by +Ordinarily, \f5ksh\fP executes a command by using the command name to locate a program to run and by running the program as a separate process. Some commands, referred to as @@ -262,7 +262,7 @@ all commands that are built in follow command line conventions. as command line arguments at invocation and as option arguments to the \f5set\fP command. Most other options can be set with a single letter option or as a name -that follows the \f5-o\fP option. +that follows the \f5-o\fP option. Use \f5set\ -o\fP to display the current option settings. @@ -305,7 +305,7 @@ character, normally from exiting the shell and possibly logging you out. You must type \f5exit\fP to log out. -Most of the options are described in this memo as appropriate. +Most of the options are described in this memo as appropriate. .H 2 "Command Aliases" .P Command aliases provide a mechanism of associating a command name and @@ -319,7 +319,7 @@ command definition is: As with most other shell assignments, no space is allowed before or after the \f5=\fP. The characters of an alias name cannot be characters that are -special to the shell. +special to the shell. The replacement string, .I value, can contain any valid shell script, @@ -472,7 +472,7 @@ the edited text automatically becomes the input for \f5ksh\fP. As this text is read by \f5ksh\fP, it is echoed onto the terminal. .P -The +The .B \-s option causes the editing to be bypassed and just re-executes the command. @@ -667,7 +667,7 @@ A trap named \fB\s-1KEYBD\s+1\fP is evaluated each time \f5ksh\fP processes characters entered -from the keyboard, +from the keyboard, other than those typed while entering a search string or an argument to an edit directive such as @@ -707,7 +707,7 @@ must be entered within half a second after the .BR ESC . The value of \fB.sh.edchar\fP at the end of the trap will be used as -the input sequence. +the input sequence. .P Using the associative array facility of \f5ksh\fP described later, and the function facility of \f5ksh\fP, it is easy to write @@ -719,7 +719,7 @@ a single trap so that keys can be bound dynamically. For example, \f5typeset -A Keytable trap 'eval "${Keytable[${.sh.edchar}]}"' KEYBD function keybind # key action -{ +{ typeset key=$(print -f "%q" "$2") case $# in 2) Keytable[$1]='.sh.edchar=${.sh.edmode}'"$key" @@ -736,7 +736,7 @@ function keybind # key action .sp .H 2 "Job Control" .P -The job control mechanism +The job control mechanism is almost identical to the version introduced in \f5csh\fP of the Berkeley UNIX operating system, version 4.1 and later. @@ -828,11 +828,11 @@ with the prefix removed. The .B \-l -option of \f5kill\fP +option of \f5kill\fP provides a means to map individual signal names to and from signal number. In addition, if no signal name or number is given, -\f5kill\ -l\fP +\f5kill\ -l\fP generates a list of valid signal names. .H 2 "Changing Directories" By default, @@ -842,7 +842,7 @@ which makes symbolic links transparent. For systems that have symbolic links, this means that if \f5/bin\fP is a symbolic link to \f5/usr/bin\fP and you change directory to \f5/bin\fP, \f5pwd\fP will indicate -that you are in \f5/bin\fP, not \f5/usr/bin\fP. +that you are in \f5/bin\fP, not \f5/usr/bin\fP. \f5pwd\ -P\fP generates the physical pathname of the present working directory by resolving all the symbolic links. @@ -946,7 +946,7 @@ expansions from occurring when assigning the value to .B \s-1PS1\s+1. For example, \f3\s-1PS1\s+1="$\s-1PWD\s+1"\fP -causes +causes .B \s-1PS1\s+1 to be set to the value of .B \s-1PWD\s+1 @@ -970,7 +970,7 @@ so that their values can be used with The .B \s-1PWD\s+1 variable stores the pathname of the current working directory. -The value of +The value of .B \s-1SECONDS\s+1 variable is the value of the most @@ -1100,7 +1100,7 @@ a single quoted string causes all the characters until the matching single quote to be interpreted as an ANSI C language string. Thus, \f5'\en'\fP represents characters \f5\e\fP and -\f5n\fP, whereas, \f5$'\en'\fP +\f5n\fP, whereas, \f5$'\en'\fP represents the new-line character. Double quoted strings remove the special meaning of all characters except @@ -1323,13 +1323,13 @@ and then truncated to an integer. The .B \-E attribute causes the value to be represented in scientific -notation whenever its value is expanded. The number following the +notation whenever its value is expanded. The number following the .B \-E determines the number of significant figures, and defaults to 6. The .B \-F attribute causes the value to be represented with a fixed number -of places after the decimal point. +of places after the decimal point. Assignments to variables with the .B \-E or @@ -1385,7 +1385,7 @@ and can be used to generate all elements of an array, as they are used for expansion of positional parameters. The list of currently defined subscripts for a given -variable can be generated with +variable can be generated with .BI ${! name [@]} , or .BI ${! name [*]} . @@ -1405,7 +1405,7 @@ to \f5foo\fP to behave as the variable whose name is \f5$foo\fP was referenced, which in this case is the variable \f5bar\fP. Unsetting this attribute breaks the association. Reference variables are usually used inside functions whose -arguments are the names of shell variables. +arguments are the names of shell variables. The names for reference variables cannot contain a \fB\s+2.\s-2\fP. Whenever a shell variable is referenced, the portion of the variable up to the first \fB\s+2.\s-2\fP @@ -1528,7 +1528,7 @@ In addition, the value of \f5"$foo"\fP is .sp .H 2 "Substring Generation" The expansion of a variable or parameter can be modified so that -only a portion of the value results. +only a portion of the value results. It is often necessary to extract a portion of a shell variable or a portion of an array. There are several parameter expansion operators that can do this. @@ -1633,7 +1633,7 @@ except when \fIname\fP is a reference variable. In this case it will yield the name of the variable it refers to. When applied to an array variable, \fB${!\fP\fIname\fP\fB[@]}\fP and -\fB${!\fP\fIname\fP\fB[*]}\fP +\fB${!\fP\fIname\fP\fB[*]}\fP generate the names of all subscripts. \fB${#\fP\fIname\fP\fB}\fP will be the length in bytes of @@ -1733,7 +1733,7 @@ This makes the command easy to use with the \f5if\fP and \f5while\fP compound commands. .P The \f5for\fP compound command -has been extended for use in arithmetic contexts. +has been extended for use in arithmetic contexts. The syntax, .ce \f5for\fP \fB((\fP \fIexpr1\fP\fB;\fP \fIexpr2\fP \fB;\fP \fIexpr3 \fP\fB))\fP @@ -1793,8 +1793,8 @@ The option .B \-u or .BR nounset , -will cause an error to occur when any variable -that is not set is expanded. +will cause an error to occur when any variable +that is not set is expanded. .LI The characters that result from parameter expansion and command substitution above are checked with the characters @@ -1825,7 +1825,7 @@ The characters .BR * , and .B [ -are processed specially +are processed specially by the shell when not quoted. These characters are used to form patterns that match strings. @@ -1924,10 +1924,10 @@ displays all file names in the current directory that do not end in When patterns are used to generate pathnames when expanding commands several other rules apply. A separate match is made -for each file name component of the pathname. +for each file name component of the pathname. Read permission is required for any portion of the pathname that contains any special -pattern character. +pattern character. Search permission is required for every component except possibly the last. .P @@ -1949,7 +1949,7 @@ If the .B markdirs option is set, each matching pathname that is the name -of a directory has a trailing +of a directory has a trailing .B / appended to the name. .P @@ -1993,7 +1993,7 @@ The reserved words .B [[ and .B ]] -delimit the range of the command. +delimit the range of the command. Because they are reserved words, not operator characters, they require spaces to separate them from arguments. @@ -2030,7 +2030,7 @@ and .B != takes a pattern and tests whether the left hand operand matches this pattern. Quoting the pattern results -is a string comparison rather than the pattern match. +is a string comparison rather than the pattern match. The operators .B < and @@ -2070,7 +2070,7 @@ returns true when its operand is the name of an option that is currently on. .P The following script illustrates some of the uses of -.BR [[ ... ]] . +.BR [[ ... ]] . The reference manual contains the complete list of operators. .sp .nf @@ -2099,7 +2099,7 @@ you use the I/O redirection operator, to control where input comes from, and the I/O redirection operator, .BR > , -to control where output goes to. +to control where output goes to. Each of these operators can be preceded with a single digit that specifies a file unit number to associate with the file stream. Ordinarily you specify these I/O redirection operators with a specific @@ -2260,7 +2260,7 @@ This makes it hard to output strings without interpretation. Most BSD derived systems do not interpret .B \e control sequences. -Unfortunately, the BSD versions of \f5echo\fP accepts a +Unfortunately, the BSD versions of \f5echo\fP accepts a .B \-n option to prevent a trailing new-line, but has no way to cause the string @@ -2317,7 +2317,7 @@ be placed on the output as required so that it can be used as shell input. Special characters in the output of most \f5ksh\fP built-in commands and in the output from an execution trace -are quoted in an equivalent fashion. +are quoted in an equivalent fashion. The .B %P format causes an extended regular expression string to @@ -2764,13 +2764,13 @@ In all other ways, \f5command\fP behaves like a built-in that is not associated with a pathname. As a result, if the first argument of \f5command\fP is a special built-in, the special properties of this built-in -do not apply. +do not apply. For example, whereas, \f5exec\ 3<\ foo\fP will cause a script containing it to abort if the open fails, \f5command\ exec\ 3<\ foo\fP results in a non-zero exit status but does not abort the script. .P You can get a complete list of the special built-in commands -with \f5builtin\ -s\fP. +with \f5builtin\ -s\fP. In addition \f5builtin\fP without arguments gives a list of the current built-ins and the pathname that they are associated with. A built-in can be bound to another pathname by giving @@ -2829,7 +2829,7 @@ is named \fB\s-1EXIT\s+1\fP. .H 2 "Additional Variables" In addition to the variables discussed earlier, \f5ksh\fP -has other variables that it handles specially. +has other variables that it handles specially. The variable \fB\s-1RANDOM\s+1\fP produces a random number in the range 0 to 32767 each time it is referenced. Assignment to this variable sets the seed for the @@ -2889,7 +2889,7 @@ instead of the The \fB\s-1LINENO\s+1\fP variable is set to the current line number relative to the -beginning of the current script or function. +beginning of the current script or function. It is most useful as part of the \fB\s-1PS4\s+1\fP prompt. @@ -2951,7 +2951,7 @@ These security holes occur primarily because a user can manipulate the to subvert the intent of a .I setuid shell procedure. -Sometimes, shell procedures are initiated from +Sometimes, shell procedures are initiated from binary programs, without the author's awareness, by library routines which invoke shells to carry out their tasks. @@ -3132,7 +3132,7 @@ There is also a compile time switch to enable handling multi-byte and multi-width characters sets. .P On systems with dynamic libraries, it is possible to add built-in -commands at run time with the built-in command \f5builtin\fP +commands at run time with the built-in command \f5builtin\fP described earlier. It is also possible to embed \f5ksh\fP in applications in a manner analogous to \f5tcl\fP. @@ -3233,7 +3233,7 @@ and ISO shell standard. The 1993 version offers many advantages for programming applications, and it has been rewritten so that it can be used in embedded applications. It also offers improved performance. -.SG dgk \" signature typist initials +.SG dgk \" signature typist initials \" .CS 14 24 38 0 0 16 \" cover sheet for TM .bp .ce diff --git a/src/cmd/ksh93/sh/io.c b/src/cmd/ksh93/sh/io.c index c58761f385f9..86161e641ea4 100644 --- a/src/cmd/ksh93/sh/io.c +++ b/src/cmd/ksh93/sh/io.c @@ -155,7 +155,7 @@ getaddrinfo(const char* node, const char* service, const struct addrinfo* hint, case SOCK_STREAM: switch (hint->ai_protocol) { - case 0: + case 0: protocol = "tcp"; break; #ifdef IPPROTO_SCTP diff --git a/src/cmd/ksh93/tests/arith.sh b/src/cmd/ksh93/tests/arith.sh index d47ea8cdd0c0..dd42b419eeff 100755 --- a/src/cmd/ksh93/tests/arith.sh +++ b/src/cmd/ksh93/tests/arith.sh @@ -520,8 +520,8 @@ do for b in $v done typeset -l y y_ascii -(( y=sin(90) )) -y_ascii=$y +(( y=sin(90) )) +y_ascii=$y (( y == y_ascii )) || err_exit "no match,\n\t$(printf "%a\n" y)\n!=\n\t$(printf "%a\n" y_ascii)" ( $SHELL <<- \EOF @@ -529,16 +529,16 @@ y_ascii=$y t[p]=6 while (( t[p] != 0 )) ; do (( - p+=1 , - t[p]+=2 , - p+=3 , - t[p]+=5 , - p+=1 , - t[p]+=2 , - p+=1 , - t[p]+=1 , + p+=1 , + t[p]+=2 , + p+=3 , + t[p]+=5 , + p+=1 , + t[p]+=2 , + p+=1 , + t[p]+=1 , p-=6 , - t[p]-=1 + t[p]-=1 )) : done @@ -595,7 +595,7 @@ $SHELL 2> /dev/null <<- \EOF || err_exit "arithmetic functions defined and refe { ((.sh.value = x-x**3/6. + x**5/120.-x**7/5040. + x**9/362880.)) } - (( abs(sin(.5)-mysin(.5)) < 1e-6 )) + (( abs(sin(.5)-mysin(.5)) < 1e-6 )) exit 0 } EOF @@ -630,7 +630,7 @@ function x float x y float x=$((log10(nz))) y=$((log10($nz))) (( abs(x-y) < 1e-10 )) || err_exit '$nz and nz differs in arithmetic expression when nz is reference to array instance' -} +} x z[1] unset x @@ -651,7 +651,7 @@ typeset -i foo foobar (( foo == 8 )) || err_exit 'arithmetic assignment binding to the wrong scope' -(( tgamma(4)/12 )) || err_exit 'floating point attribute for functions not preserved' +(( tgamma(4)/12 )) || err_exit 'floating point attribute for functions not preserved' unset F function f @@ -776,8 +776,8 @@ do (($x == 1)) || err_exit 'arithmetic in for loop with $x, where $x is hex cons done x=010 let "$x==10" || err_exit 'arithmetic with $x where $x is 010 should be decimal in let' -(( 9.$x == 9.01 )) || err_exit 'arithmetic with 9.$x where x=010 should be 9.01' -(( 9$x == 9010 )) || err_exit 'arithmetic with 9$x where x=010 should be 9010' +(( 9.$x == 9.01 )) || err_exit 'arithmetic with 9.$x where x=010 should be 9.01' +(( 9$x == 9010 )) || err_exit 'arithmetic with 9$x where x=010 should be 9010' x010=99 ((x$x == 99 )) || err_exit 'arithmetic with x$x where x=010 should be $x010' (( 3+$x == 13 )) || err_exit '3+$x where x=010 should be 13 in ((...))' @@ -788,7 +788,7 @@ then set --posix fi let "(3+$x)==13" || err_exit 'let should not recognize leading 0 as octal' unset x -typeset -RZ3 x=10 +typeset -RZ3 x=10 (( $x == 10 )) || err_exit 'leading 0 in -RZ should not create octal constant with ((...))' let "$x==10" || err_exit 'leading 0 in -RZ should not create octal constant with let' diff --git a/src/cmd/ksh93/tests/arrays.sh b/src/cmd/ksh93/tests/arrays.sh index ea1cbde6099b..4c601c734d87 100755 --- a/src/cmd/ksh93/tests/arrays.sh +++ b/src/cmd/ksh93/tests/arrays.sh @@ -565,7 +565,7 @@ arr2[1]=def unset foo typeset foo[7] -[[ ${#foo[@]} == 0 ]] || err_exit 'typeset foo[7] should not have one element' +[[ ${#foo[@]} == 0 ]] || err_exit 'typeset foo[7] should not have one element' a=123 $SHELL 2> /dev/null -c 'integer a[5]=3 a[2]=4; unset a;x=0; ((a[++x]++));:' || err_exit 'unsetting array variable leaves side effect' diff --git a/src/cmd/ksh93/tests/attributes.sh b/src/cmd/ksh93/tests/attributes.sh index 1a331657285a..38305884e28b 100755 --- a/src/cmd/ksh93/tests/attributes.sh +++ b/src/cmd/ksh93/tests/attributes.sh @@ -390,9 +390,9 @@ typeset -H v=/dev/null [[ $v == *[Nn]ul* ]] || err_exit "typeset -H for /dev/null not working (got $(printf %q "$v"))" unset x -(typeset +C x) 2> /dev/null && err_exit 'typeset +C should be an error' -(typeset +A x) 2> /dev/null && err_exit 'typeset +A should be an error' -(typeset +a x) 2> /dev/null && err_exit 'typeset +a should be an error' +(typeset +C x) 2> /dev/null && err_exit 'typeset +C should be an error' +(typeset +A x) 2> /dev/null && err_exit 'typeset +A should be an error' +(typeset +a x) 2> /dev/null && err_exit 'typeset +a should be an error' unset x { diff --git a/src/cmd/ksh93/tests/basic.sh b/src/cmd/ksh93/tests/basic.sh index 62aa649587df..cb2562ab5a29 100755 --- a/src/cmd/ksh93/tests/basic.sh +++ b/src/cmd/ksh93/tests/basic.sh @@ -548,7 +548,7 @@ got=$( bintrue=$(whence -p true) set -o pipefail -float start=$SECONDS end +float start=$SECONDS end for ((i=0; i < 2; i++)) do print foo sleep .15 diff --git a/src/cmd/ksh93/tests/comvar.sh b/src/cmd/ksh93/tests/comvar.sh index de31b936e3c8..27bd77f4b0dd 100755 --- a/src/cmd/ksh93/tests/comvar.sh +++ b/src/cmd/ksh93/tests/comvar.sh @@ -497,7 +497,7 @@ function f1 typeset -C node node.one="hello" node.two="world" - + # move local note into the array typeset -m tr.subtree["a_node"]=node } @@ -506,7 +506,7 @@ expected=$'(\n\ttypeset -A subtree=(\n\t\t[a_node]=(\n\t\t\tone=hello\n\t\t\ttwo [[ $tree == "$expected" ]] || err_exit 'move of compound local variable to global variable not working' typeset -C -A array -float array[12].amount=2.9 +float array[12].amount=2.9 expected='typeset -C -A array=([12]=(typeset -l -E amount=2.9))' [[ $(typeset -p array) == "$expected" ]] || err_exit 'typeset with compound variable with compound variable array not working' @@ -525,11 +525,11 @@ compound output=( ) [[ $output == *end=* ]] || err_exit "The field 'name' end is missing" -compound cpv1=( integer f=2 ) +compound cpv1=( integer f=2 ) compound x=( integer a=1 - compound b=cpv1 -) + compound b=cpv1 +) [[ $x == *f=2* ]] || err_exit "The field b containing 'f=2' is missing" unset x @@ -537,7 +537,7 @@ compound x=( compound -a nodes=( [4]=( ) ) -) +) expected='typeset -C x=(typeset -C -a nodes=([4]=());)' [[ $(typeset -p x) == "$expected" ]] || err_exit 'typeset -p with nested compound indexed array not working' @@ -545,8 +545,8 @@ unset v compound v=( integer -A ar=( [aa]=4 [bb]=9 - ) -) + ) +) expected='typeset -C v=(typeset -A -l -i ar=([aa]=4 [bb]=9);)' [[ $(typeset -p v) == "$expected" ]] || err_exit 'attributes for associative arrays embedded in compound variables not working' @@ -562,7 +562,7 @@ z='typeset -a x=(hello (x=12;y=5) world)' expected='typeset -C -A l=([4]=(typeset -a ar=(1 2 3);b=1))' typeset -A -C l -printf "( typeset -a ar=( 1\n2\n3\n) b=1 )\n" | read -C l[4] +printf "( typeset -a ar=( 1\n2\n3\n) b=1 )\n" | read -C l[4] [[ $(typeset -p l) == "$expected" ]] || err_exit 'read -C for associative array of compound variables not working' unset x @@ -655,7 +655,7 @@ $SHELL -c 'typeset -A a=([b]=c)' 2> /dev/null || err_exit 'typeset -A a=([b]=c) compound -a a compound c=( name="container1" ) -a[4]=c +a[4]=c [[ ${a[4]} == $'(\n\tname=container1\n)' ]] || err_exit 'assignment of compound variable to compound array element not working' unset c diff --git a/src/cmd/ksh93/tests/comvario.sh b/src/cmd/ksh93/tests/comvario.sh index 421e2f810098..11523f96ba01 100755 --- a/src/cmd/ksh93/tests/comvario.sh +++ b/src/cmd/ksh93/tests/comvario.sh @@ -568,7 +568,7 @@ function test_read_C_into_array nameref tv=test_variants[i] out.stderr="${ { out.stdout="${ ${SHELL} -o nounset -o errexit -c "${tv.cmd}" ; (( out.res=$? )) ; }" ; } 2>&1 ; }" - + for pat in "${tv.stdoutpattern[@]}" ; do [[ "${out.stdout}" == ${pat} ]] || err_exit "${tv.testname}: Expected stdout of $(printf '%q\n' "${tv.cmd}") to match $(printf '%q\n' "${pat}"), got $(printf '%q\n' "${out.stdout}")" done diff --git a/src/cmd/ksh93/tests/coprocess.sh b/src/cmd/ksh93/tests/coprocess.sh index e60d6d310cc1..322d89ea3390 100755 --- a/src/cmd/ksh93/tests/coprocess.sh +++ b/src/cmd/ksh93/tests/coprocess.sh @@ -218,8 +218,8 @@ do sleep_pid=$! $cat |& pid=$! - print foo1 >&p 2> /dev/null || err_exit "first write to $cat coprocess failed" - print foo2 >&p 2> /dev/null || err_exit "second write to $cat coprocess failed" + print foo1 >&p 2> /dev/null || err_exit "first write to $cat coprocess failed" + print foo2 >&p 2> /dev/null || err_exit "second write to $cat coprocess failed" # avoid race between '$cat |&' initialising and 'kill $pid': read from the coprocess # before 'kill' so that $cat is known to be fully initialised and ready to catch SIGTERM read <&p && [[ $REPLY == foo1 ]] || err_exit "first read from $cat coprocess failed" diff --git a/src/cmd/ksh93/tests/functions.sh b/src/cmd/ksh93/tests/functions.sh index 6a061a5bc497..7550680b3719 100755 --- a/src/cmd/ksh93/tests/functions.sh +++ b/src/cmd/ksh93/tests/functions.sh @@ -406,7 +406,7 @@ cd $dir || { err_exit "cd $dir failed"; exit 1; } } > /dev/null typeset -ft a b PS4=X - b + b ) > file 2>&1 [[ $( /dev/null;print TRAP B" EXIT A } - -x=$(B) + +x=$(B) [[ $x == $'TRAP A\nTRAP B' ]] || err_exit "trap from functions in subshells fails got" $x function foo @@ -1209,7 +1209,7 @@ function foo esac done shift $((OPTIND - 1)) - (( OPTIND == 4 )) || err_exit "OPTIND is $OPTIND at end of function foo; it should be 4" + (( OPTIND == 4 )) || err_exit "OPTIND is $OPTIND at end of function foo; it should be 4" [[ $1 == foo2 ]] || err_exit "\$1 is $1, not foo after getopts in function" } OPTIND=6 OPTARG=xxx diff --git a/src/cmd/ksh93/tests/io.sh b/src/cmd/ksh93/tests/io.sh index 802a13a4c130..c45d6b1f84e1 100755 --- a/src/cmd/ksh93/tests/io.sh +++ b/src/cmd/ksh93/tests/io.sh @@ -482,7 +482,7 @@ print hello there world > $tmp/foobar sed -e 's/there //' $tmp/foobar >; $tmp/foobar [[ $(<$tmp/foobar) == 'hello world' ]] || err_exit '>; redirection not working on simple command' print hello there world > $tmp/foobar -{ sed -e 's/there //' $tmp/foobar;print done;} >; $tmp/foobar +{ sed -e 's/there //' $tmp/foobar;print done;} >; $tmp/foobar [[ $(<$tmp/foobar) == $'hello world\ndone' ]] || err_exit '>; redirection not working for compound command' print hello there world > $tmp/foobar $SHELL -c "sed -e 's/there //' $tmp/foobar >; $tmp/foobar" diff --git a/src/cmd/ksh93/tests/locale.sh b/src/cmd/ksh93/tests/locale.sh index fa096a390dc8..cf6976d2ae75 100755 --- a/src/cmd/ksh93/tests/locale.sh +++ b/src/cmd/ksh93/tests/locale.sh @@ -347,7 +347,7 @@ x=$"hello" print 'cat << \\EOF' for ((i=1; i < 164; i++)) do print 123456789+123456789+123456789+123456789+123456789 - done + done print $'next character is multibyte<2b|>c<3d|\>foo' for ((i=1; i < 10; i++)) do print 123456789+123456789+123456789+123456789+123456789 diff --git a/src/cmd/ksh93/tests/nameref.sh b/src/cmd/ksh93/tests/nameref.sh index 26a9be94ef11..6cecbc53866e 100755 --- a/src/cmd/ksh93/tests/nameref.sh +++ b/src/cmd/ksh93/tests/nameref.sh @@ -346,7 +346,7 @@ foobar typeset +n x y unset x y typeset -A x -x[a]=(b=c) +x[a]=(b=c) typeset -n y=x[a] [[ ${!y.@} == 'x[a].b' ]] || err_exit 'reference to array element not expanded with ${!y.@}' @@ -387,7 +387,7 @@ typeset -T container_t=( function fun1 { container_t -S container - fun2 container + fun2 container [[ $container == *foo=bar* ]] || err_exit 'name references to static type variables in parent scope not working' } fun1 @@ -406,7 +406,7 @@ compound container fun3 [[ $container == *foo=bar* ]] || err_exit 'name reference to a name reference variable in a function not working' -typeset -A x=( [a]=1 ) +typeset -A x=( [a]=1 ) nameref c=x[h] [[ -v x[h] ]] && err_exit 'creating reference to non-existent associative array element causes element to get added' @@ -438,12 +438,12 @@ nameref z=ar[0] unset c x typeset +n c x -compound c=( typeset -a x ) +compound c=( typeset -a x ) nameref x=c.x x[4]=1 [[ ${ typeset -p c.x ;} == *-C* ]] && err_exit 'c.x should not have -C attributes' -{ $SHELL 2> /dev/null <<- \EOF +{ $SHELL 2> /dev/null <<- \EOF typeset -T xxx_t=( float x=1 y=2 typeset name=abc @@ -466,12 +466,12 @@ fi typeset +n nr unset c nr compound c -compound -A c.a +compound -A c.a nameref nr=c.a[hello] [[ ${!nr} == "c.a[hello]" ]] || err_exit 'name reference nr to unset associative array instance does not expand ${!nr} correctly.' typeset +n nr -compound -a c.b +compound -a c.b nameref nr=c.b[2] [[ ${!nr} == "c.b[2]" ]] || err_exit 'name reference nr to unset indexed array instance does not expand ${!nr} correctly.' diff --git a/src/cmd/ksh93/tests/options.sh b/src/cmd/ksh93/tests/options.sh index 2051b1485b03..d39ee87d6ac1 100755 --- a/src/cmd/ksh93/tests/options.sh +++ b/src/cmd/ksh93/tests/options.sh @@ -423,10 +423,10 @@ histfile=$tmp/history exp=$(HISTFILE=$histfile $SHELL -c $'function foo\n{\ncat\n}\ntype foo') for var in HISTSIZE HISTFILE do got=$( set +x; ( HISTFILE=$histfile $SHELL +E -ic $'unset '$var$'\nfunction foo\n{\ncat\n}\ntype foo\nexit' ) 2>&1 ) - got=${got##*"$PS1"} + got=${got##*"$PS1"} [[ $got == "$exp" ]] || err_exit "function definition inside (...) with $var unset fails -- got '$got', expected '$exp'" got=$( set +x; { HISTFILE=$histfile $SHELL +E -ic $'unset '$var$'\nfunction foo\n{\ncat\n}\ntype foo\nexit' ;} 2>&1 ) - got=${got##*"$PS1"} + got=${got##*"$PS1"} [[ $got == "$exp" ]] || err_exit "function definition inside {...;} with $var unset fails -- got '$got', expected '$exp'" done ( unset HISTFILE; $SHELL -ic "HISTFILE=$histfile" 2>/dev/null ) || err_exit "setting HISTFILE when not in environment fails" diff --git a/src/cmd/ksh93/tests/sigchld.sh b/src/cmd/ksh93/tests/sigchld.sh index b2c6588363c1..d6797440ddd5 100755 --- a/src/cmd/ksh93/tests/sigchld.sh +++ b/src/cmd/ksh93/tests/sigchld.sh @@ -132,7 +132,7 @@ trap '' CHLD integer d for ((d=0; d < 2000; d++)) do if print foo | grep bar - then break + then break fi done (( d==2000 )) || err_exit "trap '' CHLD causes side effects d=$d" diff --git a/src/cmd/ksh93/tests/signal.sh b/src/cmd/ksh93/tests/signal.sh index c8100cc234ca..9b794b50fb1b 100755 --- a/src/cmd/ksh93/tests/signal.sh +++ b/src/cmd/ksh93/tests/signal.sh @@ -409,7 +409,7 @@ fi { x=$( $SHELL <<- \++EOF - timeout() + timeout() { trap 'trap - TERM; return' TERM ( sleep $1; kill -TERM $$ ) >/dev/null 2>&1 & diff --git a/src/cmd/ksh93/tests/statics.sh b/src/cmd/ksh93/tests/statics.sh index 123b0e992732..212a2052ad90 100755 --- a/src/cmd/ksh93/tests/statics.sh +++ b/src/cmd/ksh93/tests/statics.sh @@ -253,7 +253,7 @@ function test2 cmd=$' function ar { - compound -S -a s=( + compound -S -a s=( [5]=( integer a=1 integer b=2 @@ -281,7 +281,7 @@ function test2 } function ar { - compound -S -a s=( + compound -S -a s=( [5]=( integer a=1 integer b=2 @@ -301,7 +301,7 @@ function test2 cmd=$' function ar { - compound -S -a s=( + compound -S -a s=( [8][5]=( integer a=1 integer b=2 @@ -329,7 +329,7 @@ function test2 } function ar { - compound -S -a s=( + compound -S -a s=( [8][5]=( integer a=1 integer b=2 @@ -348,7 +348,7 @@ function test2 cmd=$' function ar { - compound -S -a s=( + compound -S -a s=( [8][5][0][9]=( integer a=1 integer b=2 @@ -376,7 +376,7 @@ function test2 } function ar { - compound -S -a s=( + compound -S -a s=( [8][5][0][9]=( integer a=1 integer b=2 @@ -396,7 +396,7 @@ function test2 cmd=$' function ar { - compound -S -A s=( + compound -S -A s=( [5]=( integer a=1 integer b=2 @@ -424,7 +424,7 @@ function test2 } function ar { - compound -S -A s=( + compound -S -A s=( [5]=( integer a=1 integer b=2 diff --git a/src/cmd/ksh93/tests/subshell.sh b/src/cmd/ksh93/tests/subshell.sh index 61fff0caceb3..bc6399c9688a 100755 --- a/src/cmd/ksh93/tests/subshell.sh +++ b/src/cmd/ksh93/tests/subshell.sh @@ -465,11 +465,11 @@ fi float t1=$SECONDS -$SHELL -c '( "$1" 5 /dev/null 2>&1 & );exit 0' x "$binsleep" | cat +$SHELL -c '( "$1" 5 /dev/null 2>&1 & );exit 0' x "$binsleep" | cat (( (SECONDS-t1) > 4 )) && err_exit '/bin/sleep& in subshell hanging' ((t1=SECONDS)) -$SHELL -c '( sleep 5 /dev/null 2>&1 & );exit 0' | cat +$SHELL -c '( sleep 5 /dev/null 2>&1 & );exit 0' | cat (( (SECONDS-t1) > 4 )) && err_exit 'sleep& in subshell hanging' exp=HOME=$HOME @@ -511,14 +511,14 @@ for ((i=1; i < 1000; i++)) do typeset foo$i=$i done { - : $( (ac_space=' '; set | grep ac_space) 2>&1) + : $( (ac_space=' '; set | grep ac_space) 2>&1) } < /dev/null | cat > /dev/null & sleep 1.5 if kill -KILL $! 2> /dev/null then err_exit 'process timed out with hung comsub' fi wait $! 2> /dev/null -(( $? > 128 )) && err_exit 'incorrect exit status with comsub' +(( $? > 128 )) && err_exit 'incorrect exit status with comsub' $SHELL 2> /dev/null -c '[[ ${ print foo },${ print bar } == foo,bar ]]' || err_exit '${ print foo },${ print bar } not working' $SHELL 2> /dev/null -c '[[ ${ print foo; },${ print bar } == foo,bar ]]' || err_exit '${ print foo; },${ print bar } not working' diff --git a/src/cmd/ksh93/tests/substring.sh b/src/cmd/ksh93/tests/substring.sh index 6504c3f3d077..425726b5e582 100755 --- a/src/cmd/ksh93/tests/substring.sh +++ b/src/cmd/ksh93/tests/substring.sh @@ -640,7 +640,7 @@ Errors=$? unset v typeset -a arr=( 0 1 2 3 4 ) for v in "${arr[@]:5}" -do err_exit "\${arr[@]:5} should not generate $v" +do err_exit "\${arr[@]:5} should not generate $v" break done for v in "${arr[@]:1:0}" @@ -654,7 +654,7 @@ done set 1 2 3 4 for v in "${@:5}" -do err_exit "\${@:5} should not generate $v" +do err_exit "\${@:5} should not generate $v" break done for v in "${@:1:0}" diff --git a/src/cmd/ksh93/tests/types.sh b/src/cmd/ksh93/tests/types.sh index 6a8e20d90c93..10b1137035d5 100755 --- a/src/cmd/ksh93/tests/types.sh +++ b/src/cmd/ksh93/tests/types.sh @@ -347,7 +347,7 @@ expected=$'(\n\ttypeset -l -i h=0\n\tbenchcmd_t -a m\n\ttypeset -l -E o=0\n)' expected=$'Std_file_t db.file[/etc/profile]=(action=preserve;typeset -A sum=([8242e663d6f7bb4c5427a0e58e2925f3]=1);)' { - got=$($SHELL <<- \EOF + got=$($SHELL <<- \EOF MAGIC='stdinstall (AT&T Research) 2009-08-25' typeset -T Std_file_t=( typeset action @@ -364,15 +364,15 @@ expected=$'Std_file_t db.file[/etc/profile]=(action=preserve;typeset -A sum=([82 [[ $got == "$expected" ]] || err_exit 'types with arrays of types as members fails' typeset -T x_t=( - integer dummy + integer dummy function set { [[ ${.sh.name} == v ]] || err_exit "name=${.sh.name} should be v" [[ ${.sh.subscript} == 4 ]] || err_exit "subscript=${.sh.subscript} should be 4" [[ ${.sh.value} == hello ]] || err_exit "value=${.sh.value} should be hello" - } + } ) -x_t -a v +x_t -a v v[4]="hello" typeset -T oset=( @@ -495,7 +495,7 @@ else err_exit 'typeset -T not supported' fi -[[ $($SHELL -c 'typeset -T x=( typeset -a h ) ; x j; print -v j.h') ]] && err_exit 'type with indexed array without elements inserts element 0' +[[ $($SHELL -c 'typeset -T x=( typeset -a h ) ; x j; print -v j.h') ]] && err_exit 'type with indexed array without elements inserts element 0' [[ $($SHELL -c 'typeset -T x=( integer -a s ) ; compound c ; x c.i ; c.i.s[4]=666 ; print -v c') == *'[0]'* ]] && err_exit 'type with indexed array with non-zero element inserts element 0' @@ -545,7 +545,7 @@ typeset -T b_t=( a_t b ) compound b -compound -a b.ca +compound -a b.ca b_t b.ca[4].b exp='typeset -C b=(typeset -C -a ca=( [4]=(b_t b=(a_t b=(a=hello))));)' got=$(typeset -p b) @@ -553,7 +553,7 @@ got=$(typeset -p b) "(expected $(printf %q "$exp"), got $(printf %q "$got"))" typeset -T u_t=( - integer dummy + integer dummy unset() { print unset diff --git a/src/lib/libast/features/common b/src/lib/libast/features/common index c77912f50e52..dc11d572f3f3 100644 --- a/src/lib/libast/features/common +++ b/src/lib/libast/features/common @@ -77,7 +77,7 @@ if tst - note{ + works }end compile{ /**/ #include #include - }end + }end elif tst - note{ explicit before + }end compile{ /**/ #include @@ -153,7 +153,7 @@ tst - -DN=1 - -DN=2 - -DN=3 - -DN=4 - -DN=5 - -DN=6 - -DN=7 - -DN=8 - -DN=0 outp char* name; int size; char* swap; - } int_type[] = + } int_type[] = { "char", sizeof(char), (char*)&i_char, "short", sizeof(short), (char*)&i_short, @@ -227,7 +227,7 @@ tst - output{ #include #include - #if _X86_ || _X64_ + #if _X86_ || _X64_ #define COND 1 #define CONDNAME "_X64_" #else @@ -241,7 +241,7 @@ tst - output{ char* name; int size; int cond; - } types[] = + } types[] = { "short", sizeof(short), 0, "int", sizeof(int), 0, @@ -297,7 +297,7 @@ tst - -DN=1 - -DN=0 output{ { char* name; int size; - } flt_type[] = + } flt_type[] = { "float", sizeof(float), "double", sizeof(double), diff --git a/src/lib/libast/man/LIBAST.3 b/src/lib/libast/man/LIBAST.3 index cec193ce7894..3f7eda57b0a1 100644 --- a/src/lib/libast/man/LIBAST.3 +++ b/src/lib/libast/man/LIBAST.3 @@ -23,7 +23,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/ast.3 b/src/lib/libast/man/ast.3 index c6696ab86003..c88927aad512 100644 --- a/src/lib/libast/man/ast.3 +++ b/src/lib/libast/man/ast.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/chr.3 b/src/lib/libast/man/chr.3 index b8bc238dee26..a11f629d16a2 100644 --- a/src/lib/libast/man/chr.3 +++ b/src/lib/libast/man/chr.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/compat.3 b/src/lib/libast/man/compat.3 index 8fb5d06bf128..5f9776d42dc9 100644 --- a/src/lib/libast/man/compat.3 +++ b/src/lib/libast/man/compat.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/error.3 b/src/lib/libast/man/error.3 index 677c7e86f11b..a7ae40a57fe9 100644 --- a/src/lib/libast/man/error.3 +++ b/src/lib/libast/man/error.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/find.3 b/src/lib/libast/man/find.3 index a5128c177b60..b554e3f52c44 100644 --- a/src/lib/libast/man/find.3 +++ b/src/lib/libast/man/find.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/fmt.3 b/src/lib/libast/man/fmt.3 index e4f0968ab6bb..7396bfc0ef4f 100644 --- a/src/lib/libast/man/fmt.3 +++ b/src/lib/libast/man/fmt.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/fmtls.3 b/src/lib/libast/man/fmtls.3 index b36b4e32a9ba..2f1ed4417ae7 100644 --- a/src/lib/libast/man/fmtls.3 +++ b/src/lib/libast/man/fmtls.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/getcwd.3 b/src/lib/libast/man/getcwd.3 index 280bf1134430..befab4c92830 100644 --- a/src/lib/libast/man/getcwd.3 +++ b/src/lib/libast/man/getcwd.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/hash.3 b/src/lib/libast/man/hash.3 index f36e7dac9726..725c2429978b 100644 --- a/src/lib/libast/man/hash.3 +++ b/src/lib/libast/man/hash.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/iblocks.3 b/src/lib/libast/man/iblocks.3 index 0c615f86c42b..15e6a20d698b 100644 --- a/src/lib/libast/man/iblocks.3 +++ b/src/lib/libast/man/iblocks.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/int.3 b/src/lib/libast/man/int.3 index 8d457c083d3d..9a649212fbed 100644 --- a/src/lib/libast/man/int.3 +++ b/src/lib/libast/man/int.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/ip6.3 b/src/lib/libast/man/ip6.3 index 19c54a2d21ee..ab06f4477d79 100644 --- a/src/lib/libast/man/ip6.3 +++ b/src/lib/libast/man/ip6.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/magic.3 b/src/lib/libast/man/magic.3 index 90cc25d23972..d86b0ed833f8 100644 --- a/src/lib/libast/man/magic.3 +++ b/src/lib/libast/man/magic.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/mem.3 b/src/lib/libast/man/mem.3 index b4ea917e2bdf..2dfe482360a3 100644 --- a/src/lib/libast/man/mem.3 +++ b/src/lib/libast/man/mem.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/mime.3 b/src/lib/libast/man/mime.3 index 9714e1c7ad3f..c1d459bc9263 100644 --- a/src/lib/libast/man/mime.3 +++ b/src/lib/libast/man/mime.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/modecanon.3 b/src/lib/libast/man/modecanon.3 index b85ae3420d17..f8c2f2660acf 100644 --- a/src/lib/libast/man/modecanon.3 +++ b/src/lib/libast/man/modecanon.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/optget.3 b/src/lib/libast/man/optget.3 index 90afcb8f76f4..628c374851fb 100644 --- a/src/lib/libast/man/optget.3 +++ b/src/lib/libast/man/optget.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/path.3 b/src/lib/libast/man/path.3 index f44142fea220..cfd12abd3cc7 100644 --- a/src/lib/libast/man/path.3 +++ b/src/lib/libast/man/path.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/proc.3 b/src/lib/libast/man/proc.3 index a338130b2f7c..df8676a9b905 100644 --- a/src/lib/libast/man/proc.3 +++ b/src/lib/libast/man/proc.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/re.3 b/src/lib/libast/man/re.3 index c5a5862882e3..6f91fb34db0a 100644 --- a/src/lib/libast/man/re.3 +++ b/src/lib/libast/man/re.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/regex.3 b/src/lib/libast/man/regex.3 index 0498e5f0b1ac..c60e193cc459 100644 --- a/src/lib/libast/man/regex.3 +++ b/src/lib/libast/man/regex.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/setenviron.3 b/src/lib/libast/man/setenviron.3 index f26c32ca7679..1ea916c3a042 100644 --- a/src/lib/libast/man/setenviron.3 +++ b/src/lib/libast/man/setenviron.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/sig.3 b/src/lib/libast/man/sig.3 index 9e863bb3ed89..b0ce5513a8a0 100644 --- a/src/lib/libast/man/sig.3 +++ b/src/lib/libast/man/sig.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/spawnveg.3 b/src/lib/libast/man/spawnveg.3 index 55d22a1c368c..272443bac29f 100644 --- a/src/lib/libast/man/spawnveg.3 +++ b/src/lib/libast/man/spawnveg.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strcopy.3 b/src/lib/libast/man/strcopy.3 index e0ba8f38ad5b..e3aef40555a7 100644 --- a/src/lib/libast/man/strcopy.3 +++ b/src/lib/libast/man/strcopy.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strdup.3 b/src/lib/libast/man/strdup.3 index 3028f8e36a5d..5dd40da380f4 100644 --- a/src/lib/libast/man/strdup.3 +++ b/src/lib/libast/man/strdup.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strelapsed.3 b/src/lib/libast/man/strelapsed.3 index b55c6a5c5394..865443285517 100644 --- a/src/lib/libast/man/strelapsed.3 +++ b/src/lib/libast/man/strelapsed.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strerror.3 b/src/lib/libast/man/strerror.3 index 0084e3aae8ff..e4f80ff86ec8 100644 --- a/src/lib/libast/man/strerror.3 +++ b/src/lib/libast/man/strerror.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/stresc.3 b/src/lib/libast/man/stresc.3 index d02f1b20914d..971cec5f66c5 100644 --- a/src/lib/libast/man/stresc.3 +++ b/src/lib/libast/man/stresc.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/streval.3 b/src/lib/libast/man/streval.3 index 9c78009b42ac..88e829f68112 100644 --- a/src/lib/libast/man/streval.3 +++ b/src/lib/libast/man/streval.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strgid.3 b/src/lib/libast/man/strgid.3 index 657db7762a0f..41acd519945a 100644 --- a/src/lib/libast/man/strgid.3 +++ b/src/lib/libast/man/strgid.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strmatch.3 b/src/lib/libast/man/strmatch.3 index 1b67db08d648..dc74d07affd7 100644 --- a/src/lib/libast/man/strmatch.3 +++ b/src/lib/libast/man/strmatch.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/stropt.3 b/src/lib/libast/man/stropt.3 index 37b9b335367c..b82c6e3dabfd 100644 --- a/src/lib/libast/man/stropt.3 +++ b/src/lib/libast/man/stropt.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strperm.3 b/src/lib/libast/man/strperm.3 index 6b11afb7b6d1..448b354de709 100644 --- a/src/lib/libast/man/strperm.3 +++ b/src/lib/libast/man/strperm.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strsort.3 b/src/lib/libast/man/strsort.3 index 30981d0ab961..5bfe47508d28 100644 --- a/src/lib/libast/man/strsort.3 +++ b/src/lib/libast/man/strsort.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strtape.3 b/src/lib/libast/man/strtape.3 index e6fdfaca1755..ccc7d779a469 100644 --- a/src/lib/libast/man/strtape.3 +++ b/src/lib/libast/man/strtape.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/strton.3 b/src/lib/libast/man/strton.3 index b18ca362e0f8..6aba6847361d 100644 --- a/src/lib/libast/man/strton.3 +++ b/src/lib/libast/man/strton.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/struid.3 b/src/lib/libast/man/struid.3 index 9f42abd95d88..69fa7e85ce1b 100644 --- a/src/lib/libast/man/struid.3 +++ b/src/lib/libast/man/struid.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/swap.3 b/src/lib/libast/man/swap.3 index bbef376e7269..aadab1e135ed 100644 --- a/src/lib/libast/man/swap.3 +++ b/src/lib/libast/man/swap.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/tab.3 b/src/lib/libast/man/tab.3 index 117c119d8272..e22bb1d51ae3 100644 --- a/src/lib/libast/man/tab.3 +++ b/src/lib/libast/man/tab.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/tm.3 b/src/lib/libast/man/tm.3 index f102278afe7e..27d09d55e84a 100644 --- a/src/lib/libast/man/tm.3 +++ b/src/lib/libast/man/tm.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/tmx.3 b/src/lib/libast/man/tmx.3 index be1ef2ec1c9a..04498f506cf3 100644 --- a/src/lib/libast/man/tmx.3 +++ b/src/lib/libast/man/tmx.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/tok.3 b/src/lib/libast/man/tok.3 index 680664d077fc..f9d00a1f6d37 100644 --- a/src/lib/libast/man/tok.3 +++ b/src/lib/libast/man/tok.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/touch.3 b/src/lib/libast/man/touch.3 index 908a8b1e6830..319474d05ab5 100644 --- a/src/lib/libast/man/touch.3 +++ b/src/lib/libast/man/touch.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf diff --git a/src/lib/libast/man/tv.3 b/src/lib/libast/man/tv.3 index 1b2680f90007..fb2a83dc5ea7 100644 --- a/src/lib/libast/man/tv.3 +++ b/src/lib/libast/man/tv.3 @@ -24,7 +24,7 @@ .de EX \" start example .ta 1i 2i 3i 4i 5i 6i .PP -.RS +.RS .PD 0 .ft 5 .nf