Print this page
13405 ksh93 update to 2012-08-01: part 4: man page
Change-ID: If0d23a7414155253671c169228cb81ea13abbfc1

*** 1,15 **** '\" te .\" Copyright (c) 1982-2007 AT&T Knowledge Ventures ! .\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. ! .TH KSH93 1 "Jun 27, 2018" .SH NAME ksh93, rksh93 \- Korn Shell, a standard and restricted command and programming language .SH SYNOPSIS - .LP .nf \fBksh93\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [ \fB\(+-o\fR \fIoption\fR] ... [-] [\fIarg\fR ...] .fi --- 1,15 ---- '\" te .\" Copyright (c) 1982-2007 AT&T Knowledge Ventures ! .\" To view license terms, see http://www.eclipse.org/org/documents/epl-v10.html .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. ! .\" Portions Copyright 2021 OmniOS Community Edition (OmniOSce) Association. ! .TH KSH93 1 "Jan 06, 2020" .SH NAME ksh93, rksh93 \- Korn Shell, a standard and restricted command and programming language .SH SYNOPSIS .nf \fBksh93\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [ \fB\(+-o\fR \fIoption\fR] ... [-] [\fIarg\fR ...] .fi
*** 18,38 **** \fBrksh93\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [\fB\(+-o\fR \fIoption\fR] ... [-] [\fIarg\fR ...] .fi .SH DESCRIPTION - .LP \fBksh93\fR is a command and programming language that executes commands read from a terminal or a file. \fBrksh93\fR is a restricted version of the command interpreter \fBksh93\fR. \fBrksh93\fR is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell. .sp .LP See \fBInvocation\fR for the meaning of arguments to the shell. .SS "Definitions" - .LP A \fImetacharacter\fR is defined as one of the following characters: .sp .in +2 .nf ; & ( ) | < > NEWLINE SPACE TAB --- 18,36 ----
*** 68,78 **** environment and built-ins that are found before performing a path search (see \fBExecution\fR) are documented in this manual page. For historical reasons, some of these built-ins behave differently than other built-ins and are called special built-ins. .SS "Commands" - .LP A \fIsimple-command\fR is a list of variable assignments (see \fBVariable Assignments\fR) or a sequence of \fIblank\fR-separated words which can be preceded by a list of variable assignments. See the \fBEnvironment\fR section of this manual page. .sp --- 66,75 ----
*** 127,138 **** list. Unless otherwise stated, the value returned by a command is that of the last simple-command executed in the command. .sp .ne 2 .na ! \fB\fBfor\fR \fIvname\fR \fB[ in\fR \fIword\fR \fB\&... ] ;do\fR \fIlist\fR ! \fB;done\fR\fR .ad .sp .6 .RS 4n Each time a \fBfor\fR command is executed, \fIvname\fR is set to the next \fIword\fR taken from the \fBin\fR \fIword\fR list. If \fBin\fR \fIword ...\fR --- 124,135 ---- list. Unless otherwise stated, the value returned by a command is that of the last simple-command executed in the command. .sp .ne 2 .na ! \fBfor\fR \fIvname\fR \fB[ in\fR \fIword\fR \fB\&... ] ;do\fR \fIlist\fR ! \fB;done\fR .ad .sp .6 .RS 4n Each time a \fBfor\fR command is executed, \fIvname\fR is set to the next \fIword\fR taken from the \fBin\fR \fIword\fR list. If \fBin\fR \fIword ...\fR
*** 142,153 **** .RE .sp .ne 2 .na ! \fB\fB(( [\fR\fIexpr1\fR\fB] ; [\fR\fIexpr2\fR] ; [\fIexpr3\fR\fB] )) ;do\fR ! \fIlist\fR \fB;done\fR\fR .ad .sp .6 .RS 4n The arithmetic expression \fIexpr1\fR is evaluated first. The arithmetic expression \fIexpr2\fR is repeatedly evaluated until it evaluates to \fBzero\fR --- 139,150 ---- .RE .sp .ne 2 .na ! \fBfor (( [\fR\fIexpr1\fR\fB] ; [\fR\fIexpr2\fR] ; [\fIexpr3\fR\fB] )) ;do\fR ! \fIlist\fR \fB;done\fR .ad .sp .6 .RS 4n The arithmetic expression \fIexpr1\fR is evaluated first. The arithmetic expression \fIexpr2\fR is repeatedly evaluated until it evaluates to \fBzero\fR
*** 157,168 **** .RE .sp .ne 2 .na ! \fB\fBselect\fR \fIvname\fR [ in \fIword\fR \fB\&... ] ;do\fR \fIlist\fR ! \fB;done\fR\fR .ad .sp .6 .RS 4n A \fBselect\fR command prints on standard error (file descriptor 2) the set of \fIwords\fR, each preceded by a number. If \fBin\fR \fIword...\fR is omitted, --- 154,165 ---- .RE .sp .ne 2 .na ! \fBselect\fR \fIvname\fR [ in \fIword\fR \fB\&... ] ;do\fR \fIlist\fR ! \fB;done\fR .ad .sp .6 .RS 4n A \fBselect\fR command prints on standard error (file descriptor 2) the set of \fIwords\fR, each preceded by a number. If \fBin\fR \fIword...\fR is omitted,
*** 180,191 **** .RE .sp .ne 2 .na ! \fB\fBcase\fR \fIword\fR \fBin [ [(]\fR \fIpattern\fR \fB[ |\fR \fIpattern\fR ! \fB] ... )\fR \fIlist\fR \fB;; ] ... esac\fR\fR .ad .sp .6 .RS 4n A \fBcase\fR command executes the \fIlist\fR associated with the first \fIpattern\fR that matches \fIword\fR. The form of the patterns is the same as --- 177,188 ---- .RE .sp .ne 2 .na ! \fBcase\fR \fIword\fR \fBin [ [(]\fR \fIpattern\fR \fB[ |\fR \fIpattern\fR ! \fB] ... )\fR \fIlist\fR \fB;; ] ... esac\fR .ad .sp .6 .RS 4n A \fBcase\fR command executes the \fIlist\fR associated with the first \fIpattern\fR that matches \fIword\fR. The form of the patterns is the same as
*** 196,207 **** .RE .sp .ne 2 .na ! \fB\fBif\fR \fIlist\fR \fB;then\fR \fIlist\fR \fB[ ;elif\fR \fIlist\fR ! \fB;then\fR \fIlist\fR ] \fB\&... [ ;else\fR \fIlist\fR \fB]\fR \fB;fi\fR\fR .ad .sp .6 .RS 4n The \fIlist\fR following \fBif\fR is executed and, if it returns a \fBzero\fR exit status, the \fIlist\fR following the first \fBthen\fR is executed. --- 193,204 ---- .RE .sp .ne 2 .na ! \fBif\fR \fIlist\fR \fB;then\fR \fIlist\fR \fB[ ;elif\fR \fIlist\fR ! \fB;then\fR \fIlist\fR ] \fB\&... [ ;else\fR \fIlist\fR \fB]\fR \fB;fi\fR .ad .sp .6 .RS 4n The \fIlist\fR following \fBif\fR is executed and, if it returns a \fBzero\fR exit status, the \fIlist\fR following the first \fBthen\fR is executed.
*** 214,228 **** .RE .sp .ne 2 .na ! \fB\fBwhile\fR \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR .ad .br .na ! \fBuntil \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR .ad .sp .6 .RS 4n A \fBwhile\fR command repeatedly executes the while \fIlist\fR and, if the exit status of the last command in the list is zero, executes the \fBdo\fR --- 211,225 ---- .RE .sp .ne 2 .na ! \fBwhile\fR \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR .ad .br .na ! \fBuntil \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR .ad .sp .6 .RS 4n A \fBwhile\fR command repeatedly executes the while \fIlist\fR and, if the exit status of the last command in the list is zero, executes the \fBdo\fR
*** 233,243 **** .RE .sp .ne 2 .na ! \fB\fB((\fR\fIexpression\fR\fB))\fR\fR .ad .sp .6 .RS 4n The \fIexpression\fR is evaluated using the rules for arithmetic evaluation described in this manual page. If the value of the arithmetic expression is --- 230,240 ---- .RE .sp .ne 2 .na ! \fB((\fR\fIexpression\fR\fB))\fR .ad .sp .6 .RS 4n The \fIexpression\fR is evaluated using the rules for arithmetic evaluation described in this manual page. If the value of the arithmetic expression is
*** 246,272 **** .RE .sp .ne 2 .na ! \fB\fB(\fR\fIlist\fR\fB;)\fR\fR .ad .sp .6 .RS 4n ! Execute list in a separate environment. If two adjacent open parentheses are ! needed for nesting, a SPACE must be inserted to avoid evaluation as an arithmetic command as described in this section. .sp \fIlist\fR is simply executed. Unlike the metacharacters, \fB(\fR and \fB)\fR, \fB{\fR and \fB}\fR are \fIreserved words\fR and must occur at the beginning of a line or after a \fB;\fR to be recognized. .RE .sp .ne 2 .na ! \fB\fB[[\fR \fIexpression\fR \fB]]\fR\fR .ad .sp .6 .RS 4n Evaluates \fIexpression\fR and returns a \fBzero\fR exit status when \fIexpression\fR is true. See \fBConditional Expressions\fR for a description --- 243,276 ---- .RE .sp .ne 2 .na ! \fB(\fR\fIlist\fR\fB)\fR .ad .sp .6 .RS 4n ! Execute \fIlist\fR in a separate environment. If two adjacent open parentheses ! are needed for nesting, a SPACE must be inserted to avoid evaluation as an arithmetic command as described in this section. + .RE + .sp + .ne 2 + .na + \fB{\fR \fIlist\fR\fB;} + .sp + .RS 4n \fIlist\fR is simply executed. Unlike the metacharacters, \fB(\fR and \fB)\fR, \fB{\fR and \fB}\fR are \fIreserved words\fR and must occur at the beginning of a line or after a \fB;\fR to be recognized. .RE .sp .ne 2 .na ! \fB[[\fR \fIexpression\fR \fB]]\fR .ad .sp .6 .RS 4n Evaluates \fIexpression\fR and returns a \fBzero\fR exit status when \fIexpression\fR is true. See \fBConditional Expressions\fR for a description
*** 274,293 **** .RE .sp .ne 2 .na ! \fB\fBfunction\fR \fIvarname\fR \fB{\fR \fIlist\fR \fB;}\fR\fR .ad .br .na ! \fB\fIvarname\fR \fB() {\fR \fIlist\fR \fB;}\fR\fR .ad .sp .6 .RS 4n Define a function which is referenced by \fIvarname\fR. A function whose ! \fIvarname\fR contains a \fB\&.\fR is called a discipline function and the portion of the \fIvarname\fR preceding the last \fB\&.\fR must refer to an existing variable. .sp The body of the function is the \fIlist\fR of commands between \fB{\fR and \fB}\fR. A function defined with the function \fIvarname\fR syntax can also be --- 278,297 ---- .RE .sp .ne 2 .na ! \fBfunction\fR \fIvarname\fR \fB{\fR \fIlist\fR \fB;}\fR .ad .br .na ! \fB\fIvarname\fR \fB() {\fR \fIlist\fR \fB;}\fR .ad .sp .6 .RS 4n Define a function which is referenced by \fIvarname\fR. A function whose ! \fIvarname\fR contains a dot (\fB\&.\fR) is called a discipline function and the portion of the \fIvarname\fR preceding the last \fB\&.\fR must refer to an existing variable. .sp The body of the function is the \fIlist\fR of commands between \fB{\fR and \fB}\fR. A function defined with the function \fIvarname\fR syntax can also be
*** 297,310 **** .RE .sp .ne 2 .na ! \fB\fBtime [\fR \fIpipeline\fR \fB]\fR\fR .ad .sp .6 .RS 4n If \fIpipeline\fR is omitted, the user and system time for the current shell and completed child processes is printed on standard error. Otherwise, \fIpipeline\fR is executed and the elapsed time as well as the user and system time are printed on standard error. The \fBTIMEFORMAT\fR variable can be set to a format string that specifies how the timing information should be displayed. --- 301,326 ---- .RE .sp .ne 2 .na ! \fBnamespace\fR \fIidentifier\fR \fB{\fR \fIlist\fR \fB};\fR .ad .sp .6 .RS 4n + Defines or uses the name space \fIidentifier\fR and runs the commands in + \fIlist\fR in this name space. + See \fBName Spaces\fR. + .RE + + .sp + .ne 2 + .na + \fBtime [\fR \fIpipeline\fR \fB]\fR + .ad + .sp .6 + .RS 4n If \fIpipeline\fR is omitted, the user and system time for the current shell and completed child processes is printed on standard error. Otherwise, \fIpipeline\fR is executed and the elapsed time as well as the user and system time are printed on standard error. The \fBTIMEFORMAT\fR variable can be set to a format string that specifies how the timing information should be displayed.
*** 313,323 **** .sp .LP The following reserved words are recognized as reserved only when they are the first word of a command and are not quoted: ! .br .in +2 \fBcase\fR .in -2 .br .in +2 --- 329,339 ---- .sp .LP The following reserved words are recognized as reserved only when they are the first word of a command and are not quoted: ! .sp .in +2 \fBcase\fR .in -2 .br .in +2
*** 386,437 **** .br .in +2 \fB!\fR .in -2 .SS "Variable Assignments" - .LP One or more variable assignments can start a simple command or can be arguments ! to the \fBtypeset\fR, \fBexport\fR, or \fBreadonly\fR special built-in ! commands. The syntax for an \fIassignment\fR is of the form: .sp .ne 2 .na ! \fB\fIvarname\fR\fB=\fR\fIword\fR\fR .ad .br .na ! \fB\fIvarname\fR\fB[\fR\fIword\fR\fB]=\fR\fIword\fR\fR .ad .sp .6 .RS 4n No space is permitted between \fIvarname\fR and the \fB=\fR or between \fB=\fR and \fIword\fR. .RE .sp .ne 2 .na ! \fB\fIvarname\fR\fB=(\fR\fIassignlist\fR\fB)\fR\fR .ad .sp .6 .RS 4n No space is permitted between \fIvarname\fR and the \fB=\fR. An \fIassignlist\fR can be one of the following: .sp .ne 2 .na ! \fB\fIword ...\fR\fR .ad .sp .6 .RS 4n Indexed array assignment. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIword\fR\fB]=\fR\fIword ...\fR\fR .ad .sp .6 .RS 4n Associative array assignment. If prefixed by \fBtypeset\fR \fB-a\fR, creates an indexed array instead. --- 402,453 ---- .br .in +2 \fB!\fR .in -2 .SS "Variable Assignments" One or more variable assignments can start a simple command or can be arguments ! to the \fBtypeset\fR, \fBenum\fR, \fBexport\fR, or \fBreadonly\fR special ! built-in commands. The syntax for an \fIassignment\fR is of the form: .sp .ne 2 .na ! \fB\fIvarname\fR\fB=\fR\fIword\fR .ad .br .na ! \fB\fIvarname\fR\fB[\fR\fIword\fR\fB]=\fR\fIword\fR .ad .sp .6 .RS 4n No space is permitted between \fIvarname\fR and the \fB=\fR or between \fB=\fR and \fIword\fR. + The variable \fIvarname\fR is unset before the assignment. .RE .sp .ne 2 .na ! \fB\fIvarname\fR\fB=(\fR\fIassignlist\fR\fB)\fR .ad .sp .6 .RS 4n No space is permitted between \fIvarname\fR and the \fB=\fR. An \fIassignlist\fR can be one of the following: .sp .ne 2 .na ! \fB\fIword ...\fR .ad .sp .6 .RS 4n Indexed array assignment. .RE .sp .ne 2 .na ! \fB[\fR\fIword\fR\fB]=\fR\fIword ...\fR .ad .sp .6 .RS 4n Associative array assignment. If prefixed by \fBtypeset\fR \fB-a\fR, creates an indexed array instead.
*** 438,448 **** .RE .sp .ne 2 .na ! \fB\fIassignment ...\fR\fR .ad .sp .6 .RS 4n Compound variable assignment. This creates a compound variable \fIvarname\fR with sub-variables of the form \fIvarname.name\fR, where \fIname\fR is the name --- 454,464 ---- .RE .sp .ne 2 .na ! \fB\fIassignment ...\fR .ad .sp .6 .RS 4n Compound variable assignment. This creates a compound variable \fIvarname\fR with sub-variables of the form \fIvarname.name\fR, where \fIname\fR is the name
*** 454,496 **** .RE .sp .ne 2 .na ! \fB\fBtypeset [\fR\fIoptions\fR] \fIassignment\fR \fB\&...\fR\fR .ad .sp .6 .RS 4n Nested variable assignment. Multiple assignments can be specified by separating each of them with a \fB;\fR. The previous value is unset before the assignment. .RE In addition, a \fB+=\fR can be used in place of the \fB=\fR to signify adding to or appending to the previous value. When \fB+=\fR is applied to an arithmetic type, \fIword\fR is evaluated as an arithmetic expression and added to the current value. When applied to a string variable, the value defined by \fIword\fR is appended to the value. For compound assignments, the previous value is not unset and the new values are appended to the current ones provided that the types are compatible. .RE .SS "Comments" - .LP A word beginning with \fB#\fR causes that word and all the following characters up to a NEWLINE to be commented, or ignored. .SS "Aliasing" - .LP The first word of each command is replaced by the text of an alias if an alias for this word has been defined. An alias name consists of any number of characters excluding metacharacters, quoting characters, file expansion characters, parameter expansion characters, command substitution characters, ! and \fB=\fR. The replacement string can contain any valid shell script ! including the metacharacters listed in the \fBCommands\fR section. The first ! word of each command in the replaced text, other than any that are in the ! process of being replaced, are tested for aliases. If the last character of the ! alias value is a BLANK then the word following the alias is also checked for ! alias substitution. .sp .LP Aliases can be used to redefine built-in commands but cannot be used to redefine the reserved words listed in the \fBCommands\fR section. Aliases can be created and listed with the alias command and can be removed with the --- 470,527 ---- .RE .sp .ne 2 .na ! \fBtypeset [\fR\fIoptions\fR] \fIassignment\fR \fB\&...\fR .ad .sp .6 .RS 4n Nested variable assignment. Multiple assignments can be specified by separating each of them with a \fB;\fR. The previous value is unset before the assignment. .RE + .sp + .ne 2 + .na + \fB.\fR \fIfilename\fR + .ad + .sp .6 + .RS 4n + Include the assignment commands contained in \fIfilename\fR. + .RE + In addition, a \fB+=\fR can be used in place of the \fB=\fR to signify adding to or appending to the previous value. When \fB+=\fR is applied to an arithmetic type, \fIword\fR is evaluated as an arithmetic expression and added to the current value. When applied to a string variable, the value defined by \fIword\fR is appended to the value. For compound assignments, the previous value is not unset and the new values are appended to the current ones provided that the types are compatible. + + The right hand side of a variable assignment undergoes all the expansion + listed below except word splitting, brace expansion, and file name generation. + When the left hand side is an assignment is a compound variable and + the right hand is the name of a compound variable, the compound variable + on the right will be copied or appended to the compound variable on the left. + .RE .SS "Comments" A word beginning with \fB#\fR causes that word and all the following characters up to a NEWLINE to be commented, or ignored. .SS "Aliasing" The first word of each command is replaced by the text of an alias if an alias for this word has been defined. An alias name consists of any number of characters excluding metacharacters, quoting characters, file expansion characters, parameter expansion characters, command substitution characters, ! the characters \fB/\fR and \fB=\fR. The replacement string can contain any ! valid shell script including the metacharacters listed in the \fBCommands\fR ! section. The first word of each command in the replaced text, other than any ! that are in the process of being replaced, are tested for aliases. If the last ! character of the alias value is a BLANK then the word following the alias is ! also checked for alias substitution. .sp .LP Aliases can be used to redefine built-in commands but cannot be used to redefine the reserved words listed in the \fBCommands\fR section. Aliases can be created and listed with the alias command and can be removed with the
*** 504,513 **** --- 535,545 ---- .sp .in +2 .nf autoload='typeset -fu' command='command ' + compound='typeset -C' fc=hist float='typeset -lE' functions='typeset -f' hash='alias -t --' history='hist -l'
*** 524,534 **** .fi .in -2 .sp .SS "Tilde Substitution" - .LP After alias substitution is performed, each word is checked to see if it begins with an unquoted tilde (\fB~\fR). For tilde substitution, \fIword\fR also refers to the \fIword\fR portion of parameter expansion. See \fBParameter Expansion\fR. .sp --- 556,565 ----
*** 544,575 **** In addition, when expanding a \fIvariable assignment\fR, tilde substitution is attempted when the value of the assignment begins with a \fB~\fR, and when a \fB~\fR appears after a colon (\fB:\fR). The \fB:\fR also terminates a \fB~\fR login name. .SS "Command Substitution" - .LP The standard output from a command enclosed in parentheses preceded by a dollar ! sign (\fB$\fR) or a pair of grave accents (\fB``\fR) can be used as part or all ! of a word. Trailing NEWLINEs are removed. In the second (obsolete) form, the ! string between the quotes is processed for special quoting characters before ! the command is executed. See \fBQuoting\fR. .sp .LP The command substitution \fB$(cat file)\fR can be replaced by the equivalent but faster \fB$(<file)\fR. The command substitution \fB$(\fR\fIn\fR\fB<#)\fR ! expands to the current byte offset for file descriptor \fIn\fR. .SS "Arithmetic Substitution" - .LP An arithmetic expression enclosed in double parentheses preceded by a dollar sign ( \fB$((\fR\fIarithmetic_expression\fR\fB))\fR) is replaced by the value of the arithmetic expression within the double parentheses. .SS "Process Substitution" - .LP - Process substitution is only available on versions of the UNIX operating system - that support the \fB/dev/fd\fR directory for naming open files. - .sp - .LP Each command argument of the form \fB<(\fR\fIlist\fR\fB)\fR or \fB>(\fR\fIlist\fR\fB)\fR runs process \fIlist\fR asynchronously connected to some file in \fB/dev/fd\fR. The name of this file becomes the argument to the command. If the form with \fB>\fR is selected then writing on this file provides input for \fIlist\fR. If \fB<\fR is used, then the file passed as an --- 575,606 ---- In addition, when expanding a \fIvariable assignment\fR, tilde substitution is attempted when the value of the assignment begins with a \fB~\fR, and when a \fB~\fR appears after a colon (\fB:\fR). The \fB:\fR also terminates a \fB~\fR login name. .SS "Command Substitution" The standard output from a command enclosed in parentheses preceded by a dollar ! sign ( \fB$(\fR\fIlist\fR\fB)\fR ), or in a brace group preceded by a dollar ! sign ( \fB${\fR \fIlist\fR\fB;}\fR ), or in a pair of grave accents (\fB``\fR) ! can be used as part or all of a word. Trailing NEWLINEs are removed. In the ! second case, the \fB{\fR and \fB}\fR are treated as a reserved words so that ! \fB{\fR must be followed by a blank and \fB}\fR must appear at the beginning of ! the line or follow a \fB;\fR. In the third (obsolete) form, the string between ! the quotes is processed for special quoting characters before the command is ! executed. See \fBQuoting\fR. .sp .LP The command substitution \fB$(cat file)\fR can be replaced by the equivalent but faster \fB$(<file)\fR. The command substitution \fB$(\fR\fIn\fR\fB<#)\fR ! expands to the current byte offset for file descriptor \fIn\fR. Except for the ! second form, the command list is run in a subshell so that no side effects are ! possible. For the second form, the final \fB}\fR will be recognized as a ! reserved word after any token. .SS "Arithmetic Substitution" An arithmetic expression enclosed in double parentheses preceded by a dollar sign ( \fB$((\fR\fIarithmetic_expression\fR\fB))\fR) is replaced by the value of the arithmetic expression within the double parentheses. .SS "Process Substitution" Each command argument of the form \fB<(\fR\fIlist\fR\fB)\fR or \fB>(\fR\fIlist\fR\fB)\fR runs process \fIlist\fR asynchronously connected to some file in \fB/dev/fd\fR. The name of this file becomes the argument to the command. If the form with \fB>\fR is selected then writing on this file provides input for \fIlist\fR. If \fB<\fR is used, then the file passed as an
*** 591,602 **** \fBcut\fRs fields 1 and 3 from the files \fIfile1\fR and \fIfile2\fR respectively, \fBpaste\fRs the results together, and sends it to the processes \fIprocess1\fR and \fIprocess2\fR. It also displays the results to the standard output. The file, which is passed as an argument to the command, is a UNIX \fBpipe\fR(2). Programs that expect to \fBlseek\fR(2) on the file do not work. .SS "Parameter Expansion" - .LP A parameter is a variable, one or more digits, or any of the characters \fB*\fR, \fB@\fR, \fB#\fR, \fB?\fR, \fB-\fR, \fB$\fR, and \fB!\fR. A variable is denoted by a \fIvname\fR. To create a variable whose \fIvname\fR contains a \fB\&.\fR, a variable whose \fBvname\fR consists of everything before the last . must already exist. A variable has a value and zero or more attributes. --- 622,636 ---- \fBcut\fRs fields 1 and 3 from the files \fIfile1\fR and \fIfile2\fR respectively, \fBpaste\fRs the results together, and sends it to the processes \fIprocess1\fR and \fIprocess2\fR. It also displays the results to the standard output. The file, which is passed as an argument to the command, is a UNIX \fBpipe\fR(2). Programs that expect to \fBlseek\fR(2) on the file do not work. + .sp + Process substitution of the form \fB<\fR(\fIlist\fR\fB)\fR can also be used + with the \fB<\fR redirection operator which causes the output of list to be + standard input or the input for whatever file descriptor is specified. .SS "Parameter Expansion" A parameter is a variable, one or more digits, or any of the characters \fB*\fR, \fB@\fR, \fB#\fR, \fB?\fR, \fB-\fR, \fB$\fR, and \fB!\fR. A variable is denoted by a \fIvname\fR. To create a variable whose \fIvname\fR contains a \fB\&.\fR, a variable whose \fBvname\fR consists of everything before the last . must already exist. A variable has a value and zero or more attributes.
*** 607,621 **** .sp .LP The shell supports both indexed and associative arrays. An element of an array variable is referenced by a subscript. A subscript for an indexed array is denoted by an arithmetic expression, (see \fBArithmetic Evaluation\fR), between ! a \fB[\fR and a \fB]\fR. Use \fBset -A\fR \fIvname value ...\fR to assign ! values to an indexed array. The value of all subscripts must be in the range of ! \fB0\fR through \fB1,048,575\fR. Indexed arrays do not need to be declared. Any ! reference to a variable with a valid subscript is legal and an array is created ! if necessary. .sp .LP An associative array is created with the \fB-A\fR option to \fBtypeset\fR. A subscript for an associative array is denoted by a string enclosed between \fB[\fR and \fB]\fR. --- 641,659 ---- .sp .LP The shell supports both indexed and associative arrays. An element of an array variable is referenced by a subscript. A subscript for an indexed array is denoted by an arithmetic expression, (see \fBArithmetic Evaluation\fR), between ! a \fB[\fR and a \fB]\fR. ! To assign values to an indexed array, use \fIvname\fR\fB=(\fR\fIvalue\fR ! \&...\fB)\fR or \fBset -A\fR \fIvname value ...\fR . ! The value of all subscripts must be in the range of ! \fB0\fR through \fB4,194,303\fR. A negative subscript is treated as an offset ! from the maximum current index +1 so that -1 refers to the last element. ! Indexed arrays can be declared with the \fB-a\fR option to typeset. Indexed ! arrays need not be declared. Any reference to a variable with a valid ! subscript is legal and an array will be created if necessary. .sp .LP An associative array is created with the \fB-A\fR option to \fBtypeset\fR. A subscript for an associative array is denoted by a string enclosed between \fB[\fR and \fB]\fR.
*** 642,668 **** .nf \fIvname\fR[\fIsubscript\fR]=\fIvalue\fR [\fIvname\fR[\fIsubscript\fR]=\fIvalue\fR] ... .fi .in -2 .sp ! .sp .LP ! No space is allowed before or after the \fB=\fR. A \fInameref\fR is a variable ! that is a reference to another variable. A \fInameref\fR is created with the ! \fB-n\fR attribute of \fBtypeset\fR. The value of the variable at the time of ! the \fBtypeset\fR command becomes the variable that is referenced whenever the ! \fInameref\fR variable is used. The name of a \fInameref\fR cannot contain a ! dot (\fI\&.\fR). When a variable or function name contains a \fB\&.,\fR and the ! portion of the name up to the first \fB\&.\fR matches the name of a ! \fInameref\fR, the variable referred to is obtained by replacing the ! \fInameref\fR portion with the name of the variable referenced by the ! \fInameref\fR. If a \fInameref\fR is used as the index of a \fBfor\fR loop, a ! name reference is established for each item in the list. A \fInameref\fR ! provides a convenient way to refer to the variable inside a function whose name ! is passed as an argument to a function. For example, if the name of a variable ! is passed as the first argument to a function, the command .sp .in +2 .nf typeset -n var=$1 .fi --- 680,719 ---- .nf \fIvname\fR[\fIsubscript\fR]=\fIvalue\fR [\fIvname\fR[\fIsubscript\fR]=\fIvalue\fR] ... .fi .in -2 .sp ! Note that no space is allowed before or after the \fB=\fR. .sp + Attributes assigned by the \fItypeset\fR special built-in command apply to all + elements of the array. + An array element can be a simple variable, a compound variable or an array + variable. + An element of an indexed array can be either an indexed array or an associative + array. + An element of an associative array can also be either. + To refer to an array element that is part of an array + element, concatenate the subscript in brackets. For example, to refer + to the \fIfoobar\fR element of an associative array that is defined as the + third element of the indexed array, use + \fB${\fIvname\fR\fB[\fR\fI3\fR\fB][\fR\fIfoobar\fR\fB]}\fR + .sp .LP ! A \fInameref\fR is a variable that is a reference to another variable. A ! \fInameref\fR is created with the \fB-n\fR attribute of \fBtypeset\fR. The ! value of the variable at the time of the \fBtypeset\fR command becomes the ! variable that is referenced whenever the \fInameref\fR variable is used. The ! name of a \fInameref\fR cannot contain a dot (\fI\&.\fR). When a variable or ! function name contains a dot (\fB\&.\fR) and the portion of the name up to the ! first \fB\&.\fR matches the name of a \fInameref\fR, the variable referred to ! is obtained by replacing the \fInameref\fR portion with the name of the ! variable referenced by the \fInameref\fR. If a \fInameref\fR is used as the ! index of a \fBfor\fR loop, a name reference is established for each item in the ! list. A \fInameref\fR provides a convenient way to refer to the variable inside ! a function whose name is passed as an argument to a function. For example, if ! the name of a variable is passed as the first argument to a function, the ! command .sp .in +2 .nf typeset -n var=$1 .fi
*** 671,712 **** .sp .LP inside the function causes references and assignments to \fIvar\fR to be references and assignments to the variable whose name has been passed to the ! function. If either of the floating point attributes, \fB-E\fR, or \fB-F\fR, or ! the integer attribute, \fB-i\fR, is set for \fIvname\fR, then the \fIvalue\fR ! is subject to arithmetic evaluation as described in this manual page. ! Positional parameters, parameters denoted by a number, can be assigned values ! with the \fBset\fR special built-in command. Parameter \fB$0\fR is set from ! argument zero when the shell is invoked. The character \fB$\fR is used to ! introduce substitutable parameters. .sp .ne 2 .na ! \fB\fB${\fR\fIparameter\fR\fB}\fR\fR .ad .sp .6 .RS 4n The shell reads all the characters from \fB${\fR to the matching \fB}\fR as part of the same word even if it contains braces or metacharacters. The value, if any, of the parameter is substituted. The braces are required when \fIparameter\fR is followed by a letter, digit, or underscore that is not to be ! interpreted as part of its name, when the variable name contains a \fB\&.\fR, ! or when a variable is subscripted. If \fIparameter\fR is one or more digits ! then it is a positional parameter. A positional parameter of more than one ! digit must be enclosed in braces. If \fIparameter\fR is \fB*\fR or \fB@\fR, ! then all the positional parameters, starting with \fB$1\fR, are substituted and ! separated by a field separator character. If an array \fIvname\fR with ! subscript \fB*\fR or \fB@\fR is used, then the value for each of the elements ! is substituted, separated by the first character of the value of \fBIFS\fR. .RE .sp .ne 2 .na ! \fB\fB${#\fR\fIparameter\fR\fB}\fR\fR .ad .sp .6 .RS 4n If \fIparameter\fR is \fB*\fR or \fB@\fR, the number of positional parameters is substituted. Otherwise, the length of the value of the \fIparameter\fR is --- 722,768 ---- .sp .LP inside the function causes references and assignments to \fIvar\fR to be references and assignments to the variable whose name has been passed to the ! function. If any of the floating point attributes, \fB-E\fR,\fB-F\fR or ! \fB-X\fR, or the integer attribute, \fB-i\fR, is set for \fIvname\fR, then the ! \fIvalue\fR is subject to arithmetic evaluation as described in this manual ! page. Positional parameters, parameters denoted by a number, can be assigned ! values with the \fBset\fR special built-in command. Parameter \fB$0\fR is set ! from argument zero when the shell is invoked. .sp + The character \fB$\fR is used to introduce substitutable parameters. + .sp .ne 2 .na ! \fB${\fR\fIparameter\fR\fB}\fR .ad .sp .6 .RS 4n The shell reads all the characters from \fB${\fR to the matching \fB}\fR as part of the same word even if it contains braces or metacharacters. The value, if any, of the parameter is substituted. The braces are required when \fIparameter\fR is followed by a letter, digit, or underscore that is not to be ! interpreted as part of its name or when the variable name contains a dot ! (\fB\&.\fR). The braces are also required when a variable is subscripted unless ! it is part of an Arithmetic Expression or a Conditional Expression. If ! \fIparameter\fR is one or more digits then it is a positional parameter. A ! positional parameter of more than one digit must be enclosed in braces. If ! \fIparameter\fR is \fB*\fR or \fB@\fR, then all the positional parameters, ! starting with \fB$1\fR, are substituted and separated by a field separator ! character. If an array \fIvname\fR with last subscript \fB*\fR or \fB@\fR is ! used, or for index arrays of the form \fIsub1\fR \fB\&..\fR \fIsub2\fR is used, ! then the value for each of the elements between \fIsub1\fR and \fIsub2\fR ! inclusive (or all elements for \fB*\fR and \fB@\fR) is substituted, separated ! by the first character of the value of \fBIFS\fR. .RE .sp .ne 2 .na ! \fB${#\fR\fIparameter\fR\fB}\fR .ad .sp .6 .RS 4n If \fIparameter\fR is \fB*\fR or \fB@\fR, the number of positional parameters is substituted. Otherwise, the length of the value of the \fIparameter\fR is
*** 714,738 **** .RE .sp .ne 2 .na ! \fB\fB${#\fR\fIvname\fR\fB[*]}\fR\fR .ad .br .na ! \fB\fB${#\fR\fIvname\fR\fB[@]}\fR\fR .ad .sp .6 .RS 4n The number of elements in the array \fIvname\fR is substituted. .RE .sp .ne 2 .na ! \fB\fB${!\fR\fIvname\fR\fB}\fR\fR .ad .sp .6 .RS 4n Expands to the name of the variable referred to by \fIvname\fR. This is \fIvname\fR except when \fIvname\fR is a name reference. --- 770,804 ---- .RE .sp .ne 2 .na ! \fB${#\fR\fIvname\fR\fB[*]}\fR .ad .br .na ! \fB${#\fR\fIvname\fR\fB[@]}\fR .ad .sp .6 .RS 4n The number of elements in the array \fIvname\fR is substituted. .RE + .ne 2 + .na + \fB${@\fR\fIvname\fR\fB}\fR + .ad + .sp .6 + .RS 4n + Expands to the type name or attributes of the variable referred to by + \fIvname\fR. See \fIType Variables\fR. + .RE + .sp .ne 2 .na ! \fB${!\fR\fIvname\fR\fB}\fR .ad .sp .6 .RS 4n Expands to the name of the variable referred to by \fIvname\fR. This is \fIvname\fR except when \fIvname\fR is a name reference.
*** 739,884 **** .RE .sp .ne 2 .na ! \fB\fB${!\fR\fIvname\fR\fB[\fR\fIsubscript\fR\fB]}\fR\fR .ad .sp .6 .RS 4n ! Expands to name of the subscript unless \fIsubscript\fR is \fB*\fR or \fB@\fR. When \fIsubscript\fR is \fB*\fR, the list of array subscripts for \fIvname\fR is generated. For a variable that is not an array, the value is \fB0\fR if the ! variable is set. Otherwise it is \fBnull\fR. When \fIsubscript\fR is \fB@\fR, it is the same as \fB$ {\fR\fIvname\fR\fB[\fR\fI*\fR\fB]}\fR, except that when used in double quotes, each array subscript yields a separate argument. .RE .sp .ne 2 .na ! \fB\fB${!\fR\fIprefix\fR\fB*}\fR\fR .ad .sp .6 .RS 4n Expands to the names of the variables whose names begin with \fIprefix\fR. .RE .sp .ne 2 .na ! \fB\fB${\fR\fIparameter\fR\fB:-\fR\fIword\fR\fB}\fR\fR .ad .sp .6 .RS 4n If \fIparameter\fR is set and is non-null then substitute its value. Otherwise substitute \fIword\fR. - .sp - \fIword\fR is not evaluated unless it is to be used as the substituted string. - .sp - In the following example, \fBpwd\fR is executed only if \fBd\fR is not set or - is NULL: - .sp - .in +2 - .nf - print ${d:-$(pwd)} - .fi - .in -2 - .sp - - If the colon (\fB:\fR ) is omitted from the expression, the shell only checks - whether \fIparameter\fR is set or not. .RE .sp .ne 2 .na ! \fB\fB${\fR\fIparameter\fR\fB:=\fR\fIword\fR\fB}\fR\fR .ad .sp .6 .RS 4n If \fIparameter\fR is not set or is \fBnull\fR, set it to \fIword\fR. The value of the parameter is then substituted. Positional parameters cannot be assigned to in this way. - .sp - \fIword\fR is not evaluated unless it is to be used as the substituted string. - .sp - In the following example, \fBpwd\fR is executed only if \fBd\fR is not set or - is NULL: - .sp - .in +2 - .nf - print ${d:-$(pwd)} - .fi - .in -2 - .sp - - If the colon (\fB:\fR) is omitted from the expression, the shell only checks - whether \fIparameter\fR is set or not. .RE .sp .ne 2 .na ! \fB\fB${\fR\fIparameter\fR\fB:?\fR\fIword\fR\fB}\fR\fR .ad .sp .6 .RS 4n If \fIparameter\fR is set and is non-null, substitute its value. Otherwise, print \fIword\fR and exit from the shell , if the shell is not interactive. If \fIword\fR is omitted then a standard message is printed. - .sp - \fIword\fR is not evaluated unless it is to be used as the substituted string. - .sp - In the following example, \fBpwd\fR is executed only if \fBd\fR is not set or - is NULL: - .sp - .in +2 - .nf - print ${d:-$(pwd)} - .fi - .in -2 - .sp - - If the colon (\fB:\fR ) is omitted from the expression, the shell only checks - whether \fIparameter\fR is set or not. .RE .sp .ne 2 .na ! \fB\fB${\fR\fIparameter\fR\fB:+\fR\fIword\fR\fB}\fR\fR .ad .sp .6 .RS 4n If \fIparameter\fR is set and is non-null, substitute \fIword\fR. Otherwise substitute nothing. .sp - \fIword\fR is not evaluated unless it is to be used as the substituted string. - .sp - In the following example, \fBpwd\fR is executed only if \fBd\fR is not set or - is NULL: - .sp .in +2 .nf print ${d:-$(pwd)} .fi .in -2 .sp If the colon (\fB:\fR) is omitted from the expression, the shell only checks whether \fIparameter\fR is set or not. - .RE .sp .ne 2 .na ! \fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR:\fIlength\fR}\fR .ad .br .na ! \fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR\fB}\fR\fR .ad .sp .6 .RS 4n Expands to the portion of the value of \fIparameter\fR starting at the character (counting from \fB0\fR) determined by expanding offset as an --- 805,908 ---- .RE .sp .ne 2 .na ! \fB${!\fR\fIvname\fR\fB[\fR\fIsubscript\fR\fB]}\fR .ad .sp .6 .RS 4n ! Expands to name of the subscript unless \fIsubscript\fR is \fB*\fR or \fB@\fR, ! or of the form \fIsub1\fR \fB..\fR \fIsub2\fR. When \fIsubscript\fR is \fB*\fR, the list of array subscripts for \fIvname\fR is generated. For a variable that is not an array, the value is \fB0\fR if the ! variable is set, otherwise it is \fBnull\fR. When \fIsubscript\fR is \fB@\fR, it is the same as \fB$ {\fR\fIvname\fR\fB[\fR\fI*\fR\fB]}\fR, except that when used in double quotes, each array subscript yields a separate argument. + When subscript is of the form \fIsub1\fR \fB..\fR \fIsub2\fR it expands to the + list of subscripts between \fIsub1\fR and \fIsub2\fR inclusive using the same + quoting rules as \fB@\fR. .RE .sp .ne 2 .na ! \fB${!\fR\fIprefix\fR\fB*}\fR .ad .sp .6 .RS 4n Expands to the names of the variables whose names begin with \fIprefix\fR. .RE .sp .ne 2 .na ! \fB${\fR\fIparameter\fR\fB:-\fR\fIword\fR\fB}\fR .ad .sp .6 .RS 4n If \fIparameter\fR is set and is non-null then substitute its value. Otherwise substitute \fIword\fR. .RE .sp .ne 2 .na ! \fB${\fR\fIparameter\fR\fB:=\fR\fIword\fR\fB}\fR .ad .sp .6 .RS 4n If \fIparameter\fR is not set or is \fBnull\fR, set it to \fIword\fR. The value of the parameter is then substituted. Positional parameters cannot be assigned to in this way. .RE .sp .ne 2 .na ! \fB${\fR\fIparameter\fR\fB:?\fR\fIword\fR\fB}\fR .ad .sp .6 .RS 4n If \fIparameter\fR is set and is non-null, substitute its value. Otherwise, print \fIword\fR and exit from the shell , if the shell is not interactive. If \fIword\fR is omitted then a standard message is printed. .RE .sp .ne 2 .na ! \fB${\fR\fIparameter\fR\fB:+\fR\fIword\fR\fB}\fR .ad .sp .6 .RS 4n If \fIparameter\fR is set and is non-null, substitute \fIword\fR. Otherwise substitute nothing. + .RE + + In the above, \fIword\fR is not evaluated unless it is to be used as the + substituted string. In the following example, \fBpwd\fR is executed only if + \fBd\fR is not set or is NULL: .sp .in +2 .nf print ${d:-$(pwd)} .fi .in -2 .sp If the colon (\fB:\fR) is omitted from the expression, the shell only checks whether \fIparameter\fR is set or not. .sp .ne 2 .na ! \fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR:\fIlength\fR}\fR .ad .br .na ! \fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR\fB}\fR .ad .sp .6 .RS 4n Expands to the portion of the value of \fIparameter\fR starting at the character (counting from \fB0\fR) determined by expanding offset as an
*** 897,911 **** .RE .sp .ne 2 .na ! \fB\fB${\fR\fIparameter\fR\fB#\fR\fIpattern\fR\fB}\fR\fR .ad .br .na ! \fB\fB${\fR\fIparameter\fR\fB##\fR\fIpattern\fR\fB}\fR\fR .ad .sp .6 .RS 4n If the shell \fIpattern\fR matches the beginning of the value of \fIparameter\fR, then the value of this expansion is the value of the --- 921,935 ---- .RE .sp .ne 2 .na ! \fB${\fR\fIparameter\fR\fB#\fR\fIpattern\fR\fB}\fR .ad .br .na ! \fB${\fR\fIparameter\fR\fB##\fR\fIpattern\fR\fB}\fR .ad .sp .6 .RS 4n If the shell \fIpattern\fR matches the beginning of the value of \fIparameter\fR, then the value of this expansion is the value of the
*** 918,932 **** .RE .sp .ne 2 .na ! \fB\fB${\fR\fIparameter\fR\fB%\fR\fIpattern\fR\fB}\fR\fR .ad .br .na ! \fB\fB${\fR\fIparameter\fR\fB%%\fR\fIpattern\fR\fB}\fR\fR .ad .sp .6 .RS 4n If the shell \fIpattern\fR matches the end of the value of \fIparameter\fR, then the value of this expansion is the value of the parameter with the matched --- 942,956 ---- .RE .sp .ne 2 .na ! \fB${\fR\fIparameter\fR\fB%\fR\fIpattern\fR\fB}\fR .ad .br .na ! \fB${\fR\fIparameter\fR\fB%%\fR\fIpattern\fR\fB}\fR .ad .sp .6 .RS 4n If the shell \fIpattern\fR matches the end of the value of \fIparameter\fR, then the value of this expansion is the value of the parameter with the matched
*** 938,960 **** .RE .sp .ne 2 .na ! \fB\fB${\fR\fIparameter\fR\fB/\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR .ad .br .na ! \fB\fB${\fR\fIparameter\fR\fB//\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR .ad .br .na ! \fB\fB${\fR\fIparameter\fR\fB/#\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR .ad .br .na ! \fB\fB${\fR\fIparameter\fR\fB/%\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR .ad .sp .6 .RS 4n Expands \fIparameter\fR and replaces the longest match of \fIpattern\fR with the specified \fIstring\fR. Each occurrence of \fB\e\fR\fIn\fR in \fIstring\fR --- 962,984 ---- .RE .sp .ne 2 .na ! \fB${\fR\fIparameter\fR\fB/\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR .ad .br .na ! \fB${\fR\fIparameter\fR\fB//\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR .ad .br .na ! \fB${\fR\fIparameter\fR\fB/#\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR .ad .br .na ! \fB${\fR\fIparameter\fR\fB/%\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR .ad .sp .6 .RS 4n Expands \fIparameter\fR and replaces the longest match of \fIpattern\fR with the specified \fIstring\fR. Each occurrence of \fB\e\fR\fIn\fR in \fIstring\fR
*** 982,1028 **** .LP The following parameters are automatically set by the shell: .sp .ne 2 .na ! \fB\fB#\fR\fR .ad .RS 19n The number of positional parameters in decimal. .RE .sp .ne 2 .na ! \fB\fB-\fR\fR .ad .RS 19n Options supplied to the shell on invocation or by the \fBset\fR command. .RE .sp .ne 2 .na ! \fB\fB?\fR\fR .ad .RS 19n The decimal value returned by the last executed command. .RE .sp .ne 2 .na ! \fB\fB$\fR\fR .ad .RS 19n The process number of this shell. .RE .sp .ne 2 .na ! \fB\fB_\fR\fR .ad .RS 19n Initially, the value of \fB_\fR is the absolute pathname of the shell or script being executed as passed in the environment. It is subsequently assigned the last argument of the previous command. --- 1006,1052 ---- .LP The following parameters are automatically set by the shell: .sp .ne 2 .na ! \fB#\fR .ad .RS 19n The number of positional parameters in decimal. .RE .sp .ne 2 .na ! \fB-\fR .ad .RS 19n Options supplied to the shell on invocation or by the \fBset\fR command. .RE .sp .ne 2 .na ! \fB?\fR .ad .RS 19n The decimal value returned by the last executed command. .RE .sp .ne 2 .na ! \fB$\fR .ad .RS 19n The process number of this shell. .RE .sp .ne 2 .na ! \fB_\fR .ad .RS 19n Initially, the value of \fB_\fR is the absolute pathname of the shell or script being executed as passed in the environment. It is subsequently assigned the last argument of the previous command.
*** 1033,1063 **** .RE .sp .ne 2 .na ! \fB\fB!\fR\fR .ad .RS 19n ! The process number of the last background command invoked or the most recent ! job put in the background with the \fBbg\fR built-in command. .RE .sp .ne 2 .na ! \fB\fB\&.sh.command\fR\fR .ad .RS 19n When processing a \fBDEBUG\fR trap, this variable contains the current command line that is about to run. .RE .sp .ne 2 .na ! \fB\fB\&.sh.edchar\fR\fR .ad .RS 19n This variable contains the value of the keyboard character (or sequence of characters if the first character is an ESC, \fBASCII 033\fR) that has been entered when processing a \fBKEYBD\fR trap. If the value is changed as part of --- 1057,1090 ---- .RE .sp .ne 2 .na ! \fB!\fR .ad .RS 19n ! The process id or the pool name and job number of the last background command ! invoked or the most recent job put in the background with the ! \fBbg\fR built-in command. Background jobs started in a named pool with be ! in the form \fIpool\fR.\fInumber\fR where \fIpool\fR is the pool name and ! \fInumber\fR is the job number within that pool. .RE .sp .ne 2 .na ! \fB\&.sh.command\fR .ad .RS 19n When processing a \fBDEBUG\fR trap, this variable contains the current command line that is about to run. .RE .sp .ne 2 .na ! \fB\&.sh.edchar\fR .ad .RS 19n This variable contains the value of the keyboard character (or sequence of characters if the first character is an ESC, \fBASCII 033\fR) that has been entered when processing a \fBKEYBD\fR trap. If the value is changed as part of
*** 1066,1086 **** .RE .sp .ne 2 .na ! \fB\fB\&.sh.edcol\fR\fR .ad .RS 19n The character position of the cursor at the time of the most recent \fBKEYBD\fR trap. .RE .sp .ne 2 .na ! \fB\fB\&.sh.edmode\fR\fR .ad .RS 19n The value is set to ESC when processing a \fBKEYBD\fR trap while in \fBvi\fR insert mode. Otherwise, \fB\&.sh.edmode\fR is null when processing a \fBKEYBD\fR trap. See the \fBvi Editing Mode\fR section of this manual page. --- 1093,1113 ---- .RE .sp .ne 2 .na ! \fB\&.sh.edcol\fR .ad .RS 19n The character position of the cursor at the time of the most recent \fBKEYBD\fR trap. .RE .sp .ne 2 .na ! \fB\&.sh.edmode\fR .ad .RS 19n The value is set to ESC when processing a \fBKEYBD\fR trap while in \fBvi\fR insert mode. Otherwise, \fB\&.sh.edmode\fR is null when processing a \fBKEYBD\fR trap. See the \fBvi Editing Mode\fR section of this manual page.
*** 1087,1125 **** .RE .sp .ne 2 .na ! \fB\fB\&.sh.edtext\fR\fR .ad .RS 19n The characters in the input buffer at the time of the most recent \fBKEYBD\fR trap. The value is null when not processing a \fBKEYBD\fR trap. .RE .sp .ne 2 .na ! \fB\fB\&.sh.file\fR\fR .ad .RS 19n The pathname of the file than contains the current command. .RE .sp .ne 2 .na ! \fB\fB\&.sh.fun\fR\fR .ad .RS 19n The name of the current function that is being executed. .RE .sp .ne 2 .na ! \fB\fB\&.sh.match\fR\fR .ad .RS 19n An indexed array which stores the most recent match and sub-pattern matches after conditional pattern matches that match and after variables expansions using the operators \fB#\fR, \fB%\fR, or \fB/\fR. The \fB0\fRth element stores --- 1114,1152 ---- .RE .sp .ne 2 .na ! \fB\&.sh.edtext\fR .ad .RS 19n The characters in the input buffer at the time of the most recent \fBKEYBD\fR trap. The value is null when not processing a \fBKEYBD\fR trap. .RE .sp .ne 2 .na ! \fB\&.sh.file\fR .ad .RS 19n The pathname of the file than contains the current command. .RE .sp .ne 2 .na ! \fB\&.sh.fun\fR .ad .RS 19n The name of the current function that is being executed. .RE .sp .ne 2 .na ! \fB\&.sh.match\fR .ad .RS 19n An indexed array which stores the most recent match and sub-pattern matches after conditional pattern matches that match and after variables expansions using the operators \fB#\fR, \fB%\fR, or \fB/\fR. The \fB0\fRth element stores
*** 1129,1243 **** .RE .sp .ne 2 .na ! \fB\fB\&.sh.name\fR\fR .ad .RS 19n Set to the name of the variable at the time that a discipline function is invoked. .RE .sp .ne 2 .na ! \fB\fB\&.sh.subscript\fR\fR .ad .RS 19n Set to the name subscript of the variable at the time that a discipline function is invoked. .RE .sp .ne 2 .na ! \fB\fB\&.sh.subshell\fR\fR .ad .RS 19n The current depth for sub-shells and command substitution. .RE .sp .ne 2 .na ! \fB\fB\&.sh.value\fR\fR .ad .RS 19n Set to the value of the variable at the time that the set or append discipline ! function is invoked. .RE .sp .ne 2 .na ! \fB\fB\&.sh.version\fR\fR .ad .RS 19n Set to a value that identifies the version of this shell. .RE .sp .ne 2 .na ! \fB\fBLINENO\fR\fR .ad .RS 19n The current line number within the script or function being executed. .RE .sp .ne 2 .na ! \fB\fBOLDPWD\fR\fR .ad .RS 19n The previous working directory set by the \fBcd\fR command. .RE .sp .ne 2 .na ! \fB\fBOPTARG\fR\fR .ad .RS 19n The value of the last option argument processed by the \fBgetopts\fR built-in command. .RE .sp .ne 2 .na ! \fB\fBOPTIND\fR\fR .ad .RS 19n The index of the last option argument processed by the \fBgetopts\fR built-in command. .RE .sp .ne 2 .na ! \fB\fBPPID\fR\fR .ad .RS 19n The process number of the parent of the shell. .RE .sp .ne 2 .na ! \fB\fBPWD\fR\fR .ad .RS 19n The present working directory set by the \fBcd\fR command. .RE .sp .ne 2 .na ! \fB\fBRANDOM\fR\fR .ad .RS 19n Each time this variable is referenced, a random integer, uniformly distributed between \fB0\fR and \fB32767\fR, is generated. The sequence of random numbers can be initialized by assigning a numeric value to \fBRANDOM\fR. --- 1156,1283 ---- .RE .sp .ne 2 .na ! \fB\&.sh.math\fR .ad .RS 19n + Used for defining arithmetic functions (see \fIArithmetic evaluation\fR) and + stores the list of user-defined arithmetic functions. + .RE + + .sp + .ne 2 + .na + \fB\&.sh.name\fR + .ad + .RS 19n Set to the name of the variable at the time that a discipline function is invoked. .RE .sp .ne 2 .na ! \fB\&.sh.subscript\fR .ad .RS 19n Set to the name subscript of the variable at the time that a discipline function is invoked. .RE .sp .ne 2 .na ! \fB\&.sh.subshell\fR .ad .RS 19n The current depth for sub-shells and command substitution. .RE .sp .ne 2 .na ! \fB\&.sh.value\fR .ad .RS 19n Set to the value of the variable at the time that the set or append discipline ! function is invoked. When a user-defined arithmetic function is invoked, the ! value of \fB.sh.value\fR is saved and \fB.sh.value\fR is set to long double ! precision floating point. \fB.sh.value\fR is restored when the function ! returns. .RE .sp .ne 2 .na ! \fB\&.sh.version\fR .ad .RS 19n Set to a value that identifies the version of this shell. .RE .sp .ne 2 .na ! \fBLINENO\fR .ad .RS 19n The current line number within the script or function being executed. .RE .sp .ne 2 .na ! \fBOLDPWD\fR .ad .RS 19n The previous working directory set by the \fBcd\fR command. .RE .sp .ne 2 .na ! \fBOPTARG\fR .ad .RS 19n The value of the last option argument processed by the \fBgetopts\fR built-in command. .RE .sp .ne 2 .na ! \fBOPTIND\fR .ad .RS 19n The index of the last option argument processed by the \fBgetopts\fR built-in command. .RE .sp .ne 2 .na ! \fBPPID\fR .ad .RS 19n The process number of the parent of the shell. .RE .sp .ne 2 .na ! \fBPWD\fR .ad .RS 19n The present working directory set by the \fBcd\fR command. .RE .sp .ne 2 .na ! \fBRANDOM\fR .ad .RS 19n Each time this variable is referenced, a random integer, uniformly distributed between \fB0\fR and \fB32767\fR, is generated. The sequence of random numbers can be initialized by assigning a numeric value to \fBRANDOM\fR.
*** 1244,1298 **** .RE .sp .ne 2 .na ! \fB\fBREPLY\fR\fR .ad .RS 19n This variable is set by the \fBselect\fR statement and by the \fBread\fR built-in command when no arguments are supplied. .RE .sp .ne 2 .na ! \fB\fBSECONDS\fR\fR .ad .RS 19n Each time this variable is referenced, the number of seconds since shell invocation is returned. If this variable is assigned a value, then the value returned upon reference is the value that was assigned plus the number of seconds since the assignment. .RE .sp .LP The following variables are used by the shell: .sp .ne 2 .na ! \fB\fBCDPATH\fR\fR .ad .RS 14n Defines the search path for the \fBcd\fR command. .RE .sp .ne 2 .na ! \fB\fBCOLUMNS\fR\fR .ad .RS 14n Defines the width of the edit window for the shell edit modes and for printing select lists. .RE .sp .ne 2 .na ! \fB\fBEDITOR\fR\fR .ad .RS 14n If the \fBVISUAL\fR variable is not set, the value of this variable is checked for the patterns as described with \fBVISUAL\fR and the corresponding editing option is turned on. --- 1284,1349 ---- .RE .sp .ne 2 .na ! \fBREPLY\fR .ad .RS 19n This variable is set by the \fBselect\fR statement and by the \fBread\fR built-in command when no arguments are supplied. .RE .sp .ne 2 .na ! \fBSECONDS\fR .ad .RS 19n Each time this variable is referenced, the number of seconds since shell invocation is returned. If this variable is assigned a value, then the value returned upon reference is the value that was assigned plus the number of seconds since the assignment. .RE .sp + .ne 2 + .na + \fBSHLVL\fR + .ad + .RS 19n + An integer variable the is incremented each time the shell is invoked and is + exported. If \fBSHLVL\fR is not in the environment when the shell is invoked, + it is set to 1. + .RE + + .sp .LP The following variables are used by the shell: .sp .ne 2 .na ! \fBCDPATH\fR .ad .RS 14n Defines the search path for the \fBcd\fR command. .RE .sp .ne 2 .na ! \fBCOLUMNS\fR .ad .RS 14n Defines the width of the edit window for the shell edit modes and for printing select lists. .RE .sp .ne 2 .na ! \fBEDITOR\fR .ad .RS 14n If the \fBVISUAL\fR variable is not set, the value of this variable is checked for the patterns as described with \fBVISUAL\fR and the corresponding editing option is turned on.
*** 1302,1312 **** .RE .sp .ne 2 .na ! \fB\fBENV\fR\fR .ad .RS 14n Performs parameter expansion, command substitution, and arithmetic substitution on the value to generate the pathname of the script that is executed when the shell is invoked. This file is typically used for alias and function --- 1353,1363 ---- .RE .sp .ne 2 .na ! \fBENV\fR .ad .RS 14n Performs parameter expansion, command substitution, and arithmetic substitution on the value to generate the pathname of the script that is executed when the shell is invoked. This file is typically used for alias and function
*** 1318,1328 **** .RE .sp .ne 2 .na ! \fB\fBFCEDIT\fR\fR .ad .RS 14n Obsolete name for the default editor name for the \fBhist\fR command. \fBFCEDIT\fR is not used when \fBHISTEDIT\fR is set. .sp --- 1369,1379 ---- .RE .sp .ne 2 .na ! \fBFCEDIT\fR .ad .RS 14n Obsolete name for the default editor name for the \fBhist\fR command. \fBFCEDIT\fR is not used when \fBHISTEDIT\fR is set. .sp
*** 1330,1350 **** .RE .sp .ne 2 .na ! \fB\fBFIGNORE\fR\fR .ad .RS 14n A pattern that defines the set of file names that is ignored when performing file name matching. .RE .sp .ne 2 .na ! \fB\fBFPATH\fR\fR .ad .RS 14n The search path for function definitions. The directories in this path are searched for a file with the same name as the function or command when a function with the \fB-u\fR attribute is referenced and when a command is not --- 1381,1401 ---- .RE .sp .ne 2 .na ! \fBFIGNORE\fR .ad .RS 14n A pattern that defines the set of file names that is ignored when performing file name matching. .RE .sp .ne 2 .na ! \fBFPATH\fR .ad .RS 14n The search path for function definitions. The directories in this path are searched for a file with the same name as the function or command when a function with the \fB-u\fR attribute is referenced and when a command is not
*** 1355,1383 **** .RE .sp .ne 2 .na ! \fB\fBHISTCMD\fR\fR .ad .RS 14n The number of the current command in the history file. .RE .sp .ne 2 .na ! \fB\fBHISTEDIT\fR\fR .ad .RS 14n The name for the default editor name for the \fBhist\fR command. .RE .sp .ne 2 .na ! \fB\fBHISTFILE\fR\fR .ad .RS 14n If this variable is set when the shell is invoked, the value is the pathname of the file that is used to store the command history. See the \fBCommand Re-entry\fR section of this manual page. --- 1406,1434 ---- .RE .sp .ne 2 .na ! \fBHISTCMD\fR .ad .RS 14n The number of the current command in the history file. .RE .sp .ne 2 .na ! \fBHISTEDIT\fR .ad .RS 14n The name for the default editor name for the \fBhist\fR command. .RE .sp .ne 2 .na ! \fBHISTFILE\fR .ad .RS 14n If this variable is set when the shell is invoked, the value is the pathname of the file that is used to store the command history. See the \fBCommand Re-entry\fR section of this manual page.
*** 1384,1394 **** .RE .sp .ne 2 .na ! \fB\fBHISTSIZE\fR\fR .ad .RS 14n If this variable is set when the shell is invoked, then the number of previously entered commands that are accessible by this shell is greater than or equal to this number. The default is \fB512\fR. --- 1435,1445 ---- .RE .sp .ne 2 .na ! \fBHISTSIZE\fR .ad .RS 14n If this variable is set when the shell is invoked, then the number of previously entered commands that are accessible by this shell is greater than or equal to this number. The default is \fB512\fR.
*** 1395,1405 **** .RE .sp .ne 2 .na ! \fB\fBHOME\fR\fR .ad .RS 14n The default argument (home directory) for the \fBcd\fR command. .sp \fBHOME\fR is not set by the shell. \fBHOME\fR is set by \fBlogin\fR(1). --- 1446,1456 ---- .RE .sp .ne 2 .na ! \fBHOME\fR .ad .RS 14n The default argument (home directory) for the \fBcd\fR command. .sp \fBHOME\fR is not set by the shell. \fBHOME\fR is set by \fBlogin\fR(1).
*** 1406,1416 **** .RE .sp .ne 2 .na ! \fB\fBIFS\fR\fR .ad .RS 14n Internal field separators, normally SPACE, TAB, and NEWLINE that are used to separate the results of command substitution or parameter expansion and to separate fields with the built-in command read. The first character of the --- 1457,1467 ---- .RE .sp .ne 2 .na ! \fBIFS\fR .ad .RS 14n Internal field separators, normally SPACE, TAB, and NEWLINE that are used to separate the results of command substitution or parameter expansion and to separate fields with the built-in command read. The first character of the
*** 1430,1470 **** .RE .sp .ne 2 .na ! \fB\fBLANG\fR\fR .ad .RS 14n This variable determines the locale category for any category not specifically selected with a variable starting with \fBLC_\fR or \fBLANG\fR. .RE .sp .ne 2 .na ! \fB\fBLC_ALL\fR\fR .ad .RS 14n This variable overrides the value of the \fBLANG\fR variable and any other \fBLC_\fR variable. .RE .sp .ne 2 .na ! \fB\fBLC_COLLATE\fR\fR .ad .RS 14n This variable determines the locale category for character collation information. .RE .sp .ne 2 .na ! \fB\fBLC_CTYPE\fR\fR .ad .RS 14n This variable determines the locale category for character handling functions. It determines the character classes for pattern matching. See the \fBFile Name Generation\fR section of this manual page. --- 1481,1532 ---- .RE .sp .ne 2 .na ! \fBJOBMAX\fR .ad .RS 14n + This variable defines the maximum number running background jobs that can run + at a time. When this limit is reached, the shell will wait for a job to + complete before staring a new job. + .RE + + .sp + .ne 2 + .na + \fBLANG\fR + .ad + .RS 14n This variable determines the locale category for any category not specifically selected with a variable starting with \fBLC_\fR or \fBLANG\fR. .RE .sp .ne 2 .na ! \fBLC_ALL\fR .ad .RS 14n This variable overrides the value of the \fBLANG\fR variable and any other \fBLC_\fR variable. .RE .sp .ne 2 .na ! \fBLC_COLLATE\fR .ad .RS 14n This variable determines the locale category for character collation information. .RE .sp .ne 2 .na ! \fBLC_CTYPE\fR .ad .RS 14n This variable determines the locale category for character handling functions. It determines the character classes for pattern matching. See the \fBFile Name Generation\fR section of this manual page.
*** 1471,1490 **** .RE .sp .ne 2 .na ! \fB\fBLC_NUMERIC\fR\fR .ad .RS 14n This variable determines the locale category for the decimal point character. .RE .sp .ne 2 .na ! \fB\fBLINES\fR\fR .ad .RS 14n If this variable is set, the value is used to determine the column length for printing select lists. Select lists prints vertically until about two-thirds of \fBLINES\fR lines are filled. --- 1533,1552 ---- .RE .sp .ne 2 .na ! \fBLC_NUMERIC\fR .ad .RS 14n This variable determines the locale category for the decimal point character. .RE .sp .ne 2 .na ! \fBLINES\fR .ad .RS 14n If this variable is set, the value is used to determine the column length for printing select lists. Select lists prints vertically until about two-thirds of \fBLINES\fR lines are filled.
*** 1491,1501 **** .RE .sp .ne 2 .na ! \fB\fBMAIL\fR\fR .ad .RS 14n If this variable is set to the name of a mail file \fBand\fR the \fBMAILPATH\fR variable is not set, then the shell informs the user of arrival of mail in the specified file. --- 1553,1563 ---- .RE .sp .ne 2 .na ! \fBMAIL\fR .ad .RS 14n If this variable is set to the name of a mail file \fBand\fR the \fBMAILPATH\fR variable is not set, then the shell informs the user of arrival of mail in the specified file.
*** 1505,1515 **** .RE .sp .ne 2 .na ! \fB\fBMAILCHECK\fR\fR .ad .RS 14n Specifies how often in seconds the shell checks for changes in the modification time of any of the files specified by the \fBMAILPATH\fR or \fBMAIL\fR variables. The default value is \fB600\fR seconds. When the time has elapsed --- 1567,1577 ---- .RE .sp .ne 2 .na ! \fBMAILCHECK\fR .ad .RS 14n Specifies how often in seconds the shell checks for changes in the modification time of any of the files specified by the \fBMAILPATH\fR or \fBMAIL\fR variables. The default value is \fB600\fR seconds. When the time has elapsed
*** 1519,1529 **** .RE .sp .ne 2 .na ! \fB\fBMAILPATH\fR\fR .ad .RS 14n A colon ( \fB:\fR ) separated list of file names. If this variable is set, then the shell informs the user of any modifications to the specified files that have occurred within the last \fBMAILCHECK\fR seconds. Each file name can be --- 1581,1591 ---- .RE .sp .ne 2 .na ! \fBMAILPATH\fR .ad .RS 14n A colon ( \fB:\fR ) separated list of file names. If this variable is set, then the shell informs the user of any modifications to the specified files that have occurred within the last \fBMAILCHECK\fR seconds. Each file name can be
*** 1534,1544 **** .RE .sp .ne 2 .na ! \fB\fBPATH\fR\fR .ad .RS 14n The search path for commands. Except in \fB\&.profile\fR, users cannot change \fBPATH\fR if executing under \fBrksh93\fR. See the \fBExecution\fR section of this manual page. --- 1596,1606 ---- .RE .sp .ne 2 .na ! \fBPATH\fR .ad .RS 14n The search path for commands. Except in \fB\&.profile\fR, users cannot change \fBPATH\fR if executing under \fBrksh93\fR. See the \fBExecution\fR section of this manual page.
*** 1547,1557 **** .RE .sp .ne 2 .na ! \fB\fBPS1\fR\fR .ad .RS 14n The value of this variable is expanded for parameter expansion, command substitution, and arithmetic substitution to define the primary prompt string which by default is \fB$\fR. The character \fB!\fR in the primary prompt string --- 1609,1619 ---- .RE .sp .ne 2 .na ! \fBPS1\fR .ad .RS 14n The value of this variable is expanded for parameter expansion, command substitution, and arithmetic substitution to define the primary prompt string which by default is \fB$\fR. The character \fB!\fR in the primary prompt string
*** 1563,1573 **** .RE .sp .ne 2 .na ! \fB\fBPS2\fR\fR .ad .RS 14n Secondary prompt string, by default, \fB>\fR. .sp The shell specifies a default value to \fBPS2\fR. --- 1625,1635 ---- .RE .sp .ne 2 .na ! \fBPS2\fR .ad .RS 14n Secondary prompt string, by default, \fB>\fR. .sp The shell specifies a default value to \fBPS2\fR.
*** 1574,1584 **** .RE .sp .ne 2 .na ! \fB\fBPS3\fR\fR .ad .RS 14n Selection prompt string used within a select loop, by default \fB#?\fR. .sp The shell specifies a default value to \fBPS3\fR. --- 1636,1646 ---- .RE .sp .ne 2 .na ! \fBPS3\fR .ad .RS 14n Selection prompt string used within a select loop, by default \fB#?\fR. .sp The shell specifies a default value to \fBPS3\fR.
*** 1585,1595 **** .RE .sp .ne 2 .na ! \fB\fBPS4\fR\fR .ad .RS 14n The value of this variable is expanded for parameter evaluation, command substitution, and arithmetic substitution and precedes each line of an execution trace. By default, \fBPS4\fR is \fB+\fR. When \fBPS4\fR is unset, the --- 1647,1657 ---- .RE .sp .ne 2 .na ! \fBPS4\fR .ad .RS 14n The value of this variable is expanded for parameter evaluation, command substitution, and arithmetic substitution and precedes each line of an execution trace. By default, \fBPS4\fR is \fB+\fR. When \fBPS4\fR is unset, the
*** 1599,1609 **** .RE .sp .ne 2 .na ! \fB\fBSHELL\fR\fR .ad .RS 14n The pathname of the shell is kept in the environment. At invocation, if the basename of this variable is \fBrsh\fR, \fBrksh\fR, \fBrksh93\fR, or \fBkrsh\fR, the shell becomes restricted. --- 1661,1671 ---- .RE .sp .ne 2 .na ! \fBSHELL\fR .ad .RS 14n The pathname of the shell is kept in the environment. At invocation, if the basename of this variable is \fBrsh\fR, \fBrksh\fR, \fBrksh93\fR, or \fBkrsh\fR, the shell becomes restricted.
*** 1613,1623 **** .RE .sp .ne 2 .na ! \fB\fBTIMEFORMAT\fR\fR .ad .RS 14n The value of this parameter is used as a format string specifying how the timing information for pipelines prefixed with the \fBtime\fR reserved word should be displayed. The \fB%\fR character introduces a format sequence that is --- 1675,1685 ---- .RE .sp .ne 2 .na ! \fBTIMEFORMAT\fR .ad .RS 14n The value of this parameter is used as a format string specifying how the timing information for pipelines prefixed with the \fBtime\fR reserved word should be displayed. The \fB%\fR character introduces a format sequence that is
*** 1625,1675 **** .sp The format sequences and their meanings are as follows. .sp .ne 2 .na ! \fB\fB%%\fR\fR .ad .sp .6 .RS 4n A literal \fB%\fR. .RE .sp .ne 2 .na ! \fB\fB%[\fIp\fR][l]R\fR\fR .ad .sp .6 .RS 4n The elapsed time in seconds. .RE .sp .ne 2 .na ! \fB\fB%[\fIp\fR][l]U\fR\fR .ad .sp .6 .RS 4n The number of CPU seconds spent in user mode. .RE .sp .ne 2 .na ! \fB\fB%[\fIp\fR][l]S\fR\fR .ad .sp .6 .RS 4n The number of CPU seconds spent in system mode. .RE .sp .ne 2 .na ! \fB\fB%P\fR\fR .ad .sp .6 .RS 4n The CPU percentage, computed as \fB(U + S) / R\fR. .RE --- 1687,1737 ---- .sp The format sequences and their meanings are as follows. .sp .ne 2 .na ! \fB%%\fR .ad .sp .6 .RS 4n A literal \fB%\fR. .RE .sp .ne 2 .na ! \fB%[\fIp\fR][l]R\fR .ad .sp .6 .RS 4n The elapsed time in seconds. .RE .sp .ne 2 .na ! \fB%[\fIp\fR][l]U\fR .ad .sp .6 .RS 4n The number of CPU seconds spent in user mode. .RE .sp .ne 2 .na ! \fB%[\fIp\fR][l]S\fR .ad .sp .6 .RS 4n The number of CPU seconds spent in system mode. .RE .sp .ne 2 .na ! \fB%P\fR .ad .sp .6 .RS 4n The CPU percentage, computed as \fB(U + S) / R\fR. .RE
*** 1691,1701 **** .RE .sp .ne 2 .na ! \fB\fBTMOUT\fR\fR .ad .RS 14n If set to a value greater than zero, \fBTMOUT\fR is the default time-out value for the \fBread\fR built-in command. The \fBselect\fR compound command terminates after \fBTMOUT\fR seconds when input is from a terminal. Otherwise, --- 1753,1763 ---- .RE .sp .ne 2 .na ! \fBTMOUT\fR .ad .RS 14n If set to a value greater than zero, \fBTMOUT\fR is the default time-out value for the \fBread\fR built-in command. The \fBselect\fR compound command terminates after \fBTMOUT\fR seconds when input is from a terminal. Otherwise,
*** 1707,1717 **** .RE .sp .ne 2 .na ! \fB\fBVISUAL\fR\fR .ad .RS 14n If the value of this variable matches the pattern \fB*[Vv][Ii]*\fR, then the \fBvi\fR option is turned on. See \fBSpecial Commands\fR. If the value matches the pattern \fB*gmacs*\fR , the \fBgmacs\fR option is turned on. If the value --- 1769,1779 ---- .RE .sp .ne 2 .na ! \fBVISUAL\fR .ad .RS 14n If the value of this variable matches the pattern \fB*[Vv][Ii]*\fR, then the \fBvi\fR option is turned on. See \fBSpecial Commands\fR. If the value matches the pattern \fB*gmacs*\fR , the \fBgmacs\fR option is turned on. If the value
*** 1718,1728 **** matches the pattern \fB*macs*\fR, then the \fBemacs\fR option is turned on. The value of \fBVISUAL\fR overrides the value of \fBEDITOR\fR. .RE .SS "Field Splitting" - .LP After parameter expansion and command substitution, the results of substitutions are scanned for the field separator characters (those found in \fBIFS\fR) and split into distinct fields where such characters are found. Explicit null fields (\fB""\fR or \fB\&''\fR) are retained. Implicit null fields, those resulting from parameters that have no values or command --- 1780,1789 ----
*** 1764,1774 **** \fB%\fR\fIfmt\fR, any format flags, widths and precisions can be specified and \fIfmt\fR can end in any of the specifiers \fBcdiouxX\fR. For example, \fB{a,z}{1..5..3%02d}{b..c}x\fR expands to the 8 fields, \fBa01bx, a01cx, a04bx, a04cx, z01bx, z01cx, z04bx,\fR and \fBz04cx\fR. .SS "File Name Generation" - .LP Following splitting, each field is scanned for the characters \fB*\fR, \fB?\fR, \fB(\fR, and \fB[\fR, unless the \fB-f\fR option has been set. If one of these characters appears, then the word is regarded as a pattern. .sp .LP --- 1825,1834 ----
*** 1785,1795 **** character \fB\&.\fR itself. For other uses of pattern matching the \fB/\fR and \fB\&.\fR are not specially treated. .sp .ne 2 .na ! \fB\fB*\fR\fR .ad .RS 11n Match any string, including the null string. When used for file name expansion, if the \fBglobstar\fR option is on, two adjacent \fB*\fRs by themselves match all files and zero or more directories and subdirectories. If the two adjacent --- 1845,1855 ---- character \fB\&.\fR itself. For other uses of pattern matching the \fB/\fR and \fB\&.\fR are not specially treated. .sp .ne 2 .na ! \fB*\fR .ad .RS 11n Match any string, including the null string. When used for file name expansion, if the \fBglobstar\fR option is on, two adjacent \fB*\fRs by themselves match all files and zero or more directories and subdirectories. If the two adjacent
*** 1797,1807 **** .RE .sp .ne 2 .na ! \fB\fB?\fR\fR .ad .RS 11n Matches any single character. .RE --- 1857,1867 ---- .RE .sp .ne 2 .na ! \fB?\fR .ad .RS 11n Matches any single character. .RE
*** 1811,1825 **** \fB[\fB\&...\fR]\fR .ad .RS 11n Match any one of the enclosed characters. A pair of characters separated by \fB-\fR matches any character lexically between the pair, inclusive. If the ! first character following the opening \fB[\fR is a \fB!\fR, any character not ! enclosed is matched. A \fB-\fR can be included in the character set by putting ! it as the first or last character. Within \fB[\fR and \fB]\fR, character ! classes can be specified with the syntax \fB[:\fR\fIclass\fR\fB:]\fR where ! \fIclass\fR is one of the following classes defined in the \fBANSI-C\fR standard: .sp .in +2 .nf \fIalnum alpha blank cntrl digit graph --- 1871,1885 ---- \fB[\fB\&...\fR]\fR .ad .RS 11n Match any one of the enclosed characters. A pair of characters separated by \fB-\fR matches any character lexically between the pair, inclusive. If the ! first character following the opening \fB[\fR is a \fB!\fR or \fB^\fR, any ! character not enclosed is matched. A \fB-\fR can be included in the character ! set by putting it as the first or last character. Within \fB[\fR and \fB]\fR, ! character classes can be specified with the syntax \fB[:\fR\fIclass\fR\fB:]\fR ! where \fIclass\fR is one of the following classes defined in the \fBANSI-C\fR standard: .sp .in +2 .nf \fIalnum alpha blank cntrl digit graph
*** 1844,1890 **** be matched whereas \fB|\fR requires that only one pattern be matched. Composite patterns can be formed with one or more of the following sub-patterns: .sp .ne 2 .na ! \fB\fB?(\fR\fIpattern-list\fR\fB)\fR\fR .ad .RS 22n Optionally matches any one of the specified patterns. .RE .sp .ne 2 .na ! \fB\fB*(\fR\fIpattern-list\fR\fB)\fR\fR .ad .RS 22n Matches zero or more occurrences of the specified patterns. .RE .sp .ne 2 .na ! \fB\fB+(\fR\fIpattern-list\fR\fB)\fR\fR .ad .RS 22n Matches one or more occurrences of the specified patterns. .RE .sp .ne 2 .na ! \fB\fB{\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR\fR .ad .RS 22n Matches \fIn\fR occurrences of the specified patterns. .RE .sp .ne 2 .na ! \fB\fB{\fR\fIm\fR\fB,\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR\fR .ad .RS 22n Matches from \fIm\fR to \fIn\fR occurrences of the specified patterns. If \fIm\fR is omitted, \fB0\fR is used. If \fIn\fR is omitted at least \fIm\fR occurrences are matched. --- 1904,1950 ---- be matched whereas \fB|\fR requires that only one pattern be matched. Composite patterns can be formed with one or more of the following sub-patterns: .sp .ne 2 .na ! \fB?(\fR\fIpattern-list\fR\fB)\fR .ad .RS 22n Optionally matches any one of the specified patterns. .RE .sp .ne 2 .na ! \fB*(\fR\fIpattern-list\fR\fB)\fR .ad .RS 22n Matches zero or more occurrences of the specified patterns. .RE .sp .ne 2 .na ! \fB+(\fR\fIpattern-list\fR\fB)\fR .ad .RS 22n Matches one or more occurrences of the specified patterns. .RE .sp .ne 2 .na ! \fB{\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR .ad .RS 22n Matches \fIn\fR occurrences of the specified patterns. .RE .sp .ne 2 .na ! \fB{\fR\fIm\fR\fB,\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR .ad .RS 22n Matches from \fIm\fR to \fIn\fR occurrences of the specified patterns. If \fIm\fR is omitted, \fB0\fR is used. If \fIn\fR is omitted at least \fIm\fR occurrences are matched.
*** 1891,1910 **** .RE .sp .ne 2 .na ! \fB\fB@(\fR\fIpattern-list\fR\fB)\fR\fR .ad .RS 22n Matches exactly one of the specified patterns. .RE .sp .ne 2 .na ! \fB\fB!(\fR\fIpattern-list\fR\fB)\fR\fR .ad .RS 22n Matches anything except one of the specified patterns. .RE --- 1951,1970 ---- .RE .sp .ne 2 .na ! \fB@(\fR\fIpattern-list\fR\fB)\fR .ad .RS 22n Matches exactly one of the specified patterns. .RE .sp .ne 2 .na ! \fB!(\fR\fIpattern-list\fR\fB)\fR .ad .RS 22n Matches anything except one of the specified patterns. .RE
*** 1923,1978 **** \fBANSI-C\fR character escapes are recognized and match the specified character. In addition the following escape sequences are recognized: .sp .ne 2 .na ! \fB\fB\ed\fR\fR .ad .RS 7n Matches any character in the digit class. .RE .sp .ne 2 .na ! \fB\fB\eD\fR\fR .ad .RS 7n Matches any character not in the digit class. .RE .sp .ne 2 .na ! \fB\fB\es\fR\fR .ad .RS 7n Matches any character in the space class. .RE .sp .ne 2 .na ! \fB\fB\eS\fR\fR .ad .RS 7n Matches any character not in the space class. .RE .sp .ne 2 .na ! \fB\fB\ew\fR\fR .ad .RS 7n Matches any character in the word class. .RE .sp .ne 2 .na ! \fB\fB\eW\fR\fR .ad .RS 7n Matches any character not in the word class. .RE --- 1983,2038 ---- \fBANSI-C\fR character escapes are recognized and match the specified character. In addition the following escape sequences are recognized: .sp .ne 2 .na ! \fB\ed\fR .ad .RS 7n Matches any character in the digit class. .RE .sp .ne 2 .na ! \fB\eD\fR .ad .RS 7n Matches any character not in the digit class. .RE .sp .ne 2 .na ! \fB\es\fR .ad .RS 7n Matches any character in the space class. .RE .sp .ne 2 .na ! \fB\eS\fR .ad .RS 7n Matches any character not in the space class. .RE .sp .ne 2 .na ! \fB\ew\fR .ad .RS 7n Matches any character in the word class. .RE .sp .ne 2 .na ! \fB\eW\fR .ad .RS 7n Matches any character not in the word class. .RE
*** 1987,2026 **** ending character matches. The behavior is unspecified when the first character of a \fIpattern-pair\fR is alphanumeric except for the following: .sp .ne 2 .na ! \fB\fBD\fR\fR .ad .RS 5n Causes the ending character to terminate the search for this pattern without finding a match. .RE .sp .ne 2 .na ! \fB\fBE\fR\fR .ad .RS 5n Causes the ending character to be interpreted as an escape character. .RE .sp .ne 2 .na ! \fB\fBL\fR\fR .ad .RS 5n Causes the ending character to be interpreted as a quote character causing all characters to be ignored when looking for a match. .RE .sp .ne 2 .na ! \fB\fBQ\fR\fR .ad .RS 5n Causes the ending character to be interpreted as a quote character causing all characters other than any escape character to be ignored when looking for a match. --- 2047,2086 ---- ending character matches. The behavior is unspecified when the first character of a \fIpattern-pair\fR is alphanumeric except for the following: .sp .ne 2 .na ! \fBD\fR .ad .RS 5n Causes the ending character to terminate the search for this pattern without finding a match. .RE .sp .ne 2 .na ! \fBE\fR .ad .RS 5n Causes the ending character to be interpreted as an escape character. .RE .sp .ne 2 .na ! \fBL\fR .ad .RS 5n Causes the ending character to be interpreted as a quote character causing all characters to be ignored when looking for a match. .RE .sp .ne 2 .na ! \fBQ\fR .ad .RS 5n Causes the ending character to be interpreted as a quote character causing all characters other than any escape character to be ignored when looking for a match.
*** 2042,2094 **** .LP A pattern can contain sub-patterns of the form \fB~(\fR\fIoptions\fR\fB:\fR\fIpattern-list\fR\fB)\fR, where either \fIoptions\fR or \fB:\fR\fIpattern-list\fR can be omitted. Unlike the other compound patterns, these sub-patterns are not counted in the numbered ! sub-patterns. If \fIoptions\fR is present, it can consist of one or more of the following: .sp .ne 2 .na ! \fB\fB+\fR\fR .ad .RS 5n Enable the following options. This is the default. .RE .sp .ne 2 .na ! \fB\fB-\fR\fR .ad .RS 5n Disable the following options. .RE .sp .ne 2 .na ! \fB\fBE\fR\fR .ad .RS 5n The remainder of the pattern uses extended regular expression syntax like the \fBegrep\fR(1) command. .RE .sp .ne 2 .na ! \fB\fBF\fR\fR .ad .RS 5n The remainder of the pattern uses \fBfgrep\fR(1) expression syntax. .RE .sp .ne 2 .na ! \fB\fBg\fR\fR .ad .RS 5n File the longest match (greedy). .sp This is the default. --- 2102,2156 ---- .LP A pattern can contain sub-patterns of the form \fB~(\fR\fIoptions\fR\fB:\fR\fIpattern-list\fR\fB)\fR, where either \fIoptions\fR or \fB:\fR\fIpattern-list\fR can be omitted. Unlike the other compound patterns, these sub-patterns are not counted in the numbered ! sub-patterns. \fB:\fR\fIpattern-list\fR must be omitted for options ! \fBF, G, N\fR and \fBV\fR below. ! If \fIoptions\fR is present, it can consist of one or more of the following: .sp .ne 2 .na ! \fB+\fR .ad .RS 5n Enable the following options. This is the default. .RE .sp .ne 2 .na ! \fB-\fR .ad .RS 5n Disable the following options. .RE .sp .ne 2 .na ! \fBE\fR .ad .RS 5n The remainder of the pattern uses extended regular expression syntax like the \fBegrep\fR(1) command. .RE .sp .ne 2 .na ! \fBF\fR .ad .RS 5n The remainder of the pattern uses \fBfgrep\fR(1) expression syntax. .RE .sp .ne 2 .na ! \fBg\fR .ad .RS 5n File the longest match (greedy). .sp This is the default.
*** 2095,2124 **** .RE .sp .ne 2 .na ! \fB\fBG\fR\fR .ad .RS 5n The remainder of the pattern uses basic regular expression syntax like the \fBgrep\fR(1) command. .RE .sp .ne 2 .na ! \fB\fBi\fR\fR .ad .RS 5n Treat the match as case insensitive. .RE .sp .ne 2 .na ! \fB\fBK\fR\fR .ad .RS 5n The remainder of the pattern uses shell pattern syntax. .sp This is the default. --- 2157,2186 ---- .RE .sp .ne 2 .na ! \fBG\fR .ad .RS 5n The remainder of the pattern uses basic regular expression syntax like the \fBgrep\fR(1) command. .RE .sp .ne 2 .na ! \fBi\fR .ad .RS 5n Treat the match as case insensitive. .RE .sp .ne 2 .na ! \fBK\fR .ad .RS 5n The remainder of the pattern uses shell pattern syntax. .sp This is the default.
*** 2125,2135 **** .RE .sp .ne 2 .na ! \fB\fBl\fR\fR .ad .RS 5n Left anchor the pattern. .sp This is the default for \fBK\fR style patterns. --- 2187,2197 ---- .RE .sp .ne 2 .na ! \fBl\fR .ad .RS 5n Left anchor the pattern. .sp This is the default for \fBK\fR style patterns.
*** 2136,2146 **** .RE .sp .ne 2 .na ! \fB\fBN\fR\fR .ad .RS 5n This is ignored. However, when it is the first letter and is used with file name generation, and no matches occur, the file pattern expands to the empty string. --- 2198,2208 ---- .RE .sp .ne 2 .na ! \fBN\fR .ad .RS 5n This is ignored. However, when it is the first letter and is used with file name generation, and no matches occur, the file pattern expands to the empty string.
*** 2147,2200 **** .RE .sp .ne 2 .na ! \fB\fBr\fR\fR .ad .RS 5n Right anchor the pattern. .sp This is the default for \fBK\fR style patterns. .RE .sp ! .LP ! If both \fIoptions\fR and \fB:\fR\fIpattern-list\fR are specified, then the ! options apply only to \fIpattern-list\fR. Otherwise, these options remain in ! effect until they are disabled by a subsequent \fB~(...)\fR or at the end of ! the sub-pattern containing \fB~(...)\fR. ! .SS "Quoting" ! .LP ! Each of the metacharacters listed in the \fBDefinitions\fR has a special ! meaning to the shell. .sp .ne 2 .na ! \fB\fBg\fR\fR .ad .RS 5n ! File the longest match (greedy). This is the default. .RE .sp .ne 2 .na ! \fB\fBi\fR\fR .ad .RS 5n ! Treat the match as case insensitive. .RE .sp .LP If both \fIoptions\fR and \fB:\fR\fIpattern-list\fR are specified, then the ! options apply only to \fIpattern-list\fR. Otherwise, the options remain in effect until they are disabled by a subsequent \fB~(...)\fR or at the end of the sub-pattern containing \fB~(...)\fR. ! .sp ! .LP Each of the metacharacters listed in the \fBDefinitions\fR section of this manual page has a special meaning to the shell and causes termination of a word unless quoted. A character can be quoted, that is, made to stand for itself, by preceding it with a backslash (\fB\e\fR). The pair \fB\e\fRNEWLINE is removed. All characters enclosed between a pair of single quote marks (\fB\&''\fR) that --- 2209,2261 ---- .RE .sp .ne 2 .na ! \fBr\fR .ad .RS 5n Right anchor the pattern. .sp This is the default for \fBK\fR style patterns. .RE .sp ! .ne 2 ! .na ! \fBX\fR ! .ad ! .RS 5n ! The remainder of the pattern uses augmented regular expression syntax. ! .RE ! .sp .ne 2 .na ! \fBP\fR .ad .RS 5n ! The remainder of the pattern uses \fIperl\fR(1) regular expression syntax. Not ! all perl regular expression syntax is currently implemented. .RE .sp .ne 2 .na ! \fBV\fR .ad .RS 5n ! The remainder of the pattern uses System V regular expression syntax. .RE .sp .LP If both \fIoptions\fR and \fB:\fR\fIpattern-list\fR are specified, then the ! options apply only to \fIpattern-list\fR. Otherwise, these options remain in effect until they are disabled by a subsequent \fB~(...)\fR or at the end of the sub-pattern containing \fB~(...)\fR. ! .SS "Quoting" Each of the metacharacters listed in the \fBDefinitions\fR section of this manual page has a special meaning to the shell and causes termination of a word unless quoted. A character can be quoted, that is, made to stand for itself, by preceding it with a backslash (\fB\e\fR). The pair \fB\e\fRNEWLINE is removed. All characters enclosed between a pair of single quote marks (\fB\&''\fR) that
*** 2202,2248 **** the single quotes. A single quoted string preceded by an unquoted \fB$\fR is processed as an \fBANSI-C\fR string except for the following: .sp .ne 2 .na ! \fB\fB\e0\fR\fR .ad .RS 19n Causes the remainder of the string to be ignored. .RE .sp .ne 2 .na ! \fB\fB\ec\fR\fIx\fR\fR .ad .RS 19n Expands to the character CTRL-x. .RE .sp .ne 2 .na ! \fB\fB\eC\fR[\fB\&.\fR\fIname\fR\fB\&.\fR]\fR .ad .RS 19n Expands to the collating element \fIname\fR. .RE .sp .ne 2 .na ! \fB\fB\ee\fR\fR .ad .RS 19n Equivalent to the escape character (\fBASCII\fR 033), .RE .sp .ne 2 .na ! \fB\fB\eE\fR\fR .ad .RS 19n Equivalent to the escape character (\fBASCII\fR 033), .RE --- 2263,2309 ---- the single quotes. A single quoted string preceded by an unquoted \fB$\fR is processed as an \fBANSI-C\fR string except for the following: .sp .ne 2 .na ! \fB\e0\fR .ad .RS 19n Causes the remainder of the string to be ignored. .RE .sp .ne 2 .na ! \fB\ec\fR\fIx\fR .ad .RS 19n Expands to the character CTRL-x. .RE .sp .ne 2 .na ! \fB\eC\fR[\fB\&.\fR\fIname\fR\fB\&.\fR]\fR .ad .RS 19n Expands to the collating element \fIname\fR. .RE .sp .ne 2 .na ! \fB\ee\fR .ad .RS 19n Equivalent to the escape character (\fBASCII\fR 033), .RE .sp .ne 2 .na ! \fB\eE\fR .ad .RS 19n Equivalent to the escape character (\fBASCII\fR 033), .RE
*** 2255,2291 **** specific string otherwise. The meaning of \fB$*\fR and \fB$@\fR is identical when not quoted or when used as a variable assignment value or as a file name. However, when used as a command argument, \fB"$*"\fR is equivalent to \fB"$1\fId\fR$2\fId\fR..."\fR, where \fId\fR is the first character of the IFS variable, whereas \fB"$@"\fR is equivalent to \fB"$1" "$2" ....\fR Inside grave ! quote marks (\fB``\fR), \fB\\fR quotes the characters \fB\e\fR, \fB`\fR, and \fB$\fR. If the grave quotes occur within double quotes, then \fB\e\fR also quotes the character \fB"\fR. .sp .LP The special meaning of reserved words or aliases can be removed by quoting any character of the reserved word. The recognition of function names or built-in command names cannot be altered by quoting them. .SS "Arithmetic Evaluation" - .LP The shell performs arithmetic evaluation for arithmetic substitution, to evaluate an arithmetic command, to evaluate an indexed array subscript, and to evaluate arguments to the built-in commands \fBshift\fR and \fBlet\fR. Arithmetic evaluation is also performed on argument operands of the built-in command printf that correspond to numeric format specifiers in the format operand. See \fBprintf\fR(1). Evaluations are performed using double precision floating point arithmetic or long double precision floating point for systems that provide this data type. Floating point constants follow the \fBANSI-C\fR ! programming language floating point conventions. Integer constants follow the ! \fBANSI-C\fR programming language integer constant conventions although only ! single byte character constants are recognized and character casts are not ! recognized. Constants can be of the form \fB[\fR\fIbase#\fR\fB]\fR\fIn\fR where ! \fIbase\fR is a decimal number between two and sixty-four representing the ! arithmetic base and \fIn\fR is a number in that base. The digits greater than ! \fB9\fR are represented by the lower case letters, the upper case letters, ! \fB@\fR, and \fB_\fR respectively. For bases less than or equal to \fB36\fR, ! upper and lower case characters can be used interchangeably. .sp .LP An arithmetic expression uses the same syntax, precedence, and associativity of expression as the C language. All the C language operators that apply to floating point quantities can be used. In addition, the operator \fB**\fR can --- 2316,2353 ---- specific string otherwise. The meaning of \fB$*\fR and \fB$@\fR is identical when not quoted or when used as a variable assignment value or as a file name. However, when used as a command argument, \fB"$*"\fR is equivalent to \fB"$1\fId\fR$2\fId\fR..."\fR, where \fId\fR is the first character of the IFS variable, whereas \fB"$@"\fR is equivalent to \fB"$1" "$2" ....\fR Inside grave ! quote marks (\fB``\fR), \fB\\\fR quotes the characters \fB\e\fR, \fB`\fR, and \fB$\fR. If the grave quotes occur within double quotes, then \fB\e\fR also quotes the character \fB"\fR. .sp .LP The special meaning of reserved words or aliases can be removed by quoting any character of the reserved word. The recognition of function names or built-in command names cannot be altered by quoting them. .SS "Arithmetic Evaluation" The shell performs arithmetic evaluation for arithmetic substitution, to evaluate an arithmetic command, to evaluate an indexed array subscript, and to evaluate arguments to the built-in commands \fBshift\fR and \fBlet\fR. Arithmetic evaluation is also performed on argument operands of the built-in command printf that correspond to numeric format specifiers in the format operand. See \fBprintf\fR(1). Evaluations are performed using double precision floating point arithmetic or long double precision floating point for systems that provide this data type. Floating point constants follow the \fBANSI-C\fR ! programming language floating point conventions. The floating point constants ! \fBNan\fR and \fBInf\fR can be used to represent "not a number" and ! infinity respectively. Integer constants follow the \fBANSI-C\fR programming ! language integer constant conventions although only single byte character ! constants are recognized and character casts are not recognized. Constants can ! be of the form \fB[\fR\fIbase#\fR\fB]\fR\fIn\fR where \fIbase\fR is a decimal ! number between two and sixty-four representing the arithmetic base and \fIn\fR ! is a number in that base. The digits greater than \fB9\fR are represented by ! the lower case letters, the upper case letters, \fB@\fR, and \fB_\fR ! respectively. For bases less than or equal to \fB36\fR, upper and lower case ! characters can be used interchangeably. .sp .LP An arithmetic expression uses the same syntax, precedence, and associativity of expression as the C language. All the C language operators that apply to floating point quantities can be used. In addition, the operator \fB**\fR can
*** 2300,2330 **** Any of the following math library functions that are in the C math library can be used within an arithmetic expression: .sp .in +2 .nf ! abs acos acosh asin asinh atan atan2 atanh cbrt ! copysign cos cosh erf erfc exp exp2 expm1 fabs ! fdim finite floor fma fmax fmod hypot ilogb ! int isinf isnan lgamma log log2 logb ! nearbyint nextafter nexttoward pow remainder ! rint round sin sinh sqrt tan tanh tgamma trunc .fi .in -2 .sp .sp .LP An internal representation of a \fIvariable\fR as a double precision floating ! point can be specified with the \fB-E [\fR\fIn\fR\fB]\fR or \fB-F ! [\fR\fIn\fR\fB]\fR option of the \fBtypeset\fR special built-in command. The \fB-E\fR option causes the expansion of the value to be represented using scientific notation when it is expanded. The optional option argument \fIn\fR defines the number of significant figures. The \fB-F\fR option causes the expansion to be represented as a floating decimal number when it is expanded. The optional option argument \fIn\fR defines the number of places after the ! decimal point in this case. .sp .LP An internal integer representation of a \fIvariable\fR can be specified with the \fB-i\fR \fB[\fR\fIn\fR\fB]\fR option of the \fBtypeset\fR special built-in command. The optional option argument \fIn\fR specifies an arithmetic base to --- 2362,2413 ---- Any of the following math library functions that are in the C math library can be used within an arithmetic expression: .sp .in +2 .nf ! rint round sin sinh sqrt tan tanh tgamma trunc abs acos ! acosh asin asinh atan atan2 atanh cbrt ceil copysign cos ! cosh erf erfc exp exp2 expm1 fabs fpclassify fdim finite ! floor fma fmax fmin fmod hypot ilogb int isfinite sinf isnan ! isnormal issubnormal issubor- dered iszero j0 j1 jn lgamma ! log log10 log2 logb nearbyint nextafter nexttoward pow ! remainder rint round scanb signbit sin sinh sqrt tan tanh ! tgamma trunc y0 y1 yn .fi .in -2 .sp .sp .LP + In addition, arithmetic functions can be defined as shell functions with a + variant of the \fBfunction\fR \fIname\fR syntax: + + \fBfunction .sh.math.\fR\fIname\fR \fIident\fR ... \fB{\fR \fIlist\fR \fB;}\fR + .RS 5 + where \fIname\fR is the function name used in the arithmetic expression and + each identified \fIident\fR is a name reference to the long double precision + floating point argument. The value of \fB.sh.value\fR when the function returns + is the value of this function. User defined functions can take up to 3 + arguments and override C math library functions. + .RE + + .sp + .LP An internal representation of a \fIvariable\fR as a double precision floating ! point can be specified with the \fB-E [\fR\fIn\fR\fB]\fR, \fB-F ! [\fR\fIn\fR\fB]\fR, or \fB-X [\fR\fIn\fR\fB]\fR options of the \fBtypeset\fR ! special built-in command. The \fB-E\fR option causes the expansion of the value to be represented using scientific notation when it is expanded. The optional option argument \fIn\fR defines the number of significant figures. The \fB-F\fR option causes the expansion to be represented as a floating decimal number when it is expanded. The optional option argument \fIn\fR defines the number of places after the ! decimal point in this case. The \fB-X\fR option causes the expansion to be ! represented using the \fB%a\fR format defined by ISO C-99. The optional option ! argument n defines the number of places after the decimal (or radix) point in ! this case. ! .sp .LP An internal integer representation of a \fIvariable\fR can be specified with the \fB-i\fR \fB[\fR\fIn\fR\fB]\fR option of the \fBtypeset\fR special built-in command. The optional option argument \fIn\fR specifies an arithmetic base to
*** 2331,2354 **** be used when expanding the variable. If you do not specify an arithmetic base, base 10 is used. .sp .LP Arithmetic evaluation is performed on the value of each assignment to a ! variable with the \fB-E\fR, \fB-F\fR, or \fB-i\fR option. Assigning a floating ! point number to a variable whose type is an integer causes the fractional part ! to be truncated. .SS "Prompting" - .LP When used interactively, the shell prompts with the value of \fBPS1\fR after expanding it for parameter expansion, command substitution, and arithmetic substitution, before reading a command. In addition, each single \fB!\fR in the prompt is replaced by the command number. A \fB!!\fR is required to place \fB!\fR in the prompt. If at any time a NEWLINE is typed and further input is needed to complete a command, then the secondary prompt, that is, the value of \fBPS2\fR, is issued. .SS "Conditional Expressions" - .LP A \fBconditional expression\fR is used with the \fB[[\fR compound command to test attributes of files and to compare strings. Field splitting and file name generation are not performed on the words between \fB[[\fR and \fB]]\fR. .sp .LP --- 2414,2435 ---- be used when expanding the variable. If you do not specify an arithmetic base, base 10 is used. .sp .LP Arithmetic evaluation is performed on the value of each assignment to a ! variable with the \fB-E\fR, \fB-F\fR, \fB-X\fR or \fB-i\fR option. Assigning a ! floating point number to a variable whose type is an integer causes the ! fractional part to be truncated. .SS "Prompting" When used interactively, the shell prompts with the value of \fBPS1\fR after expanding it for parameter expansion, command substitution, and arithmetic substitution, before reading a command. In addition, each single \fB!\fR in the prompt is replaced by the command number. A \fB!!\fR is required to place \fB!\fR in the prompt. If at any time a NEWLINE is typed and further input is needed to complete a command, then the secondary prompt, that is, the value of \fBPS2\fR, is issued. .SS "Conditional Expressions" A \fBconditional expression\fR is used with the \fB[[\fR compound command to test attributes of files and to compare strings. Field splitting and file name generation are not performed on the words between \fB[[\fR and \fB]]\fR. .sp .LP
*** 2355,2365 **** Each expression can be constructed from one or more of the following unary or binary expressions: .sp .ne 2 .na ! \fB\fB-a\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists. .sp This option is the same as \fB-e\fR. This option is obsolete. --- 2436,2446 ---- Each expression can be constructed from one or more of the following unary or binary expressions: .sp .ne 2 .na ! \fB-a\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists. .sp This option is the same as \fB-e\fR. This option is obsolete.
*** 2366,2578 **** .RE .sp .ne 2 .na ! \fB\fB-b\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is a block special file. .RE .sp .ne 2 .na ! \fB\fB-c\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is a character special file. .RE .sp .ne 2 .na ! \fB\fB-d\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is a directory. .RE .sp .ne 2 .na ! \fB\fB-e\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists. .RE .sp .ne 2 .na ! \fB\fB-f\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is an ordinary file. .RE .sp .ne 2 .na ! \fB\fB-g\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and it has its \fBsetgid\fR bit set. .RE .sp .ne 2 .na ! \fB\fB-G\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and its group matches the effective group id of this process. .RE .sp .ne 2 .na ! \fB\fB-h\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is a symbolic link. .RE .sp .ne 2 .na ! \fB\fB-k\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and it has its sticky bit set. .RE .sp .ne 2 .na ! \fB\fB-L\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is a symbolic link. .RE .sp .ne 2 .na ! \fB\fB-n\fR \fIstring\fR\fR .ad .RS 21n True, if length of \fIstring\fR is \fBnon-zero\fR. .RE .sp .ne 2 .na ! \fB\fB-N\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and the modification time is greater than the last access time. .RE .sp .ne 2 .na ! \fB\fB-o\fR \fIoption\fR\fR .ad .RS 21n True, if option named \fIoption\fR is on. .RE .sp .ne 2 .na ! \fB\fB-o\fR \fI?option\fR\fR .ad .RS 21n True, if option named \fIoption\fR is a valid option name. .RE .sp .ne 2 .na ! \fB\fB-O\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is owned by the effective user id of this process. .RE .sp .ne 2 .na ! \fB\fB-p\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is a \fBFIFO\fR special file or a pipe. .RE .sp .ne 2 .na ! \fB\fB-r\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is readable by current process. .RE .sp .ne 2 .na ! \fB\fB-s\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and has size greater than zero. .RE .sp .ne 2 .na ! \fB\fB-S\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is a socket. .RE .sp .ne 2 .na ! \fB\fB-t\fR \fIfildes\fR\fR .ad .RS 21n True, if file descriptor number \fIfildes\fR is open and associated with a terminal device. .RE .sp .ne 2 .na ! \fB\fB-u\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and it has its \fBsetuid\fR bit set. .RE .sp .ne 2 .na ! \fB\fB-w\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is writable by current process. .RE .sp .ne 2 .na ! \fB\fB-x\fR \fIfile\fR\fR .ad .RS 21n True, if \fIfile\fR exists and is executable by current process. If \fIfile\fR exists and is a directory, then true if the current process has permission to search in the directory. --- 2447,2677 ---- .RE .sp .ne 2 .na ! \fB-b\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is a block special file. .RE .sp .ne 2 .na ! \fB-c\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is a character special file. .RE .sp .ne 2 .na ! \fB-d\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is a directory. .RE .sp .ne 2 .na ! \fB-e\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists. .RE .sp .ne 2 .na ! \fB-f\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is an ordinary file. .RE .sp .ne 2 .na ! \fB-g\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and it has its \fBsetgid\fR bit set. .RE .sp .ne 2 .na ! \fB-G\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and its group matches the effective group id of this process. .RE .sp .ne 2 .na ! \fB-h\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is a symbolic link. .RE .sp .ne 2 .na ! \fB-k\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and it has its sticky bit set. .RE .sp .ne 2 .na ! \fB-L\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is a symbolic link. .RE .sp .ne 2 .na ! \fB-n\fR \fIstring\fR .ad .RS 21n True, if length of \fIstring\fR is \fBnon-zero\fR. .RE .sp .ne 2 .na ! \fB-N\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and the modification time is greater than the last access time. .RE .sp .ne 2 .na ! \fB-o\fR \fIoption\fR .ad .RS 21n True, if option named \fIoption\fR is on. .RE .sp .ne 2 .na ! \fB-o\fR \fI?option\fR .ad .RS 21n True, if option named \fIoption\fR is a valid option name. .RE .sp .ne 2 .na ! \fB-O\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is owned by the effective user id of this process. .RE .sp .ne 2 .na ! \fB-p\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is a \fBFIFO\fR special file or a pipe. .RE .sp .ne 2 .na ! \fB-r\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is readable by current process. .RE .sp .ne 2 .na ! \fB-R\fR \fIname\fR .ad .RS 21n + True if variable \fIname\fR is a name reference. + .RE + + .sp + .ne 2 + .na + \fB-s\fR \fIfile\fR + .ad + .RS 21n True, if \fIfile\fR exists and has size greater than zero. .RE .sp .ne 2 .na ! \fB-S\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is a socket. .RE .sp .ne 2 .na ! \fB-t\fR \fIfildes\fR .ad .RS 21n True, if file descriptor number \fIfildes\fR is open and associated with a terminal device. .RE .sp .ne 2 .na ! \fB-u\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and it has its \fBsetuid\fR bit set. .RE .sp .ne 2 .na ! \fB-v\fR \fIname\fR .ad .RS 21n + True, if variable \fIname\fR is a valid variable name and is set. + .RE + + .sp + .ne 2 + .na + \fB-w\fR \fIfile\fR + .ad + .RS 21n True, if \fIfile\fR exists and is writable by current process. .RE .sp .ne 2 .na ! \fB-x\fR \fIfile\fR .ad .RS 21n True, if \fIfile\fR exists and is executable by current process. If \fIfile\fR exists and is a directory, then true if the current process has permission to search in the directory.
*** 2579,2636 **** .RE .sp .ne 2 .na ! \fB\fB-z\fR \fIstring\fR\fR .ad .RS 21n True, if length of \fIstring\fR is zero. .RE .sp .ne 2 .na ! \fB\fIfile1\fR \fB-ef\fR \fIfile2\fR\fR .ad .RS 21n True, if \fIfile1\fR and \fIfile2\fR exist and refer to the same file. .RE .sp .ne 2 .na ! \fB\fIfile1\fR \fB-nt\fR \fIfile2\fR\fR .ad .RS 21n True, if \fIfile1\fR exists and \fIfile2\fR does not, or \fIfile1\fR is newer than \fIfile2\fR. .RE .sp .ne 2 .na ! \fB\fIfile1\fR \fB-ot\fR \fIfile2\fR\fR .ad .RS 21n True, if \fIfile2\fR exists and \fIfile1\fR does not, or \fIfile1\fR is older than \fIfile2\fR. .RE .sp .ne 2 .na ! \fB\fIstring\fR\fR .ad .RS 21n True, if \fIstring\fR is not null. .RE .sp .ne 2 .na ! \fB\fIstring\fR \fB==\fR \fIpattern\fR\fR .ad .RS 21n True, if \fIstring\fR matches \fIpattern\fR. Any part of \fIpattern\fR can be quoted to cause it to be matched as a string. With a successful match to \fIpattern\fR, the \fB\&.sh.match\fR array variable contains the match and --- 2678,2735 ---- .RE .sp .ne 2 .na ! \fB-z\fR \fIstring\fR .ad .RS 21n True, if length of \fIstring\fR is zero. .RE .sp .ne 2 .na ! \fB\fIfile1\fR \fB-ef\fR \fIfile2\fR .ad .RS 21n True, if \fIfile1\fR and \fIfile2\fR exist and refer to the same file. .RE .sp .ne 2 .na ! \fB\fIfile1\fR \fB-nt\fR \fIfile2\fR .ad .RS 21n True, if \fIfile1\fR exists and \fIfile2\fR does not, or \fIfile1\fR is newer than \fIfile2\fR. .RE .sp .ne 2 .na ! \fB\fIfile1\fR \fB-ot\fR \fIfile2\fR .ad .RS 21n True, if \fIfile2\fR exists and \fIfile1\fR does not, or \fIfile1\fR is older than \fIfile2\fR. .RE .sp .ne 2 .na ! \fB\fIstring\fR .ad .RS 21n True, if \fIstring\fR is not null. .RE .sp .ne 2 .na ! \fB\fIstring\fR \fB==\fR \fIpattern\fR .ad .RS 21n True, if \fIstring\fR matches \fIpattern\fR. Any part of \fIpattern\fR can be quoted to cause it to be matched as a string. With a successful match to \fIpattern\fR, the \fB\&.sh.match\fR array variable contains the match and
*** 2638,2657 **** .RE .sp .ne 2 .na ! \fB\fIstring\fR \fB=\fR \fIpattern\fR\fR .ad .RS 21n Same as \fB==\fR, but is obsolete. .RE .sp .ne 2 .na ! \fB\fIstring\fR \fB!=\fR \fIpattern\fR\fR .ad .RS 21n True, if \fIstring\fR does not match \fIpattern\fR. When the \fIstring\fR matches the \fIpattern\fR the \fB\&.sh.match\fR array variable contains the match and sub-pattern matches. --- 2737,2756 ---- .RE .sp .ne 2 .na ! \fB\fIstring\fR \fB=\fR \fIpattern\fR .ad .RS 21n Same as \fB==\fR, but is obsolete. .RE .sp .ne 2 .na ! \fB\fIstring\fR \fB!=\fR \fIpattern\fR .ad .RS 21n True, if \fIstring\fR does not match \fIpattern\fR. When the \fIstring\fR matches the \fIpattern\fR the \fB\&.sh.match\fR array variable contains the match and sub-pattern matches.
*** 2658,2749 **** .RE .sp .ne 2 .na ! \fB\fIstring\fR \fB=~\fR \fIere\fR\fR .ad .RS 21n True if \fIstring\fR matches the pattern \fB~(E)\fR\fIere\fR where \fIere\fR is an extended regular expression. .RE .sp .ne 2 .na ! \fB\fIstring1\fR \fB<\fR \fIstring2\fR\fR .ad .RS 21n True, if \fIstring1\fR comes before \fIstring2\fR based on \fBASCII\fR value of their characters. .RE .sp .ne 2 .na ! \fB\fIstring1\fR \fB>\fR \fIstring2\fR\fR .ad .RS 21n True, if \fIstring1\fR comes after \fIstring2\fR based on \fBASCII\fR value of their characters. .RE .sp ! .LP ! In each of the following expressions, if \fIfile\fR is of the form \fB/dev/fd/\fR\fIn\fR, where \fIn\fR is an integer, the test is applied to the ! open file whose descriptor number is \fIn\fR. The following obsolete arithmetic ! comparisons are supported: .sp .ne 2 .na ! \fB\fIexp1\fR \fB-eq\fR \fIexp2\fR\fR .ad .RS 17n True, if \fIexp1\fR is equal to \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-ge\fR \fIexp2\fR\fR .ad .RS 17n True, if \fIexp1\fR is greater than or equal to \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-gt\fR \fIexp2\fR\fR .ad .RS 17n True, if \fIexp1\fR is greater than \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-le\fR \fIexp2\fR\fR .ad .RS 17n True, if \fIexp1\fR is less than or equal to \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-lt\fR \fIexp2\fR\fR .ad .RS 17n True, if \fIexp1\fR is less than \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-ne\fR \fIexp2\fR\fR .ad .RS 17n True, if \fIexp1\fR is not equal to \fIexp2\fR. .RE --- 2757,2849 ---- .RE .sp .ne 2 .na ! \fB\fIstring\fR \fB=~\fR \fIere\fR .ad .RS 21n True if \fIstring\fR matches the pattern \fB~(E)\fR\fIere\fR where \fIere\fR is an extended regular expression. .RE .sp .ne 2 .na ! \fB\fIstring1\fR \fB<\fR \fIstring2\fR .ad .RS 21n True, if \fIstring1\fR comes before \fIstring2\fR based on \fBASCII\fR value of their characters. .RE .sp .ne 2 .na ! \fB\fIstring1\fR \fB>\fR \fIstring2\fR .ad .RS 21n True, if \fIstring1\fR comes after \fIstring2\fR based on \fBASCII\fR value of their characters. .RE .sp ! In each of the above expressions, if \fIfile\fR is of the form \fB/dev/fd/\fR\fIn\fR, where \fIn\fR is an integer, the test is applied to the ! open file whose descriptor number is \fIn\fR. .sp + .LP + The following obsolete arithmetic comparisons are also supported: + .sp .ne 2 .na ! \fB\fIexp1\fR \fB-eq\fR \fIexp2\fR .ad .RS 17n True, if \fIexp1\fR is equal to \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-ge\fR \fIexp2\fR .ad .RS 17n True, if \fIexp1\fR is greater than or equal to \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-gt\fR \fIexp2\fR .ad .RS 17n True, if \fIexp1\fR is greater than \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-le\fR \fIexp2\fR .ad .RS 17n True, if \fIexp1\fR is less than or equal to \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-lt\fR \fIexp2\fR .ad .RS 17n True, if \fIexp1\fR is less than \fIexp2\fR. .RE .sp .ne 2 .na ! \fB\fIexp1\fR \fB-ne\fR \fIexp2\fR .ad .RS 17n True, if \fIexp1\fR is not equal to \fIexp2\fR. .RE
*** 2752,2796 **** A compound expression can be constructed from these primitives by using any of the following, listed in decreasing order of precedence: .sp .ne 2 .na ! \fB\fB(\fR\fIexpression\fR\fB)\fR\fR .ad .RS 30n True, if \fIexpression\fR is true. Used to group expressions. .RE .sp .ne 2 .na ! \fB\fB!\fR \fIexpression\fR\fR .ad .RS 30n True, if \fIexpression\fR is false. .RE .sp .ne 2 .na ! \fB\fIexpression1\fR \fB&&\fR \fIexpression2\fR\fR .ad .RS 30n True, if \fIexpression1\fR and \fIexpression2\fR are both true. .RE .sp .ne 2 .na ! \fB\fIexpression1\fR \fB||\fR \fIexpression2\fR\fR .ad .RS 30n True, if either \fIexpression1\fR or \fIexpression2\fR is true. .RE .SS "Input and Output" - .LP Before a command is executed, its input and output can be redirected using a special notation interpreted by the shell. The following can appear anywhere in a simple command or can precede or follow a command and are \fBnot\fR passed on to the invoked command. Command substitution, parameter expansion, and arithmetic substitution occur before \fIword\fR or \fIdigit\fR is used except --- 2852,2895 ---- A compound expression can be constructed from these primitives by using any of the following, listed in decreasing order of precedence: .sp .ne 2 .na ! \fB(\fR\fIexpression\fR\fB)\fR .ad .RS 30n True, if \fIexpression\fR is true. Used to group expressions. .RE .sp .ne 2 .na ! \fB!\fR \fIexpression\fR .ad .RS 30n True, if \fIexpression\fR is false. .RE .sp .ne 2 .na ! \fB\fIexpression1\fR \fB&&\fR \fIexpression2\fR .ad .RS 30n True, if \fIexpression1\fR and \fIexpression2\fR are both true. .RE .sp .ne 2 .na ! \fB\fIexpression1\fR \fB||\fR \fIexpression2\fR .ad .RS 30n True, if either \fIexpression1\fR or \fIexpression2\fR is true. .RE .SS "Input and Output" Before a command is executed, its input and output can be redirected using a special notation interpreted by the shell. The following can appear anywhere in a simple command or can precede or follow a command and are \fBnot\fR passed on to the invoked command. Command substitution, parameter expansion, and arithmetic substitution occur before \fIword\fR or \fIdigit\fR is used except
*** 2811,2830 **** No intervening space is allowed between the characters of redirection operators. .sp .ne 2 .na ! \fB\fB<\fR\fIword\fR\fR .ad .RS 14n Use file \fIword\fR as standard input (file descriptor 0). .RE .sp .ne 2 .na ! \fB\fB>\fR\fIword\fR\fR .ad .RS 14n Use file \fIword\fR as standard output (file descriptor 1). If the file does not exist then it is created. If the file exists, and the \fBnoclobber\fR option is on, this causes an error. Otherwise, it is truncated to zero length. --- 2910,2929 ---- No intervening space is allowed between the characters of redirection operators. .sp .ne 2 .na ! \fB<\fR\fIword\fR .ad .RS 14n Use file \fIword\fR as standard input (file descriptor 0). .RE .sp .ne 2 .na ! \fB>\fR\fIword\fR .ad .RS 14n Use file \fIword\fR as standard output (file descriptor 1). If the file does not exist then it is created. If the file exists, and the \fBnoclobber\fR option is on, this causes an error. Otherwise, it is truncated to zero length.
*** 2831,2870 **** .RE .sp .ne 2 .na ! \fB\fB>|\fR\fIword\fR\fR .ad .RS 14n Same as \fB>\fR, except that it overrides the \fBnoclobber\fR option. .RE .sp .ne 2 .na ! \fB\fB>>\fR\fIword\fR\fR .ad .RS 14n Use file \fIword\fR as standard output. If the file exists, then output is appended to it (by first seeking to the end-of-file). Otherwise, the file is created. .RE .sp .ne 2 .na ! \fB\fB<>\fR\fIword\fR\fR .ad .RS 14n Open file \fIword\fR for reading and writing as standard input. .RE .sp .ne 2 .na ! \fB\fB<<\fR\fB[-]\fR\fIword\fR\fR .ad .RS 14n The shell input is read up to a line that is the same as \fIword\fR after any quoting has been removed, or to an end-of-file. No parameter substitution, command substitution, arithmetic substitution or file name generation is --- 2930,2980 ---- .RE .sp .ne 2 .na ! \fB>|\fR\fIword\fR .ad .RS 14n Same as \fB>\fR, except that it overrides the \fBnoclobber\fR option. .RE .sp .ne 2 .na ! \fB>;\fR\fIword\fR .ad .RS 14n + Write output to a temporary file. If the command completes successfully rename + it to word, otherwise, delete the temporary file. >;word cannot be used with + the \fBexec\fR(2) built-in. + .RE + + .sp + .ne 2 + .na + \fB>>\fR\fIword\fR + .ad + .RS 14n Use file \fIword\fR as standard output. If the file exists, then output is appended to it (by first seeking to the end-of-file). Otherwise, the file is created. .RE .sp .ne 2 .na ! \fB<>\fR\fIword\fR .ad .RS 14n Open file \fIword\fR for reading and writing as standard input. .RE .sp .ne 2 .na ! \fB<<\fR\fB[-]\fR\fIword\fR .ad .RS 14n The shell input is read up to a line that is the same as \fIword\fR after any quoting has been removed, or to an end-of-file. No parameter substitution, command substitution, arithmetic substitution or file name generation is
*** 2882,2892 **** .RE .sp .ne 2 .na ! \fB\fB<<<\fR\fIword\fR\fR .ad .RS 14n A short form of here document in which \fIword\fR becomes the contents of the here-document after any parameter expansion, command substitution, and arithmetic substitution occur. --- 2992,3002 ---- .RE .sp .ne 2 .na ! \fB<<<\fR\fIword\fR .ad .RS 14n A short form of here document in which \fIword\fR becomes the contents of the here-document after any parameter expansion, command substitution, and arithmetic substitution occur.
*** 2893,2951 **** .RE .sp .ne 2 .na ! \fB\fB<&\fR\fIdigit\fR\fR .ad .RS 14n The standard input is duplicated from file descriptor \fIdigit\fR, and similarly for the standard output using \fB>&\fR\fIdigit\fR. See \fBdup\fR(2). .RE .sp .ne 2 .na ! \fB\fB<&\fR\fIdigit\fR\fB-\fR\fR .ad .RS 14n The file descriptor specified by \fIdigit\fR is moved to standard input. Similarly for the standard output using \fB>&\fR\fIdigit\fR\fB-\fR. .RE .sp .ne 2 .na ! \fB\fB<&-\fR\fR .ad .RS 14n The standard input is closed. Similarly for the standard output using \fB>&-\fR. .RE .sp .ne 2 .na ! \fB\fB<&p\fR\fR .ad .RS 14n The input from the co-process is moved to standard input. .RE .sp .ne 2 .na ! \fB\fB>&p\fR\fR .ad .RS 14n The output to the co-process is moved to standard output. .RE .sp .ne 2 .na ! \fB\fB<#((\fR\fIexpr\fR\fB))\fR\fR .ad .RS 14n Evaluate arithmetic expression \fIexpr\fR and position file descriptor 0 to the resulting value bytes from the start of the file. The variables \fBCUR\fR and \fBEOF\fR evaluate to the current offset and end-of-file offset respectively --- 3003,3061 ---- .RE .sp .ne 2 .na ! \fB<&\fR\fIdigit\fR .ad .RS 14n The standard input is duplicated from file descriptor \fIdigit\fR, and similarly for the standard output using \fB>&\fR\fIdigit\fR. See \fBdup\fR(2). .RE .sp .ne 2 .na ! \fB<&\fR\fIdigit\fR\fB-\fR .ad .RS 14n The file descriptor specified by \fIdigit\fR is moved to standard input. Similarly for the standard output using \fB>&\fR\fIdigit\fR\fB-\fR. .RE .sp .ne 2 .na ! \fB<&-\fR .ad .RS 14n The standard input is closed. Similarly for the standard output using \fB>&-\fR. .RE .sp .ne 2 .na ! \fB<&p\fR .ad .RS 14n The input from the co-process is moved to standard input. .RE .sp .ne 2 .na ! \fB>&p\fR .ad .RS 14n The output to the co-process is moved to standard output. .RE .sp .ne 2 .na ! \fB<#((\fR\fIexpr\fR\fB))\fR .ad .RS 14n Evaluate arithmetic expression \fIexpr\fR and position file descriptor 0 to the resulting value bytes from the start of the file. The variables \fBCUR\fR and \fBEOF\fR evaluate to the current offset and end-of-file offset respectively
*** 2953,2981 **** .RE .sp .ne 2 .na ! \fB\fB>#((\fR\fIexpr\fR\fB))\fR\fR .ad .RS 14n The same as \fB<#\fR except applies to file descriptor 1. .RE .sp .ne 2 .na ! \fB\fB<#\fR\fIpattern\fR\fR .ad .RS 14n Seek forward to the beginning of the next line containing pattern. .RE .sp .ne 2 .na ! \fB\fB<##\fR\fIpattern\fR\fR .ad .RS 14n The same as \fB<#\fR, except that the portion of the file that is skipped is copied to standard output. .RE --- 3063,3091 ---- .RE .sp .ne 2 .na ! \fB>#((\fR\fIexpr\fR\fB))\fR .ad .RS 14n The same as \fB<#\fR except applies to file descriptor 1. .RE .sp .ne 2 .na ! \fB<#\fR\fIpattern\fR .ad .RS 14n Seek forward to the beginning of the next line containing pattern. .RE .sp .ne 2 .na ! \fB<##\fR\fIpattern\fR .ad .RS 14n The same as \fB<#\fR, except that the portion of the file that is skipped is copied to standard output. .RE
*** 3035,3045 **** is followed by \fB&\fR and job control is not active, the default standard input for the command is the empty file \fB/dev/null\fR. Otherwise, the environment for the execution of a command contains the file descriptors of the invoking shell as modified by input and output specifications. .SS "Environment" - .LP The \fIenvironment\fR is a list of name-value pairs that is passed to an executed program in the same way as a normal argument list. See \fBenviron\fR(5). .sp .LP --- 3145,3154 ----
*** 3098,3108 **** .sp .LP This feature is intended for use with scripts written for early versions of the shell and its use in new scripts is strongly discouraged. .SS "Functions" - .LP For historical reasons, there are two ways to define functions, the \fBname()\fR syntax and the \fBfunction\fR \fBname\fR syntax. These are described in the \fBCommands\fR section of this manual page. .sp .LP --- 3207,3216 ----
*** 3147,3157 **** Ordinarily, functions are unset when the shell executes a shell script. Functions that need to be defined across separate invocations of the shell should be placed in a directory and the \fBFPATH\fR variable should contain the name of this directory. They can also be specified in the \fBENV\fR file. .SS "Discipline Functions" - .LP Each variable can have zero or more discipline functions associated with it. The shell initially understands the discipline names \fBget\fR, \fBset\fR, \fBappend\fR, and \fBunset\fR but on most systems others can be added at run time via the C programming interface extension provided by the \fBbuiltin\fR built-in utility. If the \fBget\fR discipline is defined for a variable, it is --- 3255,3264 ----
*** 3173,3184 **** The variable \fB\&.sh.name\fR contains the name of the variable for which the discipline function is called, \fB\&.sh.subscript\fR is the subscript of the variable, and \fB\&.sh.value\fR contains the value being assigned inside the \fBset\fR discipline function. For the \fBset\fR discipline, changing \fB\&.sh.value\fR changes the value that gets assigned. .SS "Jobs" - .LP If the monitor option of the \fBset\fR command is turned on, an interactive shell associates a job with each pipeline. It keeps a table of current jobs, printed by the \fBjobs\fR command, and assigns them small integer numbers. When a job is started asynchronously with \fB&\fR, the shell prints a line which looks like: --- 3280,3370 ---- The variable \fB\&.sh.name\fR contains the name of the variable for which the discipline function is called, \fB\&.sh.subscript\fR is the subscript of the variable, and \fB\&.sh.value\fR contains the value being assigned inside the \fBset\fR discipline function. For the \fBset\fR discipline, changing \fB\&.sh.value\fR changes the value that gets assigned. + The variable \fB_\fR is a reference to the variable including the subscript if + any. For the set discipline, changing \fB\&.sh.value\fR will change the value + that gets assigned. Finally, the expansion \fB${\fR \fIvar.name\fR\fB}\fR, + when name is the name of a discipline, and there is no variable of this name, + is equivalent to the command substitution \fB${\fR\fIvar.name\fR\fB;}\fR. + + .SS "Name Spaces" + Commands and functions that are executed as part of the \fIlist\fR + of a \fBnamespace\fR command that modify variables or create new ones, create + a new variable whose name is the name of the name space as given by + \fIidentifier\fR preceded by two dots (\fB\&..\fR). + When a variable whose name is \fIname\fR is referenced, it is first searched + for using \fB.\fR\fIidentifier\fR\fB.\fR\fIname\fR\fB.\fR + Similarly, a function defined by a command in the \fBnamespace\fR \fIlist\fR + is created using the name space name preceded by two dots (\fB\&..\fR). + .PP + When the \fIlist\fR of a \fBnamespace\fR command contains a \fBnamespace\fR + command, the names of variables and functions that are created consist + of the variable or function name preceded by the list of \fIidentifier\fRs + each preceded by two dots (\fB\&..\fR). + .PP + Outside of a name space, a variable or function created inside a + name space can be referenced by preceding it with the name space name. + .PP + By default, variables staring with \fB.sh\fR are in the \fBsh\fR name space. + + .SS "Typed Variables" + Typed variables provide a way to create data structure and objects. A type can + be defined either by a shared library, by the \fBenum\fR built-in command + described below, or by using the new \fB-T\fR option of the \fBtypeset\fR + built-in command. With the \fB-T\fR option of \fBtypeset\fR, the type name, + specified as an option argument to \fB-T\fR, is set with a compound variable + assignment that defines the type. Function definitions can appear inside the + compound variable assignment and these become discipline functions for this + type and can be invoked or redefined by each instance of the type. The function + name \fBcreate\fR is treated specially. It is invoked for each instance of the + type that is created but is not inherited and cannot be redefined for each + instance. + + When a type is defined a special built-in command of that name is added. These + built-ins are declaration commands and follow the same expansion rules as all + the special built-in commands defined below that are preceded by a dot + (\fB\&.\fR). These commands can subsequently be used inside further type + definitions. The man page for these commands can be generated by using the + \fB--man\fR option or any of the other \fB--\fR options described with + \fBgetopts\fR. The \fB-r, -a, -A, -h\fR and \fB-S\fR options of \fBtypeset\fR + are permitted with each of these new built-ins. + + An instance of a type is created by invoking the type name + followed by one or more instance names. + Each instance of the type is initialized with a copy of the sub-variables + except for sub-variables that are defined with the \fB-s\fR + option. Variables defined with \fB-S\fR are shared by all instances of the + type. Each instance can change the value of any sub-variable and can also + define new discipline functions of the same names as those defined by the type + definition as well as any standard discipline names. No additional + sub-variables can be defined for any instance. + + When defining a type, if the value of a sub-variable is not set and the + \fB-r\fR attribute is specified, it causes the sub-variable to be a required + sub-variable. Whenever an instance of a type is created, all required + sub-variables must be specified. These sub-variables become readonly in each + instance. + + When \fBunset\fR is invoked on a sub-variable within a type, and the \fB-r\fR + attribute has not been specified for this field, the value is reset to the + default value associative with the type. Invoking \fBunset\fR on a type + instance not contained within another type deletes all sub-variables and the + variable itself. + + A type definition can be derived from another type definition by defining the + first sub-variable name as \fB_\fR and defining its type as the base type. Any + remaining definitions will be additions and modifications that apply to the new + type. If the new type name is the same is that of the base type, the type will + be replaced and the original type will no longer be accessible. + + The \fBtypeset\fR command with \fB-T\fR and no option argument or operands will + write all the type definitions to standard output in a form that that can be + read in to create all the types. + .SS "Jobs" If the monitor option of the \fBset\fR command is turned on, an interactive shell associates a job with each pipeline. It keeps a table of current jobs, printed by the \fBjobs\fR command, and assigns them small integer numbers. When a job is started asynchronously with \fB&\fR, the shell prints a line which looks like:
*** 3211,3277 **** disabled by giving the command \fBsttytostop\fR. If you set this \fBtty\fR option, then background jobs stop when they try to produce output like they do when they try to read input. .sp .LP There are several ways to refer to jobs in the shell. A job can be referred to by the process id of any process of the job or by one of the following: .sp .ne 2 .na ! \fB\fB%\fR\fInumber\fR\fR .ad .RS 12n The job with the specified number. .RE .sp .ne 2 .na ! \fB\fB%\fR\fIstring\fR\fR .ad .RS 12n Any job whose command line begins with \fIstring\fR. .RE .sp .ne 2 .na ! \fB\fB%?\fR\fIstring\fR\fR .ad .RS 12n Any job whose command line contains \fIstring\fR. .RE .sp .ne 2 .na ! \fB\fB%%\fR\fR .ad .RS 12n Current job. .RE .sp .ne 2 .na ! \fB\fB%+\fR\fR .ad .RS 12n Equivalent to \fB%%\fR. .RE .sp .ne 2 .na ! \fB\fB%-\fR\fR .ad .RS 12n Previous job. .RE .sp .LP The shell learns immediately whenever a process changes state. It normally informs you whenever a job becomes blocked so that no further progress is possible, but only just before it prints a prompt. This is done so that it does not otherwise disturb your work. The notify option of the \fBset\fR command --- 3397,3493 ---- disabled by giving the command \fBsttytostop\fR. If you set this \fBtty\fR option, then background jobs stop when they try to produce output like they do when they try to read input. .sp .LP + A job pool is a collection of jobs started with \fIlist\fR \fB&\fR associated + with a name. + .sp + .LP There are several ways to refer to jobs in the shell. A job can be referred to by the process id of any process of the job or by one of the following: .sp .ne 2 .na ! \fB%\fR\fInumber\fR .ad .RS 12n The job with the specified number. .RE .sp .ne 2 .na ! \fIpool\fR .ad .RS 12n + All the jobs in the job pool named by \fIpool\fR. + .RE + + .sp + .ne 2 + .na + \fIpool\fR\fB.\fR\fInumber\fR + .ad + .RS 12n + The job number \fInumber\fR in the pool named by \fIpool\fR. + .RE + + .sp + .ne 2 + .na + \fB%\fR\fIstring\fR + .ad + .RS 12n Any job whose command line begins with \fIstring\fR. .RE .sp .ne 2 .na ! \fB%?\fR\fIstring\fR .ad .RS 12n Any job whose command line contains \fIstring\fR. .RE .sp .ne 2 .na ! \fB%%\fR .ad .RS 12n Current job. .RE .sp .ne 2 .na ! \fB%+\fR .ad .RS 12n Equivalent to \fB%%\fR. .RE .sp .ne 2 .na ! \fB%-\fR .ad .RS 12n Previous job. .RE .sp + .ne 2 + In addition, unless noted otherwise, wherever a job can be specified, + the name of a background job pool can be used to represent all the + jobs in that pool. + .na + .ad + + .sp .LP The shell learns immediately whenever a process changes state. It normally informs you whenever a job becomes blocked so that no further progress is possible, but only just before it prints a prompt. This is done so that it does not otherwise disturb your work. The notify option of the \fBset\fR command
*** 3287,3303 **** command to see what they are. If you immediately try to exit again, the shell does not warn you a second time, and the stopped jobs are terminated. When a login shell receives a \fBHUP\fR signal, it sends a \fBHUP\fR signal to each job that has not been disowned with the \fBdisown\fR built-in command. .SS "Signals" - .LP The \fBINT\fR and \fBQUIT\fR signals for an invoked command are ignored if the command is followed by \fB&\fR and the \fBmonitor\fR option is not active. Otherwise, signals have the values inherited by the shell from its parent. See the \fBtrap\fR built-in command. .SS "Execution" - .LP Each time a command is read, the substitutions are carried out. If the command name matches one of the ones in the \fBSpecial Built-in Commands\fR section of this manual page, it is executed within the current shell process. Next, the command name is checked to see if it matches a user defined function. If it does, the positional parameters are saved and then reset to the arguments of --- 3503,3517 ----
*** 3308,3364 **** function is the value of the last command executed. If a command name is not a special built-in command or a user defined function, but it is one of the built-in commands, it is executed in the current shell process. .sp .LP ! The shell variable \fBPATH\fR defines the search path for the directory ! containing the command. Alternative directory names are separated by a colon ! (\fB:\fR). The default path is \fB/bin:/usr/bin:\fR, specifying \fB/bin\fR, ! \fB/usr/bin\fR, and the current directory in that order. The current directory ! can be specified by two or more adjacent colons, or by a colon at the beginning ! or end of the path list. If the command name contains a slash (\fB/\fR), the ! search path is not used. Otherwise, each directory in the path is searched for ! an executable file of the specified name that is not a directory. If found, and ! if the shell determines that there is a built-in version of a command ! corresponding to a specified pathname, this built-in is invoked in the current ! process. If found, and this directory is also contained in the value of the ! \fBFPATH\fR variable, then this file is loaded into the current shell ! environment as if it were the argument to the . command except that only preset ! aliases are expanded, and a function of the specified name is executed as ! described in this manual page. If not found, and the file \fB\&.paths\fR is ! found, and this file contains a line of the form \fBFPATH=\fR\fIpath\fR where ! \fIpath\fR is an existing directory, and this directory contains a file of the ! specified name, then this file is loaded into the current shell environment as ! if it were the argument to the \fB\&. special\fR built-in command and a ! function of the specified name is executed. Otherwise, if found, a process is ! created and an attempt is made to execute the command using \fBexec\fR(2). .sp .LP ! When an executable is found, the directory where it is found in is searched for ! a file named \fB\&.paths\fR. If this file is found and it contains a line of ! the form \fBBUILTIN_LIB=\fR\fIvalue\fR, the library named by \fIvalue\fR is ! searched for as if it were an option argument to \fBbuiltin -f\fR, and if it ! contains a built-in of the specified name this is executed instead of a command ! by this name. Otherwise, if this file is found and it contains a line of the ! form \fIname\fR\fB=\fR\fIvalue\fR in the first or second line, then the ! environment variable \fIname\fR is modified by prepending the directory ! specified by \fIvalue\fR to the directory list. If \fIvalue\fR is not an ! absolute directory, then it specifies a directory relative to the directory ! that the executable was found. If the environment variable \fIname\fR does not ! already exist it is added to the environment list for the specified command. .sp .LP If the file has execute permission but is not an \fBa.out\fR file, it is assumed to be a file containing shell commands. A separate shell is spawned to read it. All non-exported variables are removed in this case. If the shell command file doesn't have read permission, and/or if the \fBsetuid\fR and \fBsetgid\fR bits are set on the file, then the shell executes an agent whose job it is to set up the permissions and execute the shell with the shell ! command file passed down as an open file. A parenthesized command is executed ! in a sub-shell without removing non-exported variables. .SS "Command Re-entry" - .LP The text of the last \fBHISTSIZE\fR (default 512) commands entered from a terminal device is saved in a history file. The file \fB$HOME/.sh_history\fR is used if the \fBHISTFILE\fR variable is not set or if the file it names is not writable. A shell can access the commands of all interactive shells which use the same named \fBHISTFILE\fR. The built-in command \fBhist\fR is used to list --- 3522,3605 ---- function is the value of the last command executed. If a command name is not a special built-in command or a user defined function, but it is one of the built-in commands, it is executed in the current shell process. .sp .LP ! The shell variables \fBPATH\fR and \fBFPATH\fR define the search path for the ! directory containing the command. Alternative directory names are separated by ! a colon (\fB:\fR). The default path is \fB/bin:/usr/bin:\fR, specifying ! \fB/bin\fR, \fB/usr/bin\fR, and the current directory in that order. The ! current directory can be specified by two or more adjacent colons, or by a ! colon at the beginning or end of the path list. If the command name contains a ! slash (\fB/\fR), the search path is not used. Otherwise, each directory in the ! list of directories defined by \fBPATH\fR and \fBFPATH\fR is checked in order. ! If the directory being searched is contained in the value of the \fBFPATH\fR ! variable and contains a file whose name matches the command being searched, ! then this file is loaded into the current shell environment as if it were the ! argument to the . command except that only preset aliases are expanded, and a ! function of the specified name is executed as described in this manual page. .sp .LP ! If this directory is not in \fBFPATH\fR, the shell first determines whether ! there is a built-in version of a command corresponding to a given pathname and, ! if so, it is invoked in the current process. If no built-in is found, the shell ! checks for a file named \fB\&.paths\fR in this directory. If found and there is ! a line of the form: .sp + .in +2 + \fBFPATH=\fR\fIpath\fR + .in -2 + .sp + where \fIpath\fR is an existing directory, then that directory is searched + immediately after the current directory as if it were found in the \fBFPATH\fR + variable. If \fIpath\fR does not begin with \fB/\fR, it is checked for relative + to the directory being searched. + .sp .LP + The \fB\&.paths\fR file is then checked for a line of the form: + .sp + .in +2 + \fBPLUGIN_LIB=\fR\fIlibname\fR [ \fB:\fR \fIlibname\fR \fB]\fR ... + .in -2 + .sp + Each library named by \fIlibname\fR will be searched for as if it were an + option argument to \fBbuiltin -f\fR and, if it contains a built-in of the + specified name, this is executed instead of a command by this name. + .sp + .LP + Any built-in loaded from a library found this way will be associated with the + directory containing the \fB.paths\fR file so it will only execute if not found + in an earlier directory. + .sp + .LP + Finally, the directory will be checked for a file of the given name. If the file has execute permission but is not an \fBa.out\fR file, it is assumed to be a file containing shell commands. A separate shell is spawned to read it. All non-exported variables are removed in this case. If the shell command file doesn't have read permission, and/or if the \fBsetuid\fR and \fBsetgid\fR bits are set on the file, then the shell executes an agent whose job it is to set up the permissions and execute the shell with the shell ! command file passed down as an open file. ! ! If the \fB.paths\fR contains a line of the form: ! .sp ! .in +2 ! \fBname=\fR\fIvalue\fR ! .in -2 ! .sp ! in the ! first or second line, then the environment variable \fIname\fR is modified by ! prepending the directory specified by \fIvalue\fR to the directory list. If ! \fIvalue\fR is not an absolute directory, then it specifies a directory ! relative to the directory in which the executable was found. If the environment ! variable \fIname\fR does not already exist it will be added to the environment ! list for the specified command. ! ! A parenthesized command is executed in a sub-shell without removing ! non-exported variables. ! .SS "Command Re-entry" The text of the last \fBHISTSIZE\fR (default 512) commands entered from a terminal device is saved in a history file. The file \fB$HOME/.sh_history\fR is used if the \fBHISTFILE\fR variable is not set or if the file it names is not writable. A shell can access the commands of all interactive shells which use the same named \fBHISTFILE\fR. The built-in command \fBhist\fR is used to list
*** 3376,3386 **** execution. For example, with the preset alias \fBr\fR, which is aliased to \fB\&'hist -s'\fR, typing \fB`r bad=good c'\fR re-executes the most recent command which starts with the letter \fBc\fR, replacing the first occurrence of the string bad with the string good. .SS "Inline Editing Options" - .LP Normally, each command line entered from a terminal device is simply typed followed by a NEWLINE (RETURN or LINE FEED). If either the \fBemacs\fR, \fBgmacs\fR, or \fBvi\fR option is active, the user can edit the command line. To be in either of these edit modes set the corresponding option. An editing option is automatically selected each time the \fBVISUAL\fR or \fBEDITOR\fR --- 3617,3626 ----
*** 3431,3441 **** command name followed by a space. When using a \fBTAB\fR for completion that does not yield a unique match, a subsequent TAB provides a numbered list of matching alternatives. A specific selection can be made by entering the selection number followed by a TAB. .SS "Key Bindings" - .LP The \fBKEYBD\fR trap can be used to intercept keys as they are typed and change the characters that are actually seen by the shell. This trap is executed after each character (or sequence of characters when the first character is ESC) is entered while reading from a terminal. .sp --- 3671,3680 ----
*** 3452,3462 **** .sp .LP This trap is not invoked for characters entered as arguments to editing directives, or while reading input for a character search. .SS "\fBemacs\fR Editing Mode" - .LP This mode is entered by enabling either the \fBemacs\fR or \fBgmacs\fR option. The only difference between these two modes is the way they handle \fB^T\fR. To edit, the user moves the cursor to the point needing correction and then inserts or deletes characters or words as needed. All the editing commands are control characters or escape sequences. The notation for control characters is --- 3691,3700 ----
*** 3478,3616 **** beginning. The RETURN or the LINE FEED key is not entered after edit commands except when noted. .sp .ne 2 .na ! \fB\fB^F\fR\fR .ad .RS 13n Move the cursor forward (right) one character. .RE .sp .ne 2 .na ! \fB\fBM-[C\fR\fR .ad .RS 13n Move the cursor forward (right) one character. .RE .sp .ne 2 .na ! \fB\fBM-f\fR\fR .ad .RS 13n Move the cursor forward one word. The \fBemacs\fR editor's idea of a word is a string of characters consisting of only letters, digits and underscores. .RE .sp .ne 2 .na ! \fB\fB^B\fR\fR .ad .RS 13n Move the cursor backward (left) one character. .RE .sp .ne 2 .na ! \fB\fBM-[D\fR\fR .ad .RS 13n Move the cursor backward (left) one character. .RE .sp .ne 2 .na ! \fB\fBM-b\fR\fR .ad .RS 13n Move the cursor backward one word. .RE .sp .ne 2 .na ! \fB\fB^A\fR\fR .ad .RS 13n Move the cursor to the beginning of the line. .RE .sp .ne 2 .na ! \fB\fBM-[H\fR\fR .ad .RS 13n Move the cursor to the beginning of the line. .RE .sp .ne 2 .na ! \fB\fB^E\fR\fR .ad .RS 13n Move the cursor to the end of the line. .RE .sp .ne 2 .na ! \fB\fBM-[Y\fR\fR .ad .RS 13n Move the cursor to the end of line. .RE .sp .ne 2 .na ! \fB\fB^]\fR\fIchar\fR\fR .ad .RS 13n Move the cursor forward to the character \fIchar\fR on the current line. .RE .sp .ne 2 .na ! \fB\fBM-^]\fR\fIchar\fR\fR .ad .RS 13n Move the cursor backwards to the character \fIchar\fR on the current line. .RE .sp .ne 2 .na ! \fB\fB^X^X\fR\fR .ad .RS 13n Interchange the cursor and the mark. .RE .sp .ne 2 .na ! \fB\fIerase\fR\fR .ad .RS 13n Delete the previous character. The user-defined erase character is defined by the \fBstty\fR(1) command, and is usually \fB^H\fR or \fB#\fR. .RE .sp .ne 2 .na ! \fB\fIlnext\fR\fR .ad .RS 13n Removes the next character's editing features. The user-defined literal next character is defined by the \fBstty\fR(1) command, or is \fB^V\fR if not defined. --- 3716,3854 ---- beginning. The RETURN or the LINE FEED key is not entered after edit commands except when noted. .sp .ne 2 .na ! \fB^F\fR .ad .RS 13n Move the cursor forward (right) one character. .RE .sp .ne 2 .na ! \fBM-[C\fR .ad .RS 13n Move the cursor forward (right) one character. .RE .sp .ne 2 .na ! \fBM-f\fR .ad .RS 13n Move the cursor forward one word. The \fBemacs\fR editor's idea of a word is a string of characters consisting of only letters, digits and underscores. .RE .sp .ne 2 .na ! \fB^B\fR .ad .RS 13n Move the cursor backward (left) one character. .RE .sp .ne 2 .na ! \fBM-[D\fR .ad .RS 13n Move the cursor backward (left) one character. .RE .sp .ne 2 .na ! \fBM-b\fR .ad .RS 13n Move the cursor backward one word. .RE .sp .ne 2 .na ! \fB^A\fR .ad .RS 13n Move the cursor to the beginning of the line. .RE .sp .ne 2 .na ! \fBM-[H\fR .ad .RS 13n Move the cursor to the beginning of the line. .RE .sp .ne 2 .na ! \fB^E\fR .ad .RS 13n Move the cursor to the end of the line. .RE .sp .ne 2 .na ! \fBM-[Y\fR .ad .RS 13n Move the cursor to the end of line. .RE .sp .ne 2 .na ! \fB^]\fR\fIchar\fR .ad .RS 13n Move the cursor forward to the character \fIchar\fR on the current line. .RE .sp .ne 2 .na ! \fBM-^]\fR\fIchar\fR .ad .RS 13n Move the cursor backwards to the character \fIchar\fR on the current line. .RE .sp .ne 2 .na ! \fB^X^X\fR .ad .RS 13n Interchange the cursor and the mark. .RE .sp .ne 2 .na ! \fB\fIerase\fR .ad .RS 13n Delete the previous character. The user-defined erase character is defined by the \fBstty\fR(1) command, and is usually \fB^H\fR or \fB#\fR. .RE .sp .ne 2 .na ! \fB\fIlnext\fR .ad .RS 13n Removes the next character's editing features. The user-defined literal next character is defined by the \fBstty\fR(1) command, or is \fB^V\fR if not defined.
*** 3617,3673 **** .RE .sp .ne 2 .na ! \fB\fB^D\fR\fR .ad .RS 13n Delete the current character. .RE .sp .ne 2 .na ! \fB\fBM-d\fR\fR .ad .RS 13n Delete the current word. .RE .sp .ne 2 .na ! \fB\fBM-^H\fR\fR .ad .RS 13n MetaBACKSPACE. Delete the previous word. .RE .sp .ne 2 .na ! \fB\fBM-h\fR\fR .ad .RS 13n Delete the previous word. .RE .sp .ne 2 .na ! \fB\fBM-^?\fR\fR .ad .RS 13n MetaDEL. Delete the previous word. If your interrupt character is \fB^?\fR (DEL, the default), this command does not work. .RE .sp .ne 2 .na ! \fB\fB^T\fR\fR .ad .RS 13n Transpose the current character with the previous character, and advance the cursor in \fBemacs\fR mode. Transpose two previous characters in \fBgmacs\fR mode. --- 3855,3911 ---- .RE .sp .ne 2 .na ! \fB^D\fR .ad .RS 13n Delete the current character. .RE .sp .ne 2 .na ! \fBM-d\fR .ad .RS 13n Delete the current word. .RE .sp .ne 2 .na ! \fBM-^H\fR .ad .RS 13n MetaBACKSPACE. Delete the previous word. .RE .sp .ne 2 .na ! \fBM-h\fR .ad .RS 13n Delete the previous word. .RE .sp .ne 2 .na ! \fBM-^?\fR .ad .RS 13n MetaDEL. Delete the previous word. If your interrupt character is \fB^?\fR (DEL, the default), this command does not work. .RE .sp .ne 2 .na ! \fB^T\fR .ad .RS 13n Transpose the current character with the previous character, and advance the cursor in \fBemacs\fR mode. Transpose two previous characters in \fBgmacs\fR mode.
*** 3674,3711 **** .RE .sp .ne 2 .na ! \fB\fB^C\fR\fR .ad .RS 13n Capitalize the current character. .RE .sp .ne 2 .na ! \fB\fBM-c\fR\fR .ad .RS 13n Capitalize the current word. .RE .sp .ne 2 .na ! \fB\fBM-l\fR\fR .ad .RS 13n Change the current word to lower case. .RE .sp .ne 2 .na ! \fB\fB^K\fR\fR .ad .RS 13n Delete from the cursor to the end of the line. If preceded by a numerical parameter whose value is less than the current cursor position, delete from specified position up to the cursor. If preceded by a numerical parameter whose --- 3912,3949 ---- .RE .sp .ne 2 .na ! \fB^C\fR .ad .RS 13n Capitalize the current character. .RE .sp .ne 2 .na ! \fBM-c\fR .ad .RS 13n Capitalize the current word. .RE .sp .ne 2 .na ! \fBM-l\fR .ad .RS 13n Change the current word to lower case. .RE .sp .ne 2 .na ! \fB^K\fR .ad .RS 13n Delete from the cursor to the end of the line. If preceded by a numerical parameter whose value is less than the current cursor position, delete from specified position up to the cursor. If preceded by a numerical parameter whose
*** 3714,3742 **** .RE .sp .ne 2 .na ! \fB\fB^W\fR\fR .ad .RS 13n Kill from the cursor to the mark. .RE .sp .ne 2 .na ! \fB\fBM-p\fR\fR .ad .RS 13n Push the region from the cursor to the mark on the stack. .RE .sp .ne 2 .na ! \fB\fIkill\fR\fR .ad .RS 13n Kill the entire current line. The user-defined kill character is defined by the \fBstty\fR(1) command, usually a \fB^G\fR or \fB@\fR. If two kill characters are entered in succession, all kill characters from then on cause a line feed. --- 3952,3980 ---- .RE .sp .ne 2 .na ! \fB^W\fR .ad .RS 13n Kill from the cursor to the mark. .RE .sp .ne 2 .na ! \fBM-p\fR .ad .RS 13n Push the region from the cursor to the mark on the stack. .RE .sp .ne 2 .na ! \fB\fIkill\fR .ad .RS 13n Kill the entire current line. The user-defined kill character is defined by the \fBstty\fR(1) command, usually a \fB^G\fR or \fB@\fR. If two kill characters are entered in succession, all kill characters from then on cause a line feed.
*** 3744,3827 **** .RE .sp .ne 2 .na ! \fB\fB^Y\fR\fR .ad .RS 13n Restore the last item removed from line. Yank the item back to the line. .RE .sp .ne 2 .na ! \fB\fB^L\fR\fR .ad .RS 13n Line feed and print the current line. .RE .sp .ne 2 .na ! \fB\fBM-^L\fR\fR .ad .RS 13n Clear the screen. .RE .sp .ne 2 .na ! \fB\fB^@\fR\fR .ad .RS 13n Null character. Set mark. .RE .sp .ne 2 .na ! \fB\fBM-\fR\fIspace\fR\fR .ad .RS 13n MetaSPACE. Set the mark. .RE .sp .ne 2 .na ! \fB\fB^J\fR\fR .ad .RS 13n New line. Execute the current line. .RE .sp .ne 2 .na ! \fB\fB^M\fR\fR .ad .RS 13n Return. Execute the current line. .RE .sp .ne 2 .na ! \fB\fBEOF\fR\fR .ad .RS 13n End-of-file character, normally \fB^D\fR, is processed as an \fBend-of-file\fR only if the current line is null. .RE .sp .ne 2 .na ! \fB\fB^P\fR\fR .ad .RS 13n Fetch the previous command. Each time \fB^P\fR is entered the previous command back in time is accessed. Moves back one line when it is not on the first line of a multi-line command. --- 3982,4065 ---- .RE .sp .ne 2 .na ! \fB^Y\fR .ad .RS 13n Restore the last item removed from line. Yank the item back to the line. .RE .sp .ne 2 .na ! \fB^L\fR .ad .RS 13n Line feed and print the current line. .RE .sp .ne 2 .na ! \fBM-^L\fR .ad .RS 13n Clear the screen. .RE .sp .ne 2 .na ! \fB^@\fR .ad .RS 13n Null character. Set mark. .RE .sp .ne 2 .na ! \fBM-\fR\fIspace\fR .ad .RS 13n MetaSPACE. Set the mark. .RE .sp .ne 2 .na ! \fB^J\fR .ad .RS 13n New line. Execute the current line. .RE .sp .ne 2 .na ! \fB^M\fR .ad .RS 13n Return. Execute the current line. .RE .sp .ne 2 .na ! \fBEOF\fR .ad .RS 13n End-of-file character, normally \fB^D\fR, is processed as an \fBend-of-file\fR only if the current line is null. .RE .sp .ne 2 .na ! \fB^P\fR .ad .RS 13n Fetch the previous command. Each time \fB^P\fR is entered the previous command back in time is accessed. Moves back one line when it is not on the first line of a multi-line command.
*** 3828,3884 **** .RE .sp .ne 2 .na ! \fB\fBM-[A\fR\fR .ad .RS 13n Equivalent to \fB^P\fR. .RE .sp .ne 2 .na ! \fB\fBM-<\fR\fR .ad .RS 13n Fetch the least recent (oldest) history line. .RE .sp .ne 2 .na ! \fB\fBM->\fR\fR .ad .RS 13n Fetch the most recent (youngest) history line. .RE .sp .ne 2 .na ! \fB\fB^N\fR\fR .ad .RS 13n Fetch the next command line. Each time \fB^N\fR is entered the next command line forward in time is accessed. .RE .sp .ne 2 .na ! \fB\fBM-[B\fR\fR .ad .RS 13n Equivalent to \fB^N\fR. .RE .sp .ne 2 .na ! \fB\fB^R\fR\fIstring\fR\fR .ad .RS 13n Reverse search history for a previous command line containing \fIstring\fR. If a parameter of zero is specified, the search is forward. \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the --- 4066,4122 ---- .RE .sp .ne 2 .na ! \fBM-[A\fR .ad .RS 13n Equivalent to \fB^P\fR. .RE .sp .ne 2 .na ! \fBM-<\fR .ad .RS 13n Fetch the least recent (oldest) history line. .RE .sp .ne 2 .na ! \fBM->\fR .ad .RS 13n Fetch the most recent (youngest) history line. .RE .sp .ne 2 .na ! \fB^N\fR .ad .RS 13n Fetch the next command line. Each time \fB^N\fR is entered the next command line forward in time is accessed. .RE .sp .ne 2 .na ! \fBM-[B\fR .ad .RS 13n Equivalent to \fB^N\fR. .RE .sp .ne 2 .na ! \fB^R\fR\fIstring\fR .ad .RS 13n Reverse search history for a previous command line containing \fIstring\fR. If a parameter of zero is specified, the search is forward. \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the
*** 3888,3908 **** .RE .sp .ne 2 .na ! \fB\fB^O\fR\fR .ad .RS 13n Operate. Execute the current line and fetch the next line relative to current line from the history file. .RE .sp .ne 2 .na ! \fB\fBM-\fR\fIdigits\fR\fR .ad .RS 13n Escape. Define numeric parameter. The digits are taken as a parameter to the next command. The commands that accept a parameter are: \fB^F\fR, \fB^B\fR, \fBERASE\fR, \fB^C\fR, \fB^D\fR, \fB^K\fR, \fB^R\fR, \fB^P\fR, \fB^N\fR, --- 4126,4146 ---- .RE .sp .ne 2 .na ! \fB^O\fR .ad .RS 13n Operate. Execute the current line and fetch the next line relative to current line from the history file. .RE .sp .ne 2 .na ! \fBM-\fR\fIdigits\fR .ad .RS 13n Escape. Define numeric parameter. The digits are taken as a parameter to the next command. The commands that accept a parameter are: \fB^F\fR, \fB^B\fR, \fBERASE\fR, \fB^C\fR, \fB^D\fR, \fB^K\fR, \fB^R\fR, \fB^P\fR, \fB^N\fR,
*** 3911,3921 **** .RE .sp .ne 2 .na ! \fB\fBM-\fR\fIletter\fR\fR .ad .RS 13n Soft-key. Search the alias list for an alias by the name \fIletter\fR. If an alias of \fIletter\fR is defined, insert its value on the input queue. \fIletter\fR must not be one of the metafunctions in this section. --- 4149,4159 ---- .RE .sp .ne 2 .na ! \fBM-\fR\fIletter\fR .ad .RS 13n Soft-key. Search the alias list for an alias by the name \fIletter\fR. If an alias of \fIletter\fR is defined, insert its value on the input queue. \fIletter\fR must not be one of the metafunctions in this section.
*** 3922,3932 **** .RE .sp .ne 2 .na ! \fB\fBM-[\fR\fIletter\fR\fR .ad .RS 13n Soft key. Search the alias list for an alias by the name \fIletter\fR. If an alias of this name is defined, insert its value on the input queue. This can be used to program function keys on many terminals. --- 4160,4170 ---- .RE .sp .ne 2 .na ! \fBM-[\fR\fIletter\fR .ad .RS 13n Soft key. Search the alias list for an alias by the name \fIletter\fR. If an alias of this name is defined, insert its value on the input queue. This can be used to program function keys on many terminals.
*** 3933,3943 **** .RE .sp .ne 2 .na ! \fB\fBM-.\fR\fR .ad .RS 13n The last word of the previous command is inserted on the line. If preceded by a numeric parameter, the value of this parameter determines which word to insert rather than the last word. --- 4171,4181 ---- .RE .sp .ne 2 .na ! \fBM-.\fR .ad .RS 13n The last word of the previous command is inserted on the line. If preceded by a numeric parameter, the value of this parameter determines which word to insert rather than the last word.
*** 3944,3982 **** .RE .sp .ne 2 .na ! \fB\fBM-_\fR\fR .ad .RS 13n Same as \fBM-.\fR. .RE .sp .ne 2 .na ! \fB\fBM-*\fR\fR .ad .RS 13n Attempt filename generation on the current word. As asterisk is appended if the word does not match any file or contain any special pattern characters. .RE .sp .ne 2 .na ! \fB\fBM-\fRESC\fR .ad .RS 13n Command or file name completion as described in this manual page. .RE .sp .ne 2 .na ! \fB\fB^I\fRTAB\fR .ad .RS 13n Attempts command or file name completion as described in this manual page. If a partial completion occurs, repeating this behaves as if \fBM-=\fR were entered. If no match is found or entered after SPACE, a TAB is inserted. --- 4182,4220 ---- .RE .sp .ne 2 .na ! \fBM-_\fR .ad .RS 13n Same as \fBM-.\fR. .RE .sp .ne 2 .na ! \fBM-*\fR .ad .RS 13n Attempt filename generation on the current word. As asterisk is appended if the word does not match any file or contain any special pattern characters. .RE .sp .ne 2 .na ! \fBM-\fRESC\fR .ad .RS 13n Command or file name completion as described in this manual page. .RE .sp .ne 2 .na ! \fB^I\fRTAB\fR .ad .RS 13n Attempts command or file name completion as described in this manual page. If a partial completion occurs, repeating this behaves as if \fBM-=\fR were entered. If no match is found or entered after SPACE, a TAB is inserted.
*** 3983,3993 **** .RE .sp .ne 2 .na ! \fB\fBM-=\fR\fR .ad .RS 13n If not preceded by a numeric parameter, generates the list of matching commands or file names as described in this manual page. Otherwise, the word under the cursor is replaced by the item corresponding to the value of the numeric --- 4221,4231 ---- .RE .sp .ne 2 .na ! \fBM-=\fR .ad .RS 13n If not preceded by a numeric parameter, generates the list of matching commands or file names as described in this manual page. Otherwise, the word under the cursor is replaced by the item corresponding to the value of the numeric
*** 3996,4015 **** .RE .sp .ne 2 .na ! \fB\fB^U\fR\fR .ad .RS 13n Multiply parameter of next command by \fB4\fR. .RE .sp .ne 2 .na ! \fB\fB\e\fR\fR .ad .RS 13n Escape the next character. Editing characters, the user's erase, kill and interrupt (normally \fB^?\fR) characters can be entered in a command line or in a search string if preceded by a \fB\e\fR\&. The \fB\e\fR removes the next --- 4234,4253 ---- .RE .sp .ne 2 .na ! \fB^U\fR .ad .RS 13n Multiply parameter of next command by \fB4\fR. .RE .sp .ne 2 .na ! \fB\e\fR .ad .RS 13n Escape the next character. Editing characters, the user's erase, kill and interrupt (normally \fB^?\fR) characters can be entered in a command line or in a search string if preceded by a \fB\e\fR\&. The \fB\e\fR removes the next
*** 4017,4036 **** .RE .sp .ne 2 .na ! \fB\fBM-^V\fR\fR .ad .RS 13n Display the version of the shell. .RE .sp .ne 2 .na ! \fB\fBM-#\fR\fR .ad .RS 13n If the line does not begin with a \fB#\fR, a \fB#\fR is inserted at the beginning of the line and after each NEWLINE, and the line is entered. This causes a comment to be inserted in the history file. If the line begins with a --- 4255,4274 ---- .RE .sp .ne 2 .na ! \fBM-^V\fR .ad .RS 13n Display the version of the shell. .RE .sp .ne 2 .na ! \fBM-#\fR .ad .RS 13n If the line does not begin with a \fB#\fR, a \fB#\fR is inserted at the beginning of the line and after each NEWLINE, and the line is entered. This causes a comment to be inserted in the history file. If the line begins with a
*** 4037,4047 **** \fB#\fR, the \fB#\fR is deleted and one \fB#\fR after each NEWLINE is also deleted. .RE .SS "\fBvi\fR Editing Mode" - .LP There are two typing modes. Initially, when you enter a command you are in the input mode. To edit, the user enters control mode by typing ESC (033) and moves the cursor to the point needing correction and then inserts or deletes characters or words as needed. Most control commands accept an optional repeat \fIcount\fR prior to the command. --- 4275,4284 ----
*** 4058,4068 **** .LP If the option \fBviraw\fR is also set, the terminal is always have canonical processing disabled. This mode is implicit for systems that do not support two alternate end of line delimiters, and might be helpful for certain terminals. .SS "Input Edit Commands" - .LP By default the editor is in input mode. .sp .LP The following input edit commands are supported: .sp --- 4295,4304 ----
*** 4076,4086 **** .RE .sp .ne 2 .na ! \fB\fB^W\fR\fR .ad .RS 10n Delete the previous blank separated word. On some systems the \fBviraw\fR option might be required for this to work. .RE --- 4312,4322 ---- .RE .sp .ne 2 .na ! \fB^W\fR .ad .RS 10n Delete the previous blank separated word. On some systems the \fBviraw\fR option might be required for this to work. .RE
*** 4096,4106 **** .RE .sp .ne 2 .na ! \fB\fIlnext\fR\fR .ad .RS 10n User defined literal next character as defined by the \fBstty\fR(1) or \fB^V\fR if not defined. Removes the next character's editing features, if any. On some systems the \fBviraw\fR option might be required for this to work. --- 4332,4342 ---- .RE .sp .ne 2 .na ! \fB\fIlnext\fR .ad .RS 10n User defined literal next character as defined by the \fBstty\fR(1) or \fB^V\fR if not defined. Removes the next character's editing features, if any. On some systems the \fBviraw\fR option might be required for this to work.
*** 4107,4371 **** .RE .sp .ne 2 .na ! \fB\fB\e\fR\fR .ad .RS 10n Escape the next ERASE or KILL character. .RE .sp .ne 2 .na ! \fB\fB^I\fR TAB\fR .ad .RS 10n Attempts command or file name completion as described in this manual page and returns to input mode. If a partial completion occurs, repeating this behaves as if \fB=\fR were entered from control mode. If no match is found or entered after SPACE, a TAB is inserted. .RE .SS "Motion Edit Commands" - .LP The motion edit commands move the cursor. .sp .LP The following motion edit commands are supported: .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]l\fR\fR .ad .RS 13n Move the cursor forward (right) one character. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB][C\fR\fR .ad .RS 13n Move the cursor forward (right) one character. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]w\fR\fR .ad .RS 13n Move the cursor forward one alphanumeric word. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]W\fR\fR .ad .RS 13n Move the cursor to the beginning of the next word that follows a blank. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]e\fR\fR .ad .RS 13n Move the cursor to the end of the word. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]E\fR\fR .ad .RS 13n Move the cursor to the end of the current blank delimited word. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]h\fR\fR .ad .RS 13n Move the cursor backward (left) one character. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB][D\fR\fR .ad .RS 13n Move the cursor backward (left) one character. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]b\fR\fR .ad .RS 13n Move the cursor backward one word. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]B\fR\fR .ad .RS 13n Move the cursor to the preceding blank separated word. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]|\fR\fR .ad .RS 13n Move the cursor to column \fIcount\fR. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]f\fR\fIc\fR\fR .ad .RS 13n Find the next character \fIc\fR in the current line. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]F\fR\fIc\fR\fR .ad .RS 13n Find the previous character \fIc\fR in the current line. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]t\fR\fIC\fR\fR .ad .RS 13n Equivalent to \fBf\fR followed by \fBh\fR. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]T\fR\fIc\fR\fR .ad .RS 13n Equivalent to \fBF\fR followed by \fBl\fR. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB];\fR\fR .ad .RS 13n Repeat \fIcount\fR times the last single character find command: \fBf\fR, \fBF\fR, \fBt,\fR or \fBT\fR. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB],\fR\fR .ad .RS 13n Reverse the last single character find command \fIcount\fR times. .RE .sp .ne 2 .na ! \fB\fB0\fR\fR .ad .RS 13n Move the cursor to the start of line. .RE .sp .ne 2 .na ! \fB\fB^\fR\fR .ad .RS 13n Move the cursor to start of line. .RE .sp .ne 2 .na ! \fB\fB[H\fR\fR .ad .RS 13n Move the cursor to the first non-blank character in the line. .RE .sp .ne 2 .na ! \fB\fB$\fR\fR .ad .RS 13n Move the cursor to the end of the line. .RE .sp .ne 2 .na ! \fB\fB[Y\fR\fR .ad .RS 13n Move the cursor to the end of the line. .RE .sp .ne 2 .na ! \fB\fB%\fR\fR .ad .RS 13n Moves to balancing \fB(\fR, \fB)\fR, \fB{\fR, \fB}\fR, \fB[\fR, or \fB]\fR. If cursor is not on one of the characters described in this section, the remainder of the line is searched for the first occurrence of one of the characters first. .RE .SS "Search Edit Commands" - .LP The search edit commands access your command history. .sp .LP The following search edit commands are supported: .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]k\fR\fR .ad .RS 13n Fetch the previous command. Each time \fBk\fR is entered, the previous command back in time is accessed. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]-\fR\fR .ad .RS 13n Fetch the previous command. Each time \fBk\fR is entered, the previous command back in time is accessed. .sp --- 4343,4605 ---- .RE .sp .ne 2 .na ! \fB\e\fR .ad .RS 10n Escape the next ERASE or KILL character. .RE .sp .ne 2 .na ! \fB^I\fR TAB\fR .ad .RS 10n Attempts command or file name completion as described in this manual page and returns to input mode. If a partial completion occurs, repeating this behaves as if \fB=\fR were entered from control mode. If no match is found or entered after SPACE, a TAB is inserted. .RE .SS "Motion Edit Commands" The motion edit commands move the cursor. .sp .LP The following motion edit commands are supported: .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]l\fR .ad .RS 13n Move the cursor forward (right) one character. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB][C\fR .ad .RS 13n Move the cursor forward (right) one character. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]w\fR .ad .RS 13n Move the cursor forward one alphanumeric word. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]W\fR .ad .RS 13n Move the cursor to the beginning of the next word that follows a blank. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]e\fR .ad .RS 13n Move the cursor to the end of the word. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]E\fR .ad .RS 13n Move the cursor to the end of the current blank delimited word. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]h\fR .ad .RS 13n Move the cursor backward (left) one character. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB][D\fR .ad .RS 13n Move the cursor backward (left) one character. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]b\fR .ad .RS 13n Move the cursor backward one word. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]B\fR .ad .RS 13n Move the cursor to the preceding blank separated word. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]|\fR .ad .RS 13n Move the cursor to column \fIcount\fR. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]f\fR\fIc\fR .ad .RS 13n Find the next character \fIc\fR in the current line. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]F\fR\fIc\fR .ad .RS 13n Find the previous character \fIc\fR in the current line. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]t\fR\fIC\fR .ad .RS 13n Equivalent to \fBf\fR followed by \fBh\fR. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]T\fR\fIc\fR .ad .RS 13n Equivalent to \fBF\fR followed by \fBl\fR. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB];\fR .ad .RS 13n Repeat \fIcount\fR times the last single character find command: \fBf\fR, \fBF\fR, \fBt,\fR or \fBT\fR. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB],\fR .ad .RS 13n Reverse the last single character find command \fIcount\fR times. .RE .sp .ne 2 .na ! \fB0\fR .ad .RS 13n Move the cursor to the start of line. .RE .sp .ne 2 .na ! \fB^\fR .ad .RS 13n Move the cursor to start of line. .RE .sp .ne 2 .na ! \fB[H\fR .ad .RS 13n Move the cursor to the first non-blank character in the line. .RE .sp .ne 2 .na ! \fB$\fR .ad .RS 13n Move the cursor to the end of the line. .RE .sp .ne 2 .na ! \fB[Y\fR .ad .RS 13n Move the cursor to the end of the line. .RE .sp .ne 2 .na ! \fB%\fR .ad .RS 13n Moves to balancing \fB(\fR, \fB)\fR, \fB{\fR, \fB}\fR, \fB[\fR, or \fB]\fR. If cursor is not on one of the characters described in this section, the remainder of the line is searched for the first occurrence of one of the characters first. .RE .SS "Search Edit Commands" The search edit commands access your command history. .sp .LP The following search edit commands are supported: .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]k\fR .ad .RS 13n Fetch the previous command. Each time \fBk\fR is entered, the previous command back in time is accessed. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]-\fR .ad .RS 13n Fetch the previous command. Each time \fBk\fR is entered, the previous command back in time is accessed. .sp
*** 4373,4383 **** .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB][A\fR\fR .ad .RS 13n Fetch the previous command. Each time \fBk\fR is entered, the previous command back in time is accessed. .sp --- 4607,4617 ---- .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB][A\fR .ad .RS 13n Fetch the previous command. Each time \fBk\fR is entered, the previous command back in time is accessed. .sp
*** 4385,4405 **** .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]j\fR\fR .ad .RS 13n Fetch the next command. Each time \fBj\fR is entered, the next command forward in time is accessed. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]+\fR\fR .ad .RS 13n Fetch the next command. Each time \fBj\fR is entered, the next command forward in time is accessed. .sp --- 4619,4639 ---- .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]j\fR .ad .RS 13n Fetch the next command. Each time \fBj\fR is entered, the next command forward in time is accessed. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]+\fR .ad .RS 13n Fetch the next command. Each time \fBj\fR is entered, the next command forward in time is accessed. .sp
*** 4407,4417 **** .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB][B\fR\fR .ad .RS 13n Fetch the next command. Each time \fBj\fR is entered, the next command forward in time is accessed. .sp --- 4641,4651 ---- .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB][B\fR .ad .RS 13n Fetch the next command. Each time \fBj\fR is entered, the next command forward in time is accessed. .sp
*** 4419,4439 **** .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]G\fR\fR .ad .RS 13n Fetch command number \fIcount\fR. The default is the least recent history command. .RE .sp .ne 2 .na ! \fB\fB/\fR\fIstring\fR\fR .ad .RS 13n Search backward through history for a previous command containing \fIstring\fR. \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the matched line must begin with \fIstring\fR. If \fIstring\fR is --- 4653,4673 ---- .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]G\fR .ad .RS 13n Fetch command number \fIcount\fR. The default is the least recent history command. .RE .sp .ne 2 .na ! \fB/\fR\fIstring\fR .ad .RS 13n Search backward through history for a previous command containing \fIstring\fR. \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the matched line must begin with \fIstring\fR. If \fIstring\fR is
*** 4441,4451 **** .RE .sp .ne 2 .na ! \fB\fB?\fR\fIstring\fR\fR .ad .RS 13n Search forward through history for a previous command containing \fIstring\fR. \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the matched line must begin with \fIstring\fR. If \fIstring\fR is --- 4675,4685 ---- .RE .sp .ne 2 .na ! \fB?\fR\fIstring\fR .ad .RS 13n Search forward through history for a previous command containing \fIstring\fR. \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the matched line must begin with \fIstring\fR. If \fIstring\fR is
*** 4455,4510 **** .RE .sp .ne 2 .na ! \fB\fBn\fR\fR .ad .RS 13n Search in the backwards direction for the next match of the last pattern to \fI/\fR or \fI?\fR commands. .RE .sp .ne 2 .na ! \fB\fBN\fR\fR .ad .RS 13n Search in the forward direction for next match of the last pattern to \fI/\fR or \fI?\fR. .RE .SS "Text Modification Edit Commands" - .LP The following commands modify the line: .sp .ne 2 .na ! \fB\fBa\fR\fR .ad .RS 19n Enter input mode and enter text after the current character. .RE .sp .ne 2 .na ! \fB\fBA\fR\fR .ad .RS 19n Append text to the end of the line. Equivalent to \fB$a\fR. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]c\fR\fImotion\fR\fR .ad .br .na ! \fB\fBc[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR .ad .RS 19n Delete current character through the character that \fImotion\fR would move the cursor to and enter input mode. If \fImotion\fR is \fBc\fR, the entire line is deleted and input mode entered. --- 4689,4743 ---- .RE .sp .ne 2 .na ! \fBn\fR .ad .RS 13n Search in the backwards direction for the next match of the last pattern to \fI/\fR or \fI?\fR commands. .RE .sp .ne 2 .na ! \fBN\fR .ad .RS 13n Search in the forward direction for next match of the last pattern to \fI/\fR or \fI?\fR. .RE .SS "Text Modification Edit Commands" The following commands modify the line: .sp .ne 2 .na ! \fBa\fR .ad .RS 19n Enter input mode and enter text after the current character. .RE .sp .ne 2 .na ! \fBA\fR .ad .RS 19n Append text to the end of the line. Equivalent to \fB$a\fR. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]c\fR\fImotion\fR .ad .br .na ! \fBc[\fR\fIcount\fR\fB]\fR\fImotion\fR .ad .RS 19n Delete current character through the character that \fImotion\fR would move the cursor to and enter input mode. If \fImotion\fR is \fBc\fR, the entire line is deleted and input mode entered.
*** 4511,4671 **** .RE .sp .ne 2 .na ! \fB\fBC\fR\fR .ad .RS 19n Delete the current character through the end of line and enter input mode. Equivalent to \fBc$\fR. .RE .sp .ne 2 .na ! \fB\fBS\fR\fR .ad .RS 19n Equivalent to \fBcc\fR. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]s\fR\fR .ad .RS 19n Replace characters under the cursor in input mode. .RE .sp .ne 2 .na ! \fB\fBD[\fR\fIcount\fR\fB]d\fR\fImotion\fR\fR .ad .RS 19n Delete the current character through the end of line. Equivalent to d$. .RE .sp .ne 2 .na ! \fB\fBd[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR .ad .RS 19n Delete current character through the character that \fImotion\fR would move to. If \fImotion\fR is d , the entire line is deleted. .RE .sp .ne 2 .na ! \fB\fBi\fR\fR .ad .RS 19n Enter input mode and insert text before the current character. .RE .sp .ne 2 .na ! \fB\fBI\fR\fR .ad .RS 19n Insert text before the beginning of the line. Equivalent to \fB0i\fR. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]P\fR\fR .ad .RS 19n Place the previous text modification before the cursor. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]p\fR\fR .ad .RS 19n Place the previous text modification after the cursor. .RE .sp .ne 2 .na ! \fB\fBR\fR\fR .ad .RS 19n Enter input mode and replace characters on the screen with characters you type overlay fashion. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]r\fR\fIc\fR\fR .ad .RS 19n Replace the \fIcount\fR characters starting at the current cursor position with \fIc\fR, and advance the cursor. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]x\fR\fR .ad .RS 19n Delete current character. .RE .sp .ne 2 .na ! \fB\fB[\fIcount\fR]X\fR\fR .ad .RS 19n Delete preceding character. .RE .sp .ne 2 .na ! \fB\fB[\fIcount\fR].\fR\fR .ad .RS 19n Repeat the previous text modification command. .RE .sp .ne 2 .na ! \fB\fB[\fIcount\fR]~\fR\fR .ad .RS 19n Invert the case of the \fIcount\fR characters starting at the current cursor position and advance the cursor. .RE .sp .ne 2 .na ! \fB\fB[\fIcount\fR]_\fR\fR .ad .RS 19n Causes the \fIcount\fR word of the previous command to be appended and input mode entered. The last word is used if \fIcount\fR is omitted. .RE .sp .ne 2 .na ! \fB\fB*\fR\fR .ad .RS 19n Causes an \fB*\fR to be appended to the current word and file name generation attempted. If no match is found, it rings the bell. Otherwise, the word is replaced by the matching pattern and input mode is entered. --- 4744,4904 ---- .RE .sp .ne 2 .na ! \fBC\fR .ad .RS 19n Delete the current character through the end of line and enter input mode. Equivalent to \fBc$\fR. .RE .sp .ne 2 .na ! \fBS\fR .ad .RS 19n Equivalent to \fBcc\fR. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]s\fR .ad .RS 19n Replace characters under the cursor in input mode. .RE .sp .ne 2 .na ! \fBD[\fR\fIcount\fR\fB]d\fR\fImotion\fR .ad .RS 19n Delete the current character through the end of line. Equivalent to d$. .RE .sp .ne 2 .na ! \fBd[\fR\fIcount\fR\fB]\fR\fImotion\fR .ad .RS 19n Delete current character through the character that \fImotion\fR would move to. If \fImotion\fR is d , the entire line is deleted. .RE .sp .ne 2 .na ! \fBi\fR .ad .RS 19n Enter input mode and insert text before the current character. .RE .sp .ne 2 .na ! \fBI\fR .ad .RS 19n Insert text before the beginning of the line. Equivalent to \fB0i\fR. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]P\fR .ad .RS 19n Place the previous text modification before the cursor. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]p\fR .ad .RS 19n Place the previous text modification after the cursor. .RE .sp .ne 2 .na ! \fBR\fR .ad .RS 19n Enter input mode and replace characters on the screen with characters you type overlay fashion. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]r\fR\fIc\fR .ad .RS 19n Replace the \fIcount\fR characters starting at the current cursor position with \fIc\fR, and advance the cursor. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]x\fR .ad .RS 19n Delete current character. .RE .sp .ne 2 .na ! \fB[\fIcount\fR]X\fR .ad .RS 19n Delete preceding character. .RE .sp .ne 2 .na ! \fB[\fIcount\fR].\fR .ad .RS 19n Repeat the previous text modification command. .RE .sp .ne 2 .na ! \fB[\fIcount\fR]~\fR .ad .RS 19n Invert the case of the \fIcount\fR characters starting at the current cursor position and advance the cursor. .RE .sp .ne 2 .na ! \fB[\fIcount\fR]_\fR .ad .RS 19n Causes the \fIcount\fR word of the previous command to be appended and input mode entered. The last word is used if \fIcount\fR is omitted. .RE .sp .ne 2 .na ! \fB*\fR .ad .RS 19n Causes an \fB*\fR to be appended to the current word and file name generation attempted. If no match is found, it rings the bell. Otherwise, the word is replaced by the matching pattern and input mode is entered.
*** 4672,4698 **** .RE .sp .ne 2 .na ! \fB\fB\e\fR\fR .ad .RS 19n Command or file name completion as described in this manual page. .RE .SS "Other Edit Commands" - .LP The following miscellaneous edit commands are supported: .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]y\fR\fImotion\fR\fR .ad .br .na ! \fB\fBy[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR .ad .RS 18n Yank the current character through the character to which \fImotion\fR would move the cursor. Put the yanked characters in the delete buffer. The text and cursor position are unchanged. --- 4905,4930 ---- .RE .sp .ne 2 .na ! \fB\e\fR .ad .RS 19n Command or file name completion as described in this manual page. .RE .SS "Other Edit Commands" The following miscellaneous edit commands are supported: .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]y\fR\fImotion\fR .ad .br .na ! \fBy[\fR\fIcount\fR\fB]\fR\fImotion\fR .ad .RS 18n Yank the current character through the character to which \fImotion\fR would move the cursor. Put the yanked characters in the delete buffer. The text and cursor position are unchanged.
*** 4699,4746 **** .RE .sp .ne 2 .na ! \fB\fByy\fR\fR .ad .RS 18n Yank the current line. .RE .sp .ne 2 .na ! \fB\fBY\fR\fR .ad .RS 18n Yank the current line from the current cursor location to the end of the line. Equivalent to \fBy$\fR. .RE .sp .ne 2 .na ! \fB\fBu\fR\fR .ad .RS 18n Undo the last text modifying command. .RE .sp .ne 2 .na ! \fB\fBU\fR\fR .ad .RS 18n Undo all the text modifying commands performed on current line. .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]V\fR\fR .ad .RS 18n Return the command : .sp .in +2 --- 4931,4978 ---- .RE .sp .ne 2 .na ! \fByy\fR .ad .RS 18n Yank the current line. .RE .sp .ne 2 .na ! \fBY\fR .ad .RS 18n Yank the current line from the current cursor location to the end of the line. Equivalent to \fBy$\fR. .RE .sp .ne 2 .na ! \fBu\fR .ad .RS 18n Undo the last text modifying command. .RE .sp .ne 2 .na ! \fBU\fR .ad .RS 18n Undo all the text modifying commands performed on current line. .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]V\fR .ad .RS 18n Return the command : .sp .in +2
*** 4754,4791 **** .RE .sp .ne 2 .na ! \fB\fB^L\fR\fR .ad .RS 18n Line feed and print the current line. This command only works in control mode. .RE .sp .ne 2 .na ! \fB\fB^J\fR\fR .ad .RS 18n New line. Execute the current line, regardless of mode. .RE .sp .ne 2 .na ! \fB\fB^M\fR\fR .ad .RS 18n Return. Execute the current line, regardless of mode. .RE .sp .ne 2 .na ! \fB\fB#\fR\fR .ad .RS 18n If the first character of the command is a \fB#\fR , delete this \fB#\fR and each \fB#\fR that follows a NEWLINE. .sp --- 4986,5023 ---- .RE .sp .ne 2 .na ! \fB^L\fR .ad .RS 18n Line feed and print the current line. This command only works in control mode. .RE .sp .ne 2 .na ! \fB^J\fR .ad .RS 18n New line. Execute the current line, regardless of mode. .RE .sp .ne 2 .na ! \fB^M\fR .ad .RS 18n Return. Execute the current line, regardless of mode. .RE .sp .ne 2 .na ! \fB#\fR .ad .RS 18n If the first character of the command is a \fB#\fR , delete this \fB#\fR and each \fB#\fR that follows a NEWLINE. .sp
*** 4798,4808 **** .RE .sp .ne 2 .na ! \fB\fB[\fR\fIcount\fR\fB]=\fR\fR .ad .RS 18n If \fIcount\fR is not specified, generate the list of matching commands or file names as described in this manual page. .sp --- 5030,5040 ---- .RE .sp .ne 2 .na ! \fB[\fR\fIcount\fR\fB]=\fR .ad .RS 18n If \fIcount\fR is not specified, generate the list of matching commands or file names as described in this manual page. .sp
*** 4812,4839 **** .RE .sp .ne 2 .na ! \fB\fB@\fR\fIletter\fR\fR .ad .RS 18n Search your alias list for an alias by the name \fIletter\fR. If an alias of this name is defined, insert its value on the input queue for processing. .RE .sp .ne 2 .na ! \fB\fB^V\fR\fR .ad .RS 18n Display version of the shell. .RE .SS "Built-in Commands" - .LP The following simple-commands are executed in the shell process. Input and output redirection is permitted. Unless otherwise indicated, the output is written on file descriptor \fB1\fR and the exit status, when there is no syntax error, is \fB0\fR. Except for \fB:\fR, \fBtrue\fR, \fBfalse\fR, \fBecho\fR, \fBnewgrp\fR, and \fBlogin\fR, all built-in commands accept \fB--\fR to --- 5044,5070 ---- .RE .sp .ne 2 .na ! \fB@\fR\fIletter\fR .ad .RS 18n Search your alias list for an alias by the name \fIletter\fR. If an alias of this name is defined, insert its value on the input queue for processing. .RE .sp .ne 2 .na ! \fB^V\fR .ad .RS 18n Display version of the shell. .RE .SS "Built-in Commands" The following simple-commands are executed in the shell process. Input and output redirection is permitted. Unless otherwise indicated, the output is written on file descriptor \fB1\fR and the exit status, when there is no syntax error, is \fB0\fR. Except for \fB:\fR, \fBtrue\fR, \fBfalse\fR, \fBecho\fR, \fBnewgrp\fR, and \fBlogin\fR, all built-in commands accept \fB--\fR to
*** 4874,4894 **** field splitting and file name generation are not performed. .RE .sp .ne 2 .na ! \fB\fB+ : [\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n The command only expands parameters. .RE .sp .ne 2 .na ! \fB\fB+ .\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n If \fIname\fR is a function defined with the \fBfunction\fR \fBname\fR reserved word syntax, the function is executed in the current environment (as if it had --- 5105,5125 ---- field splitting and file name generation are not performed. .RE .sp .ne 2 .na ! \fB+ : [\fR\fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n The command only expands parameters. .RE .sp .ne 2 .na ! \fB+ .\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n If \fIname\fR is a function defined with the \fBfunction\fR \fBname\fR reserved word syntax, the function is executed in the current environment (as if it had
*** 4903,4914 **** .RE .sp .ne 2 .na ! \fB\fB++ alias [\fR\fB-ptx\fR\fB] [\fR\fIname\fR\fB[ ! =\fR\fIvalue\fR\fB]] ...\fR\fR .ad .sp .6 .RS 4n \fBalias\fR with no arguments prints the list of aliases in the form \fIname\fR\fB=\fR\fIvalue\fR on standard output. The \fB-p\fR option causes the --- 5134,5145 ---- .RE .sp .ne 2 .na ! \fB++ alias [\fR\fB-ptx\fR\fB] [\fR\fIname\fR\fB[ ! =\fR\fIvalue\fR\fB]] ...\fR .ad .sp .6 .RS 4n \fBalias\fR with no arguments prints the list of aliases in the form \fIname\fR\fB=\fR\fIvalue\fR on standard output. The \fB-p\fR option causes the
*** 4927,4937 **** .RE .sp .ne 2 .na ! \fB\fBbg [\fR \fIjob\fR\fB\&...]\fR\fR .ad .sp .6 .RS 4n This command is only on systems that support job control. Puts each specified \fIjob\fR into the background. The current job is put in the background if --- 5158,5168 ---- .RE .sp .ne 2 .na ! \fBbg [\fR \fIjob\fR\fB\&...]\fR .ad .sp .6 .RS 4n This command is only on systems that support job control. Puts each specified \fIjob\fR into the background. The current job is put in the background if
*** 4940,4950 **** .RE .sp .ne 2 .na ! \fB\fB+ break [\fR\fIn\fR\fB]\fR\fR .ad .sp .6 .RS 4n Exit from the enclosing \fBfor\fR, \fBwhile\fR, \fBuntil\fR, or \fBselect\fR loop, if any. If \fIn\fR is specified, then break \fIn\fR levels. --- 5171,5181 ---- .RE .sp .ne 2 .na ! \fB+ break [\fR\fIn\fR\fB]\fR .ad .sp .6 .RS 4n Exit from the enclosing \fBfor\fR, \fBwhile\fR, \fBuntil\fR, or \fBselect\fR loop, if any. If \fIn\fR is specified, then break \fIn\fR levels.
*** 4951,4970 **** .RE .sp .ne 2 .na ! \fB\fBbuiltin [\fR\fB-ds\fR \fB] [\fR\fB-f\fR \fIfile\fR\fB] ! [\fR\fIname ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n If \fIname\fR is not specified, and no \fB-f\fR option is specified, the built-ins are printed on standard output. The \fB-s\fR option prints only the special built-ins. Otherwise, each \fIname\fR represents the pathname whose basename is the name of the built-in. The entry point function name is ! determined by prepending \fIb\fR to the built-in name. The ISO C/C++ prototype is \fBb\fR\fImycommand(int argc, char *argv[], void *context)\fR for the built-in command \fImycommand\fR where \fIargv\fR is an array of \fIargc\fR elements and \fIcontext\fR is an optional pointer to a \fBShell_t\fR structure as described in \fB<ast/shell.h>\fR Special built-ins cannot be bound to a pathname or deleted. The \fB-d\fR option deletes each of the specified --- 5182,5207 ---- .RE .sp .ne 2 .na ! \fBbuiltin [\fR\fB-ds\fR \fB] [\fR\fB-f\fR \fIfile\fR\fB] ! [\fR\fIname ...\fR\fB]\fR .ad .sp .6 .RS 4n If \fIname\fR is not specified, and no \fB-f\fR option is specified, the built-ins are printed on standard output. The \fB-s\fR option prints only the special built-ins. Otherwise, each \fIname\fR represents the pathname whose basename is the name of the built-in. The entry point function name is ! determined by prepending \fIb_\fR to the built-in name. A built-in specified by ! a pathname will only be executed when that pathname would be found during the ! path search. Built-ins found in libraries loaded via the \fB.paths\fR file will ! be associate with the pathname of the directory containing the \fB.paths\fR ! file. ! .sp ! The ISO C/C++ prototype is \fBb\fR\fImycommand(int argc, char *argv[], void *context)\fR for the built-in command \fImycommand\fR where \fIargv\fR is an array of \fIargc\fR elements and \fIcontext\fR is an optional pointer to a \fBShell_t\fR structure as described in \fB<ast/shell.h>\fR Special built-ins cannot be bound to a pathname or deleted. The \fB-d\fR option deletes each of the specified
*** 4980,4994 **** .RE .sp .ne 2 .na ! \fB\fBcd\fR \fB[\fR\fB-LP\fR\fB] [\fR\fIarg\fR\fB]\fR\fR .ad .br .na ! \fB\fBcd\fR \fB[\fR\fB-LP\fR\fB]\fR \fIold\fR \fInew\fR\fR .ad .sp .6 .RS 4n This command has two forms. .sp --- 5217,5231 ---- .RE .sp .ne 2 .na ! \fBcd\fR \fB[\fR\fB-LP\fR\fB] [\fR\fIarg\fR\fB]\fR .ad .br .na ! \fBcd\fR \fB[\fR\fB-LP\fR\fB]\fR \fIold\fR \fInew\fR .ad .sp .6 .RS 4n This command has two forms. .sp
*** 5015,5026 **** .RE .sp .ne 2 .na ! \fB\fBcommand\fR \fB[\fR\fB-pvVx\fR\fB]\fR \fIname\fR ! \fB[\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n Without the \fB-v\fR or \fB-V\fR options, executes \fIname\fR with the arguments specified by \fIarg\fR. --- 5252,5263 ---- .RE .sp .ne 2 .na ! \fBcommand\fR \fB[\fR\fB-pvVx\fR\fB]\fR \fIname\fR ! \fB[\fR\fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n Without the \fB-v\fR or \fB-V\fR options, executes \fIname\fR with the arguments specified by \fIarg\fR.
*** 5046,5056 **** .RE .sp .ne 2 .na ! \fB\fB+continue\fR \fB[\fR\fIn\fR\fB]\fR\fR .ad .sp .6 .RS 4n Resumes the next iteration of the enclosing \fBfor\fR, \fBwhile\fR, \fBuntil\fR, or \fBselect\fR loop. If \fIn\fR is specified, then resume at the --- 5283,5293 ---- .RE .sp .ne 2 .na ! \fB+continue\fR \fB[\fR\fIn\fR\fB]\fR .ad .sp .6 .RS 4n Resumes the next iteration of the enclosing \fBfor\fR, \fBwhile\fR, \fBuntil\fR, or \fBselect\fR loop. If \fIn\fR is specified, then resume at the
*** 5058,5068 **** .RE .sp .ne 2 .na ! \fB\fBdisown\fR \fB[\fR\fIjob...\fR\fB]\fR\fR .ad .sp .6 .RS 4n Causes the shell not to send a \fBHUP\fR signal to each specified \fIjob\fR, or all active jobs if \fIjob\fR is omitted, when a login shell terminates. --- 5295,5305 ---- .RE .sp .ne 2 .na ! \fBdisown\fR \fB[\fR\fIjob...\fR\fB]\fR .ad .sp .6 .RS 4n Causes the shell not to send a \fBHUP\fR signal to each specified \fIjob\fR, or all active jobs if \fIjob\fR is omitted, when a login shell terminates.
*** 5069,5079 **** .RE .sp .ne 2 .na ! \fB\fBecho\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n When the first \fIarg\fR does not begin with a \fB-\fR, and none of the arguments contain a backslash (\fB\e\fR), prints each of its arguments --- 5306,5316 ---- .RE .sp .ne 2 .na ! \fBecho\fR \fB[\fR\fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n When the first \fIarg\fR does not begin with a \fB-\fR, and none of the arguments contain a backslash (\fB\e\fR), prints each of its arguments
*** 5083,5105 **** .RE .sp .ne 2 .na ! \fB\fB+eval\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n The arguments are read as input to the shell and the resulting commands are executed. .RE .sp .ne 2 .na ! \fB\fB+exec\fR [\fB-c\fR] [\fB-a\fR \fIname ...\fR] ! \fB[\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n If \fIarg\fR is specified, the command specified by the arguments is executed in place of this shell without creating a new process. The \fB-c\fR option --- 5320,5356 ---- .RE .sp .ne 2 .na ! \fB++enum [ -i ]\fR \fItype\fR\fB[\fR=(\fIvalue\fR ...) \fB]\fR .ad .sp .6 .RS 4n + Creates a declaration command named type that is an integer type that allows + one of the specified values as enumeration names. If \fI=(value ...)\fR is + omitted, then type must be an indexed array variable with at least two elements + and the values are taken from this array variable. If \fB-i\fR is specified + the values are case insensitive. + .RE + + .sp + .ne 2 + .na + \fB+eval\fR \fB[\fR\fIarg ...\fR\fB]\fR + .ad + .sp .6 + .RS 4n The arguments are read as input to the shell and the resulting commands are executed. .RE .sp .ne 2 .na ! \fB+exec\fR [\fB-c\fR] [\fB-a\fR \fIname ...\fR] ! \fB[\fR\fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n If \fIarg\fR is specified, the command specified by the arguments is executed in place of this shell without creating a new process. The \fB-c\fR option
*** 5114,5124 **** .RE .sp .ne 2 .na ! \fB\fB+exit\fR \fB[\fR\fIn\fR\fB]\fR\fR .ad .sp .6 .RS 4n Causes the shell to exit with the exit status specified by \fIn\fR. The value is the least significant 8 bits of the specified status. If \fIn\fR is omitted, --- 5365,5375 ---- .RE .sp .ne 2 .na ! \fB+exit\fR \fB[\fR\fIn\fR\fB]\fR .ad .sp .6 .RS 4n Causes the shell to exit with the exit status specified by \fIn\fR. The value is the least significant 8 bits of the specified status. If \fIn\fR is omitted,
*** 5128,5163 **** .RE .sp .ne 2 .na ! \fB\fB++export\fR \fB[\fR\fB-p\fR\fB]\fR ! \fB[\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR .ad .sp .6 .RS 4n If \fIname\fR is not specified, the names and values of each variable with the export attribute are printed with the values quoted in a manner that allows ! them to be re-entered. The \fB-p\fR option causes the word export to be ! inserted before each one. Otherwise, the specified \fIname\fRs are marked for ! automatic export to the environment of subsequently-executed commands. .RE .sp .ne 2 .na ! \fB\fBfalse\fR\fR .ad .sp .6 .RS 4n Does nothing, and exits \fB1\fR. Used with \fBuntil\fR for infinite loops. .RE .sp .ne 2 .na ! \fB\fBfg\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n This command is only on systems that support job control. Each \fIjob\fR specified is brought to the foreground and waited for in the specified order. --- 5379,5416 ---- .RE .sp .ne 2 .na ! \fB++export\fR \fB[\fR\fB-p\fR\fB]\fR ! \fB[\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR .ad .sp .6 .RS 4n If \fIname\fR is not specified, the names and values of each variable with the export attribute are printed with the values quoted in a manner that allows ! them to be re-entered. The \fBexport\fR command is the same as \fBtypeset -x\fR ! except that if you use \fBexport\fR within a function, no local variable is ! created. The \fB-p\fR option causes the word export to be inserted before each ! one. Otherwise, the specified \fIname\fRs are marked for automatic export to ! the environment of subsequently-executed commands. .RE .sp .ne 2 .na ! \fBfalse\fR .ad .sp .6 .RS 4n Does nothing, and exits \fB1\fR. Used with \fBuntil\fR for infinite loops. .RE .sp .ne 2 .na ! \fBfg\fR \fB[\fR\fIjob ...\fR\fB]\fR .ad .sp .6 .RS 4n This command is only on systems that support job control. Each \fIjob\fR specified is brought to the foreground and waited for in the specified order.
*** 5166,5176 **** .RE .sp .ne 2 .na ! \fB\fBgetconf\fR \fB[\fR\fIname\fR \fB[\fR\fIpathname\fR\fB]]\fR\fR .ad .sp .6 .RS 4n Prints the current value of the configuration parameter specified by \fIname\fR. The configuration parameters are defined by the IEEE POSIX 1003.1 --- 5419,5429 ---- .RE .sp .ne 2 .na ! \fBgetconf\fR \fB[\fR\fIname\fR \fB[\fR\fIpathname\fR\fB]]\fR .ad .sp .6 .RS 4n Prints the current value of the configuration parameter specified by \fIname\fR. The configuration parameters are defined by the IEEE POSIX 1003.1
*** 5184,5195 **** .RE .sp .ne 2 .na ! \fB\fBgetopts\fR \fB[\fR \fB-a\fR \fIname\fR\fB]\fR \fIoptstring\fR \fIvname\fR ! \fB[\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n Checks \fIarg\fR for legal options. If \fIarg\fR is omitted, the positional parameters are used. An option argument begins with a \fB+\fR or a \fB-\fR. An --- 5437,5448 ---- .RE .sp .ne 2 .na ! \fBgetopts\fR \fB[\fR \fB-a\fR \fIname\fR\fB]\fR \fIoptstring\fR \fIvname\fR ! \fB[\fR\fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n Checks \fIarg\fR for legal options. If \fIarg\fR is omitted, the positional parameters are used. An option argument begins with a \fB+\fR or a \fB-\fR. An
*** 5215,5235 **** .RE .sp .ne 2 .na ! \fB\fBhist\fR \fB[\fR \fB-e\fR \fIename\fR\fB]\fR\fB[\fR\fB-nlr\fR\fB]\fR ! \fB[\fR \fIfirst\fR\fB[\fR\fIlast\fR \fB] ]\fR\fR .ad .br .na \fB\fR .ad .br .na ! \fB\fBhist\fR \fB-s\fR \fB[\fR \fIold\fR\fB=\fR\fInew\fR \fB] [\fR ! \fIcommand\fR\fB]\fR\fR .ad .sp .6 .RS 4n In the first form, a range of commands from \fIfirst\fR to \fIlast\fR is selected from the last \fBHISTSIZE\fR commands that were typed at the terminal. --- 5468,5488 ---- .RE .sp .ne 2 .na ! \fBhist\fR \fB[\fR \fB-e\fR \fIename\fR\fB]\fR\fB[\fR\fB-nlr\fR\fB]\fR ! \fB[\fR \fIfirst\fR\fB[\fR\fIlast\fR \fB] ]\fR .ad .br .na \fB\fR .ad .br .na ! \fBhist\fR \fB-s\fR \fB[\fR \fIold\fR\fB=\fR\fInew\fR \fB] [\fR ! \fIcommand\fR\fB]\fR .ad .sp .6 .RS 4n In the first form, a range of commands from \fIfirst\fR to \fIlast\fR is selected from the last \fBHISTSIZE\fR commands that were typed at the terminal.
*** 5252,5262 **** .RE .sp .ne 2 .na ! \fB\fBjobs\fR \fB-lnp\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n Lists information about each specified job, or all active jobs if \fIjob\fR is omitted. The \fB-l\fR option lists process ids in addition to the normal --- 5505,5515 ---- .RE .sp .ne 2 .na ! \fBjobs\fR \fB-lnp\fR \fB[\fR\fIjob ...\fR\fB]\fR .ad .sp .6 .RS 4n Lists information about each specified job, or all active jobs if \fIjob\fR is omitted. The \fB-l\fR option lists process ids in addition to the normal
*** 5266,5284 **** .RE .sp .ne 2 .na ! \fB\fBkill\fR \fB[\fR\fB-s\fR \fIsigname\fR\fB]\fR \fIjob ...\fR\fR .ad .br .na ! \fB\fBkill\fR \fB[\fR\fB-n\fR \fIsignum\fR\fB]\fR \fIjob ...\fR\fR .ad .br .na ! \fB\fBkill\fR \fB-l\fR \fB[\fR\fIsig ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n Sends either the \fBTERM\fR (terminate) signal or the specified signal to the specified jobs or processes. Signals are either specified by number with the --- 5519,5537 ---- .RE .sp .ne 2 .na ! \fBkill\fR \fB[\fR\fB-s\fR \fIsigname\fR\fB]\fR \fIjob ...\fR .ad .br .na ! \fBkill\fR \fB[\fR\fB-n\fR \fIsignum\fR\fB]\fR \fIjob ...\fR .ad .br .na ! \fBkill\fR \fB-Ll\fR \fB[\fR\fIsig ...\fR\fB]\fR .ad .sp .6 .RS 4n Sends either the \fBTERM\fR (terminate) signal or the specified signal to the specified jobs or processes. Signals are either specified by number with the
*** 5288,5332 **** \fBs\fR can be omitted and the number or name placed immediately after the \fB-\fR. If the signal being sent is \fBTERM\fR (terminate) or \fBHUP\fR (hang up), then the job or process is sent a \fBCONT\fR (continue) signal if it is stopped. The argument \fIjob\fR can be the process id of a process that is not a member of one of the active jobs. See \fBJobs\fR for a description of the ! format of \fIjob\fR. In the third form, \fBkill -l\fR, if \fIsig\fR is not ! specified, the signal names are listed. Otherwise, for each \fIsig\fR that is a ! name, the corresponding signal number is listed. For each \fIsig\fR that is a ! number, the signal name corresponding to the least significant 8 bits of ! \fIsig\fR is listed. .RE .sp .ne 2 .na ! \fB\fBlet\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n ! Each \fIarg\fR is a separate arithmetic expression to be evaluated. See the ! \fBArithmetic Evaluation\fR section of this manual page for a description of ! arithmetic expression evaluation. The exit status is \fB0\fR if the value of ! the last expression is \fBnon-zero\fR, and \fB1\fR otherwise. .RE .sp .ne 2 .na ! \fB\fB+newgrp\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n Equivalent to \fBexec\fR \fB/bin/newgrp\fR \fIarg ...\fR .RE .sp .ne 2 .na ! \fB\fBprint\fR [\fB-Renprs\fR] \fB[\fR \fB-u\fR \fIunit\fR\fB] [\fR \fB-f\fR ! \fIformat\fR \fB] [\fR \fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n With no options or with option \fB-\fR or \fB--\fR, each \fIarg\fR is printed on standard output. The \fB-f\fR option causes the arguments to be printed as --- 5541,5589 ---- \fBs\fR can be omitted and the number or name placed immediately after the \fB-\fR. If the signal being sent is \fBTERM\fR (terminate) or \fBHUP\fR (hang up), then the job or process is sent a \fBCONT\fR (continue) signal if it is stopped. The argument \fIjob\fR can be the process id of a process that is not a member of one of the active jobs. See \fBJobs\fR for a description of the ! format of \fIjob\fR. In the third form, \fBkill -l\fR or \fBkill -L\fR, if ! \fIsig\fR is not specified, the signal names are listed. The \fB-l\fR option ! lists only the signal names whereas \fB-L\fR lists each signal name and ! corresponding number. Otherwise, for each \fIsig\fR that is a name, the ! corresponding signal number is listed. For each \fIsig\fR that is a number, the ! signal name corresponding to the least significant 8 bits of \fIsig\fR is ! listed. .RE .sp .ne 2 .na ! \fBlet\fR \fB[\fR\fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n ! Each \fIarg\fR is a separate arithmetic expression to be evaluated. ! \fBlet\fR only recognizes octal constants starting with \fB0\fR when the ! \fBset\fR option \fBletoctal\fR is on. See the \fBArithmetic Evaluation\fR ! section of this manual page for a description of arithmetic expression ! evaluation. The exit status is \fB0\fR if the value of the last expression is ! \fBnon-zero\fR, and \fB1\fR otherwise. .RE .sp .ne 2 .na ! \fB+newgrp\fR \fB[\fR\fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n Equivalent to \fBexec\fR \fB/bin/newgrp\fR \fIarg ...\fR .RE .sp .ne 2 .na ! \fBprint\fR [\fB-CRenprsv\fR] \fB[\fR \fB-u\fR \fIunit\fR\fB] [\fR \fB-f\fR ! \fIformat\fR \fB] [\fR \fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n With no options or with option \fB-\fR or \fB--\fR, each \fIarg\fR is printed on standard output. The \fB-f\fR option causes the arguments to be printed as
*** 5334,5496 **** \fBR\fR options are ignored. Otherwise, unless the \fB-R\fR or \fB-r,\fR are specified, the following escape conventions are applied: .sp .ne 2 .na ! \fB\fB\ea\fR\fR .ad .RS 8n Alert character (\fBASCII\fR 07) .RE .sp .ne 2 .na ! \fB\fB\eb\fR\fR .ad .RS 8n Backspace character (\fBASCII\fR 010) .RE .sp .ne 2 .na ! \fB\fB\ec\fR\fR .ad .RS 8n Causes print to end without processing more arguments and not adding a NEWLINE .RE .sp .ne 2 .na ! \fB\fB\ef\fR\fR .ad .RS 8n Form-feed character (\fBASCII\fR 014) .RE .sp .ne 2 .na ! \fB\fB\en\fR\fR .ad .RS 8n NEWLINE character (\fBASCII\fR 012) .RE .sp .ne 2 .na ! \fB\fB\er\fR\fR .ad .RS 8n RETURN character (\fBASCII\fR 015) .RE .sp .ne 2 .na ! \fB\fB\et\fR\fR .ad .RS 8n TAB character (\fBASCII\fR 011) .RE .sp .ne 2 .na ! \fB\fB\ev\fR\fR .ad .RS 8n Vertical TAB character (\fBASCII\fR 013) .RE .sp .ne 2 .na ! \fB\fB\eE\fR\fR .ad .RS 8n Escape character (\fBASCII\fR 033) .RE .sp .ne 2 .na ! \fB\fB\e\e\fR\fR .ad .RS 8n Backslash character \fB\e\fR .RE .sp .ne 2 .na ! \fB\fB\e0\fR\fIx\fR\fR .ad .RS 8n Character defined by the 1, 2, or 3-digit octal string specified by \fIx\fR .RE The \fB-R\fR option prints all subsequent arguments and options other than \fB-n\fR. The \fB-e\fR causes the escape conventions to be applied This is the default behavior. It reverses the effect of an earlier \fB-r\fR. The \fB-p\fR option causes the arguments to be written onto the pipe of the process spawned ! with \fB|&\fR instead of standard output. The \fB-s\fR option causes the ! arguments to be written onto the history file instead of standard output. The ! \fB-u\fR option can be used to specify a one digit file descriptor unit number ! \fIunit\fR on which the output is placed. The default is \fB1\fR. If the option ! \fB-n\fR is used, no NEWLINE is added to the output. .RE .sp .ne 2 .na ! \fB\fBprintf\fR \fIformat\fR\fB[\fR\fIarg ...\fR\fB]\fR\fR .ad .sp .6 .RS 4n The arguments \fIarg\fR are printed on standard output in accordance with the \fBANSI-C\fR formatting rules associated with the format string \fIformat\fR. If the number of arguments exceeds the number of format specifications, the format string is reused to format remaining arguments. The following extensions ! can also be used: A \fB%b\fR format can be used instead of \fB%s\fR to cause escape sequences in the corresponding \fIarg\fR to be expanded as described in ! \fBprint\fR. A \fB%B\fR option causes each of the arguments to be treated as variable names and the binary value of the variables is printed. This is most ! useful for variables with an attribute of b. A \fB%H\fR format can be used instead of \fB%s\fR to cause characters in \fIarg\fR that are special in ! \fBHTML\fR and \fBXML\fR to be output as their entity name. A \fB%P\fR format ! can be used instead of \fB%s\fR to cause \fIarg\fR to be interpreted as an ! extended regular expression and be printed as a shell pattern. A \fB%R\fR format can be used instead of \fB%s\fR to cause \fIarg\fR to be interpreted as ! a shell pattern and to be printed as an extended regular expression. A \fB%q\fR ! format can be used instead of \fB%\fRs to cause the resulting string to be ! quoted in a manner than can be input again to the shell. A ! \fB%(\fR\fIdate-format\fR\fB)T\fR format can be use to treat an argument as a date/time string and to format the date/time according to the \fIdate-format\fR ! as defined for the \fBdate\fR(1) command. A \fB%Z\fR format outputs a byte ! whose value is 0. The precision field of the %d format can be followed by a . ! and the output base. In this case, the \fB#\fR flag character causes ! \fBbase\fR\fI#\fR to be prepended. The \fB#\fR flag when used with the \fBd\fR ! specifier without an output base, causes the output to be displayed in ! thousands units with one of the suffixes \fBk\fR \fBM\fR \fBG\fR \fBT\fR ! \fBP\fR \fBE\fR to indicate the unit. The \fB#\fR flag when used with the i ! specifier causes the output to be displayed in \fB1024\fR with one of the ! suffixes \fBKi\fR \fBMi\fR \fBGi\fR \fBTi\fR \fBPi\fR \fBEi\fR to indicate the ! unit. The \fB=\fR flag has been added to center the output within the specified ! field width. .RE .sp .ne 2 .na ! \fB\fBpwd\fR [\fB-LP\fR]\fR .ad .sp .6 .RS 4n Outputs the value of the current working directory. The \fB-L\fR option is the default. It prints the logical name of the current directory. If the \fB-P\fR option is specified, all symbolic links are resolved from the name. The last instance of \fB-L\fR or \fB-P\fR on the command line determines which method is used. --- 5591,5892 ---- \fBR\fR options are ignored. Otherwise, unless the \fB-R\fR or \fB-r,\fR are specified, the following escape conventions are applied: .sp .ne 2 .na ! \fB\ea\fR .ad .RS 8n Alert character (\fBASCII\fR 07) .RE .sp .ne 2 .na ! \fB\eb\fR .ad .RS 8n Backspace character (\fBASCII\fR 010) .RE .sp .ne 2 .na ! \fB\ec\fR .ad .RS 8n Causes print to end without processing more arguments and not adding a NEWLINE .RE .sp .ne 2 .na ! \fB\ef\fR .ad .RS 8n Form-feed character (\fBASCII\fR 014) .RE .sp .ne 2 .na ! \fB\en\fR .ad .RS 8n NEWLINE character (\fBASCII\fR 012) .RE .sp .ne 2 .na ! \fB\er\fR .ad .RS 8n RETURN character (\fBASCII\fR 015) .RE .sp .ne 2 .na ! \fB\et\fR .ad .RS 8n TAB character (\fBASCII\fR 011) .RE .sp .ne 2 .na ! \fB\ev\fR .ad .RS 8n Vertical TAB character (\fBASCII\fR 013) .RE .sp .ne 2 .na ! \fB\eE\fR .ad .RS 8n Escape character (\fBASCII\fR 033) .RE .sp .ne 2 .na ! \fB\e\e\fR .ad .RS 8n Backslash character \fB\e\fR .RE .sp .ne 2 .na ! \fB\e0\fR\fIx\fR .ad .RS 8n Character defined by the 1, 2, or 3-digit octal string specified by \fIx\fR .RE The \fB-R\fR option prints all subsequent arguments and options other than \fB-n\fR. The \fB-e\fR causes the escape conventions to be applied This is the default behavior. It reverses the effect of an earlier \fB-r\fR. The \fB-p\fR option causes the arguments to be written onto the pipe of the process spawned ! with \fB|&\fR instead of standard output. The \fB-v\fR option treats each ! \fIarg\fR as a variable name and writes the value in the \fBprintf %B\fR ! format. The \fB-C\fR option treats each \fIarg\fR as a variable name and ! writes the values in the \fBprintf %#B\fR format. ! The \fB-s\fR option causes the arguments to be written onto the history file ! instead of standard output. The \fB-u\fR option can be used to specify a one ! digit file descriptor unit number \fIunit\fR on which the output is placed. The ! default is \fB1\fR. If the option \fB-n\fR is used, no NEWLINE is added to the ! output. .RE .sp .ne 2 .na ! \fBprintf\fR \fIformat\fR\fB [\fR\fIarg ...\fR\fB]\fR .ad .sp .6 .RS 4n The arguments \fIarg\fR are printed on standard output in accordance with the \fBANSI-C\fR formatting rules associated with the format string \fIformat\fR. If the number of arguments exceeds the number of format specifications, the format string is reused to format remaining arguments. The following extensions ! can also be used: ! ! .sp ! .ne 2 ! .na ! \fB%b\fR ! .ad ! .sp .6 ! .RS 4n ! A \fB%b\fR format can be used instead of \fB%s\fR to cause escape sequences in the corresponding \fIarg\fR to be expanded as described in ! \fBprint\fR. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB%B\fR ! .ad ! .sp .6 ! .RS 4n ! A \fB%B\fR option causes each of the arguments to be treated as variable names and the binary value of the variables is printed. This is most ! useful for variables with an attribute of b. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB%H\fR ! .ad ! .sp .6 ! .RS 4n ! A \fB%H\fR format can be used instead of \fB%s\fR to cause characters in \fIarg\fR that are special in ! \fBHTML\fR and \fBXML\fR to be output as their entity name. The alternate ! flag \fB#\fR formats the output for use as a URI. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB%P\fR ! .ad ! .sp .6 ! .RS 4n ! A \fB%P\fR format can be used instead of \fB%s\fR to cause \fIarg\fR to be ! interpreted as an extended regular expression and be printed as a shell ! pattern. ! .RE ! ! ! .sp ! .ne 2 ! .na ! \fB%R\fR ! .ad ! .sp .6 ! .RS 4n ! A \fB%R\fR format can be used instead of \fB%s\fR to cause \fIarg\fR to be interpreted as ! a shell pattern and to be printed as an extended regular expression. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB%q\fR ! .ad ! .sp .6 ! .RS 4n ! A \fB%q\fR format can be used instead of \fB%\fRs to cause the resulting string ! to be quoted in a manner than can be input again to the shell. When \fBq\fR is ! preceded by the alternative format specifier, \fB#\fR, the string is quoted in ! manner suitable as a field in a \fB.csv\fR format file. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB%(\fIdate-format\fR\fB)\fR ! .ad ! .sp .6 ! .RS 4n ! A \fB%(\fR\fIdate-format\fR\fB)T\fR format can be use to treat an argument as a date/time string and to format the date/time according to the \fIdate-format\fR ! as defined for the \fBdate\fR(1) command. .RE + .sp .ne 2 .na ! \fB%Z\fR .ad .sp .6 .RS 4n + A \fB%Z\fR format outputs a byte whose value is 0. + .RE + + .sp + .ne 2 + .na + \fB%d\fR + .ad + .sp .6 + .RS 4n + The precision field of the %d format can be followed by a . and the output + base. In this case, the \fB#\fR flag character causes \fBbase\fR\fI#\fR to be + prepended. + .RE + + .sp + .ne 2 + .na + \fB#\fR + .ad + .sp .6 + .RS 4n + The \fB#\fR flag, when used with the \fB%d\fR format without an output base, + displays the output in powers of 1000 indicated by one of the following + suffixes: \fBk M G T P E\fR, and when used with the \fB%i\fR format displays + the output in powers of 1024 indicated by one of the following suffixes: + \fBKi Mi Gi Ti Pi Ei\fR. + + .RE + + .sp + .ne 2 + .na + \fB=\fR + .ad + .sp .6 + .RS 4n + The \fB=\fR flag centers the output within the specified field width. + .RE + + .sp + .ne 2 + .na + \fBL\fR + .ad + .sp .6 + .RS 4n + The \fBL\fR flag, when used with the \fB%c\fR or \fB%s\fR + formats, treats precision as character width instead of byte count. + .RE + + .sp + .ne 2 + .na + \fB,\fR + .ad + .sp .6 + .RS 4n + The \fB,\fR flag, when used with the \fB%d\fR or \fB%f\fR + formats, separates groups of digits with the grouping delimiter + (, in groups of 3 in the C locale). + .RE + + + .RE + + .sp + .ne 2 + .na + \fBpwd\fR [\fB-LP\fR]\fR + .ad + .sp .6 + .RS 4n Outputs the value of the current working directory. The \fB-L\fR option is the default. It prints the logical name of the current directory. If the \fB-P\fR option is specified, all symbolic links are resolved from the name. The last instance of \fB-L\fR or \fB-P\fR on the command line determines which method is used.
*** 5497,5510 **** .RE .sp .ne 2 .na ! \fB\fBread\fR \fB[\fR\fB-Aprs\fR\fB] [\fR\fB-d\fR \fIdelim\fR\fB] [\fR \fB-n\fR \fIn\fR\fB] [[\fR \fB-N\fR \fIn\fR\fB] [[\fR\fB-t\fR \fItimeout\fR\fB] [\fR\fB-u\fR \fIunit\fR\fB] [\fR\fIvname\fR\fB?\fR\fIprompt\fR\fB] [\fR ! \fIvname ...\fR \fB]\fR\fR .ad .sp .6 .RS 4n The shell input mechanism. One line is read and is broken up into fields using the characters in IFS as separators. The escape character, \fB\e\fR, is used to --- 5893,5906 ---- .RE .sp .ne 2 .na ! \fBread\fR \fB[\fR\fB-ACSprsv\fR\fB] [\fR\fB-d\fR \fIdelim\fR\fB] [\fR \fB-n\fR \fIn\fR\fB] [[\fR \fB-N\fR \fIn\fR\fB] [[\fR\fB-t\fR \fItimeout\fR\fB] [\fR\fB-u\fR \fIunit\fR\fB] [\fR\fIvname\fR\fB?\fR\fIprompt\fR\fB] [\fR ! \fIvname ...\fR \fB]\fR .ad .sp .6 .RS 4n The shell input mechanism. One line is read and is broken up into fields using the characters in IFS as separators. The escape character, \fB\e\fR, is used to
*** 5521,5531 **** binary attribute and \fB-n\fR or \fB-N\fR is specified, the bytes that are read are stored directly into the variable. If the -v is specified, then the value of the first \fIvname\fR is used as a default value when reading from a terminal device. The \fB-A\fR option causes the variable \fIvname\fR to be unset and each field that is read to be stored in successive elements of the ! indexed array \fIvname\fR. The \fB-p\fR option causes the input line to be taken from the input pipe of a process spawned by the shell using \fB|&\fR. If the \fB-s\fR option is present, the input is saved as a command in the history file. The option \fB-u\fR can be used to specify a one digit file descriptor unit \fIunit\fR to read from. The file descriptor can be opened with the \fBexec\fR special built-in command. The default value of unit \fIn\fR is --- 5917,5932 ---- binary attribute and \fB-n\fR or \fB-N\fR is specified, the bytes that are read are stored directly into the variable. If the -v is specified, then the value of the first \fIvname\fR is used as a default value when reading from a terminal device. The \fB-A\fR option causes the variable \fIvname\fR to be unset and each field that is read to be stored in successive elements of the ! indexed array \fIvname\fR. The \fB-C\fR option causes the variable vname to be ! read as a compound variable. Blanks will be ignored when finding the beginning ! open parenthesis. The \fB-S\fR option causes the line to be treated like a ! record in a .csv format file so that double quotes can be used to allow the ! delimiter character and the new-line character to appear within a field. ! The \fB-p\fR option causes the input line to be taken from the input pipe of a process spawned by the shell using \fB|&\fR. If the \fB-s\fR option is present, the input is saved as a command in the history file. The option \fB-u\fR can be used to specify a one digit file descriptor unit \fIunit\fR to read from. The file descriptor can be opened with the \fBexec\fR special built-in command. The default value of unit \fIn\fR is
*** 5539,5550 **** .RE .sp .ne 2 .na ! \fB\fB++readonly\fR \fB[\fR\fB-p\fR\fB] [\fR ! \fIvname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR .ad .sp .6 .RS 4n If \fIvname\fR is not specified, the names and values of each variable with the read-only attribute is printed with the values quoted in a manner that allows --- 5940,5951 ---- .RE .sp .ne 2 .na ! \fB++readonly\fR \fB[\fR\fB-p\fR\fB] [\fR ! \fIvname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR .ad .sp .6 .RS 4n If \fIvname\fR is not specified, the names and values of each variable with the read-only attribute is printed with the values quoted in a manner that allows
*** 5554,5564 **** .RE .sp .ne 2 .na ! \fB\fB+return\fR \fB[\fR\fIn\fR\fB]\fR\fR .ad .sp .6 .RS 4n Causes a shell function or script to return to the invoking script with the exit status specified by \fIn\fR. The value is the least significant 8 bits of --- 5955,5965 ---- .RE .sp .ne 2 .na ! \fB+return\fR \fB[\fR\fIn\fR\fB]\fR .ad .sp .6 .RS 4n Causes a shell function or script to return to the invoking script with the exit status specified by \fIn\fR. The value is the least significant 8 bits of
*** 5568,5597 **** .RE .sp .ne 2 .na ! \fB\fB+set [ \(+-BCGabefhkmnoprstuvx] [\(+-o [\fR \fIoption\fR \fB] ] ... [ ! \(+-A\fR \fIvname\fR\fB]\fR \fB[\fR\fIarg...\fR\fB]\fR\fR .ad .sp .6 .RS 4n The \fBset\fR command supports the following options: .sp .ne 2 .na ! \fB\fB-a\fR\fR .ad .sp .6 .RS 4n All subsequent variables that are defined are automatically exported. .RE .sp .ne 2 .na ! \fB\fB-A\fR\fR .ad .sp .6 .RS 4n Array assignment. Unset the variable \fIvname\fR and assign values sequentially from the \fIarg\fR list. If \fB+A\fR is used, the variable \fIvname\fR is not --- 5969,5998 ---- .RE .sp .ne 2 .na ! \fB+set [ \(+-BCGabefhkmnoprstuvx] [\(+-o [\fR \fIoption\fR \fB] ] ... [ ! \(+-A\fR \fIvname\fR\fB]\fR \fB[\fR\fIarg...\fR\fB]\fR .ad .sp .6 .RS 4n The \fBset\fR command supports the following options: .sp .ne 2 .na ! \fB-a\fR .ad .sp .6 .RS 4n All subsequent variables that are defined are automatically exported. .RE .sp .ne 2 .na ! \fB-A\fR .ad .sp .6 .RS 4n Array assignment. Unset the variable \fIvname\fR and assign values sequentially from the \fIarg\fR list. If \fB+A\fR is used, the variable \fIvname\fR is not
*** 5599,5609 **** .RE .sp .ne 2 .na ! \fB\fB-b\fR\fR .ad .sp .6 .RS 4n Prints job completion messages as soon as a background job changes state rather than waiting for the next prompt. --- 6000,6010 ---- .RE .sp .ne 2 .na ! \fB-b\fR .ad .sp .6 .RS 4n Prints job completion messages as soon as a background job changes state rather than waiting for the next prompt.
*** 5610,5630 **** .RE .sp .ne 2 .na ! \fB\fB-B\fR\fR .ad .sp .6 .RS 4n Enable brace pattern field generation. This is the default behavior. .RE .sp .ne 2 .na ! \fB\fB-C\fR\fR .ad .sp .6 .RS 4n Prevents redirection (\fB>\fR) from truncating existing files. Files that are created are opened with the \fBO_EXCL\fR mode. Requires \fB>|\fR to truncate a --- 6011,6031 ---- .RE .sp .ne 2 .na ! \fB-B\fR .ad .sp .6 .RS 4n Enable brace pattern field generation. This is the default behavior. .RE .sp .ne 2 .na ! \fB-C\fR .ad .sp .6 .RS 4n Prevents redirection (\fB>\fR) from truncating existing files. Files that are created are opened with the \fBO_EXCL\fR mode. Requires \fB>|\fR to truncate a
*** 5632,5663 **** .RE .sp .ne 2 .na ! \fB\fB-e\fR\fR .ad .sp .6 .RS 4n ! If a command has a \fBnon-zero\fR exit status, execute the \fBERR\fR trap, if ! set, and exit. This mode is disabled while reading profiles. .RE .sp .ne 2 .na ! \fB\fB-f\fR\fR .ad .sp .6 .RS 4n Disables file name generation. .RE .sp .ne 2 .na ! \fB\fB-G\fR\fR .ad .sp .6 .RS 4n Causes the pattern \fB**\fR by itself to match files and zero or more directories and subdirectories when used for file name generation. If followed --- 6033,6066 ---- .RE .sp .ne 2 .na ! \fB-e\fR .ad .sp .6 .RS 4n ! Unless contained in a \fB||\fR or \fB&&\fR command, or the command following an ! \fBif\fR, \fBwhile\fR or \fBuntil\fR command or in the pipeline following ! \fB!\fR, if a command has a non-zero exit status, execute the \fBERR\fR trap, ! if set, and exit. This mode is disabled while reading profiles. .RE .sp .ne 2 .na ! \fB-f\fR .ad .sp .6 .RS 4n Disables file name generation. .RE .sp .ne 2 .na ! \fB-G\fR .ad .sp .6 .RS 4n Causes the pattern \fB**\fR by itself to match files and zero or more directories and subdirectories when used for file name generation. If followed
*** 5665,5685 **** .RE .sp .ne 2 .na ! \fB\fB-h\fR\fR .ad .sp .6 .RS 4n Each command becomes a tracked alias when first encountered. .RE .sp .ne 2 .na ! \fB\fB-k\fR\fR .ad .sp .6 .RS 4n Obsolete. All variable assignment arguments are placed in the environment for a command, not just those that precede the command name. --- 6068,6088 ---- .RE .sp .ne 2 .na ! \fB-h\fR .ad .sp .6 .RS 4n Each command becomes a tracked alias when first encountered. .RE .sp .ne 2 .na ! \fB-k\fR .ad .sp .6 .RS 4n Obsolete. All variable assignment arguments are placed in the environment for a command, not just those that precede the command name.
*** 5686,5696 **** .RE .sp .ne 2 .na ! \fB\fB-m\fR\fR .ad .sp .6 .RS 4n Background jobs run in a separate process group and a line prints upon completion. The exit status of background jobs is reported in a completion --- 6089,6099 ---- .RE .sp .ne 2 .na ! \fB-m\fR .ad .sp .6 .RS 4n Background jobs run in a separate process group and a line prints upon completion. The exit status of background jobs is reported in a completion
*** 5699,5709 **** .RE .sp .ne 2 .na ! \fB\fB-n\fR\fR .ad .sp .6 .RS 4n Read commands and check them for syntax errors, but do not execute them. Ignored for interactive shells. --- 6102,6112 ---- .RE .sp .ne 2 .na ! \fB-n\fR .ad .sp .6 .RS 4n Read commands and check them for syntax errors, but do not execute them. Ignored for interactive shells.
*** 5710,5720 **** .RE .sp .ne 2 .na ! \fB\fB-o\fR\fR .ad .sp .6 .RS 4n If no option name is supplied, the list of options and their current settings are written to standard output. When invoked with a \fB+\fR, the options are --- 6113,6123 ---- .RE .sp .ne 2 .na ! \fB-o\fR .ad .sp .6 .RS 4n If no option name is supplied, the list of options and their current settings are written to standard output. When invoked with a \fB+\fR, the options are
*** 5723,5844 **** .sp The following argument can be one of the following option names: .sp .ne 2 .na ! \fB\fBallexport\fR\fR .ad .sp .6 .RS 4n Same as \fB-a\fR. .RE .sp .ne 2 .na ! \fB\fBbgnice\fR\fR .ad .sp .6 .RS 4n All background jobs are run at a lower priority. This is the default mode. .RE .sp .ne 2 .na ! \fB\fBbraceexpand\fR\fR .ad .sp .6 .RS 4n Same as \fB-\fRB. .RE .sp .ne 2 .na ! \fB\fBemacs\fR\fR .ad .sp .6 .RS 4n Puts you in an \fBemacs\fR style inline editor for command entry. .RE .sp .ne 2 .na ! \fB\fBerrexit\fR\fR .ad .sp .6 .RS 4n Same as \fB-e\fR. .RE .sp .ne 2 .na ! \fB\fBglobstar\fR\fR .ad .sp .6 .RS 4n Same as \fB-G\fR. .RE .sp .ne 2 .na ! \fB\fBgmacs\fR\fR .ad .sp .6 .RS 4n Puts you in a \fBgmacs\fR style inline editor for command entry. .RE .sp .ne 2 .na ! \fB\fBignoreeof\fR\fR .ad .sp .6 .RS 4n The shell does not exit on end-of-file. The command \fBexit\fR must be used. .RE .sp .ne 2 .na ! \fB\fBkeyword\fR\fR .ad .sp .6 .RS 4n Same as \fB-k\fR. .RE .sp .ne 2 .na ! \fB\fBmarkdirs\fR\fR .ad .sp .6 .RS 4n All directory names resulting from file name generation have a trailing / appended. .RE .sp .ne 2 .na ! \fB\fBmonitor\fR\fR .ad .sp .6 .RS 4n Same as \fB-m\fR. .RE .sp .ne 2 .na ! \fB\fBmultiline\fR\fR .ad .sp .6 .RS 4n The built-in editors use multiple lines on the screen for lines that are longer than the width of the screen. This might not work for all terminals. --- 6126,6257 ---- .sp The following argument can be one of the following option names: .sp .ne 2 .na ! \fBallexport\fR .ad .sp .6 .RS 4n Same as \fB-a\fR. .RE .sp .ne 2 .na ! \fBbgnice\fR .ad .sp .6 .RS 4n All background jobs are run at a lower priority. This is the default mode. .RE .sp .ne 2 .na ! \fBbraceexpand\fR .ad .sp .6 .RS 4n Same as \fB-\fRB. .RE .sp .ne 2 .na ! \fBemacs\fR .ad .sp .6 .RS 4n Puts you in an \fBemacs\fR style inline editor for command entry. .RE .sp .ne 2 .na ! \fBerrexit\fR .ad .sp .6 .RS 4n Same as \fB-e\fR. .RE .sp .ne 2 .na ! \fBglobstar\fR .ad .sp .6 .RS 4n Same as \fB-G\fR. .RE .sp .ne 2 .na ! \fBgmacs\fR .ad .sp .6 .RS 4n Puts you in a \fBgmacs\fR style inline editor for command entry. .RE .sp .ne 2 .na ! \fBignoreeof\fR .ad .sp .6 .RS 4n The shell does not exit on end-of-file. The command \fBexit\fR must be used. .RE .sp .ne 2 .na ! \fBkeyword\fR .ad .sp .6 .RS 4n Same as \fB-k\fR. .RE .sp .ne 2 .na ! \fBletoctal\fR .ad .sp .6 .RS 4n + The \fBlet\fR command allows octal constants starting with \fB0\fR. + .RE + + .sp + .ne 2 + .na + \fBmarkdirs\fR + .ad + .sp .6 + .RS 4n All directory names resulting from file name generation have a trailing / appended. .RE .sp .ne 2 .na ! \fBmonitor\fR .ad .sp .6 .RS 4n Same as \fB-m\fR. .RE .sp .ne 2 .na ! \fBmultiline\fR .ad .sp .6 .RS 4n The built-in editors use multiple lines on the screen for lines that are longer than the width of the screen. This might not work for all terminals.
*** 5845,5915 **** .RE .sp .ne 2 .na ! \fB\fBnoclobber\fR\fR .ad .sp .6 .RS 4n Same as \fB-C\fR. .RE .sp .ne 2 .na ! \fB\fBnoexec\fR\fR .ad .sp .6 .RS 4n Same as \fB-n\fR. .RE .sp .ne 2 .na ! \fB\fBnoglob\fR\fR .ad .sp .6 .RS 4n Same as \fB-f\fR. .RE .sp .ne 2 .na ! \fB\fBnolog\fR\fR .ad .sp .6 .RS 4n Do not save function definitions in the history file. .RE .sp .ne 2 .na ! \fB\fBnotify\fR\fR .ad .sp .6 .RS 4n Same as \fB-b\fR. .RE .sp .ne 2 .na ! \fB\fBnounset\fR\fR .ad .sp .6 .RS 4n Same as \fB-u\fR. .RE .sp .ne 2 .na ! \fB\fBpipefail\fR\fR .ad .sp .6 .RS 4n A pipeline does not complete until all components of the pipeline have completed, and the return value is the value of the last \fBnon-zero\fR command --- 6258,6328 ---- .RE .sp .ne 2 .na ! \fBnoclobber\fR .ad .sp .6 .RS 4n Same as \fB-C\fR. .RE .sp .ne 2 .na ! \fBnoexec\fR .ad .sp .6 .RS 4n Same as \fB-n\fR. .RE .sp .ne 2 .na ! \fBnoglob\fR .ad .sp .6 .RS 4n Same as \fB-f\fR. .RE .sp .ne 2 .na ! \fBnolog\fR .ad .sp .6 .RS 4n Do not save function definitions in the history file. .RE .sp .ne 2 .na ! \fBnotify\fR .ad .sp .6 .RS 4n Same as \fB-b\fR. .RE .sp .ne 2 .na ! \fBnounset\fR .ad .sp .6 .RS 4n Same as \fB-u\fR. .RE .sp .ne 2 .na ! \fBpipefail\fR .ad .sp .6 .RS 4n A pipeline does not complete until all components of the pipeline have completed, and the return value is the value of the last \fBnon-zero\fR command
*** 5917,5937 **** .RE .sp .ne 2 .na ! \fB\fBprivileged\fR\fR .ad .sp .6 .RS 4n Same as \fB-p\fR. .RE .sp .ne 2 .na ! \fB\fBshowme\fR\fR .ad .sp .6 .RS 4n When enabled, simple commands or pipelines preceded by a a semicolon (\fB;\fR) is displayed as if the \fBxtrace\fR option were enabled but is not executed. --- 6330,6350 ---- .RE .sp .ne 2 .na ! \fBprivileged\fR .ad .sp .6 .RS 4n Same as \fB-p\fR. .RE .sp .ne 2 .na ! \fBshowme\fR .ad .sp .6 .RS 4n When enabled, simple commands or pipelines preceded by a a semicolon (\fB;\fR) is displayed as if the \fBxtrace\fR option were enabled but is not executed.
*** 5939,5969 **** .RE .sp .ne 2 .na ! \fB\fBtrackall\fR\fR .ad .sp .6 .RS 4n Same as \fB-h\fR. .RE .sp .ne 2 .na ! \fB\fBverbose\fR\fR .ad .sp .6 .RS 4n Same as \fB-v\fR. .RE .sp .ne 2 .na ! \fB\fBvi\fR\fR .ad .sp .6 .RS 4n Puts you in insert mode of a \fBvi\fR style inline editor until you hit the escape character 033. This puts you in control mode. A return sends the line. --- 6352,6382 ---- .RE .sp .ne 2 .na ! \fBtrackall\fR .ad .sp .6 .RS 4n Same as \fB-h\fR. .RE .sp .ne 2 .na ! \fBverbose\fR .ad .sp .6 .RS 4n Same as \fB-v\fR. .RE .sp .ne 2 .na ! \fBvi\fR .ad .sp .6 .RS 4n Puts you in insert mode of a \fBvi\fR style inline editor until you hit the escape character 033. This puts you in control mode. A return sends the line.
*** 5970,5990 **** .RE .sp .ne 2 .na ! \fB\fBviraw\fR\fR .ad .sp .6 .RS 4n Each character is processed as it is typed in \fBvi\fR mode. .RE .sp .ne 2 .na ! \fB\fBxtrace\fR\fR .ad .sp .6 .RS 4n Same as \fB-x\fR. .sp --- 6383,6403 ---- .RE .sp .ne 2 .na ! \fBviraw\fR .ad .sp .6 .RS 4n Each character is processed as it is typed in \fBvi\fR mode. .RE .sp .ne 2 .na ! \fBxtrace\fR .ad .sp .6 .RS 4n Same as \fB-x\fR. .sp
*** 5994,6004 **** .RE .sp .ne 2 .na ! \fB\fB-p\fR\fR .ad .sp .6 .RS 4n Disables processing of the \fB$HOME/.profile\fR file and uses the file \fB/etc/suid_profile\fR instead of the \fBENV\fR file. This mode is on whenever --- 6407,6417 ---- .RE .sp .ne 2 .na ! \fB-p\fR .ad .sp .6 .RS 4n Disables processing of the \fB$HOME/.profile\fR file and uses the file \fB/etc/suid_profile\fR instead of the \fBENV\fR file. This mode is on whenever
*** 6008,6078 **** .RE .sp .ne 2 .na ! \fB\fB-r\fR\fR .ad .sp .6 .RS 4n Enables the restricted shell. This option cannot be unset once set. .RE .sp .ne 2 .na ! \fB\fB-s\fR\fR .ad .sp .6 .RS 4n Sort the positional parameters lexicographically. .RE .sp .ne 2 .na ! \fB\fB-t\fR\fR .ad .sp .6 .RS 4n Obsolete. Exit after reading and executing one command. .RE .sp .ne 2 .na ! \fB\fB-u\fR\fR .ad .sp .6 .RS 4n Treat \fBunset\fR parameters as an error when substituting. .RE .sp .ne 2 .na ! \fB\fB-v\fR\fR .ad .sp .6 .RS 4n Print shell input lines as they are read. .RE .sp .ne 2 .na ! \fB\fB-x\fR\fR .ad .sp .6 .RS 4n Print commands and their arguments as they are executed. .RE .sp .ne 2 .na ! \fB\fB--\fR\fR .ad .sp .6 .RS 4n Do not change any of the options. This is useful in setting \fB$1\fR to a value beginning with \fB-\fR. If no arguments follow this option then the positional --- 6421,6491 ---- .RE .sp .ne 2 .na ! \fB-r\fR .ad .sp .6 .RS 4n Enables the restricted shell. This option cannot be unset once set. .RE .sp .ne 2 .na ! \fB-s\fR .ad .sp .6 .RS 4n Sort the positional parameters lexicographically. .RE .sp .ne 2 .na ! \fB-t\fR .ad .sp .6 .RS 4n Obsolete. Exit after reading and executing one command. .RE .sp .ne 2 .na ! \fB-u\fR .ad .sp .6 .RS 4n Treat \fBunset\fR parameters as an error when substituting. .RE .sp .ne 2 .na ! \fB-v\fR .ad .sp .6 .RS 4n Print shell input lines as they are read. .RE .sp .ne 2 .na ! \fB-x\fR .ad .sp .6 .RS 4n Print commands and their arguments as they are executed. .RE .sp .ne 2 .na ! \fB--\fR .ad .sp .6 .RS 4n Do not change any of the options. This is useful in setting \fB$1\fR to a value beginning with \fB-\fR. If no arguments follow this option then the positional
*** 6090,6100 **** .RE .sp .ne 2 .na ! \fB\fB+shift\fR \fB[\fR\fIn\fR\fB]\fR\fR .ad .sp .6 .RS 4n The positional parameters from \fB$\fR\fIn\fR\fB+1 ...\fR are renamed \fB$1 ...\fR, the default \fIn\fR is \fB1\fR. The parameter \fIn\fR can be any --- 6503,6513 ---- .RE .sp .ne 2 .na ! \fB+shift\fR \fB[\fR\fIn\fR\fB]\fR .ad .sp .6 .RS 4n The positional parameters from \fB$\fR\fIn\fR\fB+1 ...\fR are renamed \fB$1 ...\fR, the default \fIn\fR is \fB1\fR. The parameter \fIn\fR can be any
*** 6103,6113 **** .RE .sp .ne 2 .na ! \fB\fBsleep\fR \fIseconds\fR\fR .ad .sp .6 .RS 4n Suspends execution for the number of decimal seconds or fractions of a second specified by \fIseconds\fR. --- 6516,6526 ---- .RE .sp .ne 2 .na ! \fBsleep\fR \fIseconds\fR .ad .sp .6 .RS 4n Suspends execution for the number of decimal seconds or fractions of a second specified by \fIseconds\fR.
*** 6114,6125 **** .RE .sp .ne 2 .na ! \fB\fB+trap\fR \fB-p\fR \fB[\fR\fIaction\fR\fB]\fR ! \fB[\fR\fIsig\fR\fB] ...\fR\fR .ad .sp .6 .RS 4n The \fB-p\fR option causes the trap action associated with each trap as specified by the arguments to be printed with appropriate quoting. Otherwise, --- 6527,6538 ---- .RE .sp .ne 2 .na ! \fB+trap\fR \fB-p\fR \fB[\fR\fIaction\fR\fB]\fR ! \fB[\fR\fIsig\fR\fB] ...\fR .ad .sp .6 .RS 4n The \fB-p\fR option causes the trap action associated with each trap as specified by the arguments to be printed with appropriate quoting. Otherwise,
*** 6146,6167 **** .RE .sp .ne 2 .na ! \fB\fBtrue\fR\fR .ad .sp .6 .RS 4n Does nothing, and exits \fB0\fR. Used with while for infinite loops. .RE .sp .ne 2 .na ! \fB\fB++typeset [\(+-AHflabnprtux ] [ \(+-EFLRZi[\fR\fIn\fR\fB] ] [\fR ! \fIvname\fR\fB[=\fR\fIvalue\fR \fB] ]\fR\fR .ad .sp .6 .RS 4n Sets attributes and values for shell variables and functions. When invoked inside a function defined with the \fBfunction\fR \fIname\fR syntax, a new --- 6559,6584 ---- .RE .sp .ne 2 .na ! \fBtrue\fR .ad .sp .6 .RS 4n Does nothing, and exits \fB0\fR. Used with while for infinite loops. .RE .sp .ne 2 .na ! \fB++typeset [\(+-ACHSfblmnprtux ] [ \(+-EFLRXZi[\fR\fIn\fR\fB] ] ! [ \(+-M \fB[ \fImapname\fR \fB] ] ! [ -T [ \fR\fItname\fR\fB=(\fR\fIassign_list\fR\fB) ] ] ! [ -h \fR\fIstr\fR\fB ] ! [ -a [\fR\fItype\fR\fB] ] ! [ \fR\fIvname\fR\fB[=\fR\fIvalue\fR \fB] ]\fR .ad .sp .6 .RS 4n Sets attributes and values for shell variables and functions. When invoked inside a function defined with the \fBfunction\fR \fIname\fR syntax, a new
*** 6180,6210 **** .sp The following list of attributes can be specified: .sp .ne 2 .na ! \fB\fB-a\fR\fR .ad .RS 6n Declares \fIvname\fR to be an indexed array. This is optional unless except for compound variable assignments. .RE .sp .ne 2 .na ! \fB\fB-A\fR\fR .ad .RS 6n Declares \fIvname\fR to be an associative array. Sub-scripts are strings rather than arithmetic expressions. .RE .sp .ne 2 .na ! \fB\fB-b\fR\fR .ad .RS 6n The variable can hold any number of bytes of data. The data can be text or binary. The value is represented by the \fBbase64\fR encoding of the data. If \fB-Z\fR is also specified, the size in bytes of the data in the buffer is --- 6597,6627 ---- .sp The following list of attributes can be specified: .sp .ne 2 .na ! \fB-a\fR .ad .RS 6n Declares \fIvname\fR to be an indexed array. This is optional unless except for compound variable assignments. .RE .sp .ne 2 .na ! \fB-A\fR .ad .RS 6n Declares \fIvname\fR to be an associative array. Sub-scripts are strings rather than arithmetic expressions. .RE .sp .ne 2 .na ! \fB-b\fR .ad .RS 6n The variable can hold any number of bytes of data. The data can be text or binary. The value is represented by the \fBbase64\fR encoding of the data. If \fB-Z\fR is also specified, the size in bytes of the data in the buffer is
*** 6216,6237 **** .RE .sp .ne 2 .na ! \fB\fB-E\fR\fR .ad .RS 6n Declares \fIvname\fR to be a double precision floating point number. If \fIn\fR is \fBnon-zero\fR, it defines the number of significant figures that are used when expanding \fIvname\fR. Otherwise, ten significant figures is used. .RE .sp .ne 2 .na ! \fB\fB-f\fR\fR .ad .RS 6n The names refer to function names rather than variable names. No assignments can be made and the only other valid options are \fB-t\fR, \fB-u\fR, and \fB-x.\fR The \fB-t\fR option turns on execution tracing for this function. The --- 6633,6665 ---- .RE .sp .ne 2 .na ! \fB-C\fR .ad .RS 6n + Causes each \fIvname\fR to be a compound variable. If \fIvalue\fR names + a compound variable it is copied into \fIvname\fR. Otherwise, it unsets each + vname. + .RE + + .sp + .ne 2 + .na + \fB-E\fR + .ad + .RS 6n Declares \fIvname\fR to be a double precision floating point number. If \fIn\fR is \fBnon-zero\fR, it defines the number of significant figures that are used when expanding \fIvname\fR. Otherwise, ten significant figures is used. .RE .sp .ne 2 .na ! \fB-f\fR .ad .RS 6n The names refer to function names rather than variable names. No assignments can be made and the only other valid options are \fB-t\fR, \fB-u\fR, and \fB-x.\fR The \fB-t\fR option turns on execution tracing for this function. The
*** 6240,6257 **** referenced. If no options other than \fB-f\fR is specified, then the function definition is displayed on standard output. If \fB+f\fR is specified, then a line containing the function name followed by a shell comment containing the line number and path name of the file where this function was defined, if any, is displayed. .sp The \fB-i\fR attribute cannot be specified with \fB-f\fR. .RE .sp .ne 2 .na ! \fB\fB-F\fR\fR .ad .RS 6n Declares \fIvname\fR to be a double precision floating point number. If \fIn\fR is \fBnon-zero\fR, it defines the number of places after the decimal point that are used when expanding \fIvname\fR. Otherwise ten places after the decimal --- 6668,6705 ---- referenced. If no options other than \fB-f\fR is specified, then the function definition is displayed on standard output. If \fB+f\fR is specified, then a line containing the function name followed by a shell comment containing the line number and path name of the file where this function was defined, if any, is displayed. + The names refer to function names rather than variable names. + No assignments can be made and the only other valid options are + \fB-S, -t, -u\fR and \fB-x\fR. + The \fB-S\fR can be used with discipline functions defined in a type to + indicate that the function is static. For a static function, the same method + will be used by all instances of that type no matter which instance references + it. In addition, it can only use value of variables from the original type + definition. These discipline functions cannot be redefined in any type + instance. + The \fB-t\fR option turns on execution tracing for this function. + The \fB-u\fR option causes this function to be marked undefined. + The \fBFPATH\fR variable will be searched to find the function definition + when the function is referenced. + If no options other than \fB-f\fR is specified, then the function definition + will be displayed on standard output. If \fB+f\fR is specified, then a line + containing the function name followed by a shell comment containing the line + number and path name of the file where this function was defined, if any, is + displayed. The exit status can be used to determine whether the function is + defined so that \fBtypeset -f .sh.math.\fR \fIname\fR will return 0 when math + function \fIname\fR is defined and non-zero otherwise. .sp The \fB-i\fR attribute cannot be specified with \fB-f\fR. .RE .sp .ne 2 .na ! \fB-F\fR .ad .RS 6n Declares \fIvname\fR to be a double precision floating point number. If \fIn\fR is \fBnon-zero\fR, it defines the number of places after the decimal point that are used when expanding \fIvname\fR. Otherwise ten places after the decimal
*** 6259,6278 **** .RE .sp .ne 2 .na ! \fB\fB-H\fR\fR .ad .RS 6n This option provides UNIX to hostname file mapping on non-UNIX machines. .RE .sp .ne 2 .na ! \fB\fB-i\fR\fR .ad .RS 6n Declares \fIvname\fR to be represented internally as integer. The right hand side of an assignment is evaluated as an arithmetic expression when assigning to an integer. If \fIn\fR is \fBnon-zero\fR, it defines the output arithmetic --- 6707,6738 ---- .RE .sp .ne 2 .na ! \fB-h\fR .ad .RS 6n + Used within type definitions to add information when generating information + about the sub-variable on the man page. It is ignored when used outside of a + type definition. When used with \fB-f\fR the information is associated with the + corresponding discipline function. + .RE + + .sp + .ne 2 + .na + \fB-H\fR + .ad + .RS 6n This option provides UNIX to hostname file mapping on non-UNIX machines. .RE .sp .ne 2 .na ! \fB-i\fR .ad .RS 6n Declares \fIvname\fR to be represented internally as integer. The right hand side of an assignment is evaluated as an arithmetic expression when assigning to an integer. If \fIn\fR is \fBnon-zero\fR, it defines the output arithmetic
*** 6283,6303 **** .RE .sp .ne 2 .na ! \fB\fB-l\fR\fR .ad .RS 6n ! All uppercase characters are converted to lowercase. The uppercase option, ! \fB-u\fR, is turned off. .RE .sp .ne 2 .na ! \fB\fB-L\fR\fR .ad .RS 6n Left justify and remove leading blanks from \fIvalue\fR. If \fIn\fR is \fBnon-zero\fR, it defines the width of the field, otherwise it is determined by the width of the value of first assignment. When the variable is assigned --- 6743,6765 ---- .RE .sp .ne 2 .na ! \fB-l\fR .ad .RS 6n ! Used with \fB-i, -E\fR or \fB-F\fR to indicate long integer, or long float. ! Otherwise, all upper-case characters are converted to lower-case. ! The upper-case option, \fB-u\fR, is turned off. ! Equivalent to \fB-M tolower\fR. .RE .sp .ne 2 .na ! \fB-L\fR .ad .RS 6n Left justify and remove leading blanks from \fIvalue\fR. If \fIn\fR is \fBnon-zero\fR, it defines the width of the field, otherwise it is determined by the width of the value of first assignment. When the variable is assigned
*** 6308,6331 **** .RE .sp .ne 2 .na ! \fB\fB-n\fR\fR .ad .RS 6n Declares \fIvname\fR to be a reference to the variable whose name is defined by the value of variable \fIvname\fR. This is usually used to reference a variable inside a function whose name has been passed as an argument. .RE .sp .ne 2 .na ! \fB\fB-R\fR\fR .ad .RS 6n Right justify and fill with leading blanks. If \fIn\fR is \fBnon-zero\fR, it defines the width of the field, otherwise it is determined by the width of the value of first assignment. The field is left filled with blanks or truncated from the end if the variable is reassigned. The \fB-L\fR option is turned off. .sp --- 6770,6829 ---- .RE .sp .ne 2 .na ! \fB-m\fR .ad .RS 6n + moves or renames the variable. The value is the name of a variable whose value + will be moved to \fIvname\fR. The original variable will be unset. Cannot be + used with any other options. + .RE + + .sp + .ne 2 + .na + \fB-M\fR + .ad + .RS 6n + Use the character mapping \fImapping\fR such as \fBtolower\fR + and \fBtoupper\fR when assigning a value to each of the specified operands. + When \fImapping\fR is specified and there are not operands, all variables + that use this mapping are written to standard output. + When \fImapping\fR is omitted and there are no operands, all mapped + variables are written to standard output. + .RE + + .sp + .ne 2 + .na + \fB-n\fR + .ad + .RS 6n Declares \fIvname\fR to be a reference to the variable whose name is defined by the value of variable \fIvname\fR. This is usually used to reference a variable inside a function whose name has been passed as an argument. .RE .sp .ne 2 .na ! \fB-p\fR .ad .RS 6n + The name, attributes and values for the given \fIvname\fR + are written on standard output in a form that can be used as shell input. + If \fB+p\fR is specified, then the values are not displayed. + .RE + + .sp + .ne 2 + .na + \fB-R\fR + .ad + .RS 6n Right justify and fill with leading blanks. If \fIn\fR is \fBnon-zero\fR, it defines the width of the field, otherwise it is determined by the width of the value of first assignment. The field is left filled with blanks or truncated from the end if the variable is reassigned. The \fB-L\fR option is turned off. .sp
*** 6333,6386 **** .RE .sp .ne 2 .na ! \fB\fB-r\fR\fR .ad .RS 6n The specified \fIvname\fRs are marked read-only and these names cannot be changed by subsequent assignment. .RE .sp .ne 2 .na ! \fB\fB-t\fR\fR .ad .RS 6n Tags the variables. Tags are user definable and have no special meaning to the shell. .RE .sp .ne 2 .na ! \fB\fB-u\fR\fR .ad .RS 6n ! All lowercase characters are converted to uppercase. The lowercase option, ! \fB-l\fR, is turned off. .RE .sp .ne 2 .na ! \fB\fB-x\fR\fR .ad .RS 6n The specified \fIvname\fRs are marked for automatic export to the environment ! of subsequently-executed commands. Variables whose names contain a . cannot be ! exported. .RE .sp .ne 2 .na ! \fB\fB-Z\fR\fR .ad .RS 6n Right justify and fill with leading zeros if the first non-blank character is a digit and the \fB-L\fR option has not been set. Remove leading zeros if the \fB-L\fR option is also set. If \fIn\fR is \fBnon-zero\fR, it defines the width of the field, otherwise it is determined by the width of the value of first assignment. --- 6831,6923 ---- .RE .sp .ne 2 .na ! \fB-r\fR .ad .RS 6n The specified \fIvname\fRs are marked read-only and these names cannot be changed by subsequent assignment. .RE .sp .ne 2 .na ! \fB-S\fR .ad .RS 6n + When used within the \fIassign_list\fR of a type definition, it causes the + specified sub-variable to be shared by all instances of the type. When used + inside a function defined with the \fBfunction\fR reserved word, the specified + variables will have \fIfunction static\fR scope. Otherwise, the variable is + unset prior to processing the assignment list. + .RE + + .sp + .ne 2 + .na + \fB-t\fR + .ad + .RS 6n Tags the variables. Tags are user definable and have no special meaning to the shell. .RE .sp .ne 2 .na ! \fB-T\fR .ad .RS 6n ! If followed by \fItname\fR, it creates a type named by \fItname\fR using the ! compound assignment \fIassign_list\fR to \fItname\fR. Otherwise, it writes all ! the type definitions to standard output. .RE .sp .ne 2 .na ! \fB-u\fR .ad .RS 6n + When given along with \fB-i\fR specifies unsigned integer. + Otherwise, all lower-case characters are converted to upper-case. + The lower-case option, \fB-l\fR, is turned off. + Equivalent to \fB-M toupper\fR. + .RE + + .sp + .ne 2 + .na + \fB-x\fR + .ad + .RS 6n The specified \fIvname\fRs are marked for automatic export to the environment ! of subsequently-executed commands. Variables whose names contain a \fB.\fR ! cannot be exported. .RE .sp .ne 2 .na ! \fB-X\fR .ad .RS 6n + Declares \fIvname\fR to be a double precision floating point number + and expands using the \fB%a\fR format of ISO-C99. + If \fIn\fR is non-zero, it defines the number of hex digits after + the radix point that is used when expanding \fIvname\fR. + The default is 10. + .RE + + .sp + .ne 2 + .na + \fB-Z\fR + .ad + .RS 6n Right justify and fill with leading zeros if the first non-blank character is a digit and the \fB-L\fR option has not been set. Remove leading zeros if the \fB-L\fR option is also set. If \fIn\fR is \fBnon-zero\fR, it defines the width of the field, otherwise it is determined by the width of the value of first assignment.
*** 6391,6401 **** .RE .sp .ne 2 .na ! \fB\fBulimit [\fR\fB-HSacdfmnpstv\fR\fB] [\fR \fIlimit\fR\fB]\fR\fR .ad .sp .6 .RS 4n Set or display a resource limit. Many systems do not support one or more of these limits. The limit for a specified resource is set when \fIlimit\fR is --- 6928,6938 ---- .RE .sp .ne 2 .na ! \fBulimit [\fR\fB-HSacdfmnpstv\fR\fB] [\fR \fIlimit\fR\fB]\fR .ad .sp .6 .RS 4n Set or display a resource limit. Many systems do not support one or more of these limits. The limit for a specified resource is set when \fIlimit\fR is
*** 6407,6454 **** .sp The following are the available resource limits: .sp .ne 2 .na ! \fB\fB-a\fR\fR .ad .RS 6n Lists all of the current resource limits. .RE .sp .ne 2 .na ! \fB\fB-c\fR\fR .ad .RS 6n The number of 512-byte blocks on the size of core dumps. .RE .sp .ne 2 .na ! \fB\fB-d\fR\fR .ad .RS 6n The number of Kbytes on the size of the data area. .RE .sp .ne 2 .na ! \fB\fB-f\fR\fR .ad .RS 6n The number of 512-byte blocks on files that can be written by the current process or by child processes (files of any size can be read). .RE .sp .ne 2 .na ! \fB\fB-H\fR\fR .ad .RS 6n Specifies a hard limit for the specified resource. .sp A hard limit cannot be increased once it is set. --- 6944,6991 ---- .sp The following are the available resource limits: .sp .ne 2 .na ! \fB-a\fR .ad .RS 6n Lists all of the current resource limits. .RE .sp .ne 2 .na ! \fB-c\fR .ad .RS 6n The number of 512-byte blocks on the size of core dumps. .RE .sp .ne 2 .na ! \fB-d\fR .ad .RS 6n The number of Kbytes on the size of the data area. .RE .sp .ne 2 .na ! \fB-f\fR .ad .RS 6n The number of 512-byte blocks on files that can be written by the current process or by child processes (files of any size can be read). .RE .sp .ne 2 .na ! \fB-H\fR .ad .RS 6n Specifies a hard limit for the specified resource. .sp A hard limit cannot be increased once it is set.
*** 6459,6505 **** .RE .sp .ne 2 .na ! \fB\fB-m\fR\fR .ad .RS 6n The number of Kbytes on the size of physical memory. .RE .sp .ne 2 .na ! \fB\fB-n\fR\fR .ad .RS 6n The number of file descriptors plus 1. .RE .sp .ne 2 .na ! \fB\fB-p\fR\fR .ad .RS 6n The number of 512-byte blocks for pipe buffering. .RE .sp .ne 2 .na ! \fB\fB-s\fR\fR .ad .RS 6n The number of Kbytes on the size of the stack area. .RE .sp .ne 2 .na ! \fB\fB-S\fR\fR .ad .RS 6n Specifies a soft limit for the specified resource. .sp A soft limit can be increased up to the value of the hard limit. --- 6996,7042 ---- .RE .sp .ne 2 .na ! \fB-m\fR .ad .RS 6n The number of Kbytes on the size of physical memory. .RE .sp .ne 2 .na ! \fB-n\fR .ad .RS 6n The number of file descriptors plus 1. .RE .sp .ne 2 .na ! \fB-p\fR .ad .RS 6n The number of 512-byte blocks for pipe buffering. .RE .sp .ne 2 .na ! \fB-s\fR .ad .RS 6n The number of Kbytes on the size of the stack area. .RE .sp .ne 2 .na ! \fB-S\fR .ad .RS 6n Specifies a soft limit for the specified resource. .sp A soft limit can be increased up to the value of the hard limit.
*** 6510,6529 **** .RE .sp .ne 2 .na ! \fB\fB-t\fR\fR .ad .RS 6n The number of CPU seconds to be used by each process. .RE .sp .ne 2 .na ! \fB\fB-v\fR\fR .ad .RS 6n The number of Kbytes for virtual memory. .RE --- 7047,7066 ---- .RE .sp .ne 2 .na ! \fB-t\fR .ad .RS 6n The number of CPU seconds to be used by each process. .RE .sp .ne 2 .na ! \fB-v\fR .ad .RS 6n The number of Kbytes for virtual memory. .RE
*** 6530,6540 **** .RE .sp .ne 2 .na ! \fB\fBumask\fR \fB[\fR\fB-S\fR\fB]\fR\fB[\fR\fImask\fR\fB]\fR\fR .ad .sp .6 .RS 4n The user file-creation mask is set to \fImask\fR. \fImask\fR can either be an octal number or a symbolic value as described in \fBchmod\fR(1). --- 7067,7077 ---- .RE .sp .ne 2 .na ! \fBumask\fR \fB[\fR\fB-S\fR\fB]\fR\fB[\fR\fImask\fR\fB]\fR .ad .sp .6 .RS 4n The user file-creation mask is set to \fImask\fR. \fImask\fR can either be an octal number or a symbolic value as described in \fBchmod\fR(1).
*** 6549,6559 **** .RE .sp .ne 2 .na ! \fB\fB+unalias\fR \fB[\fR\fB-a\fR\fB]\fR \fIname\fR\fR .ad .sp .6 .RS 4n The aliases specified by the list of \fIname\fRs are removed from the alias list. The \fB-a\fR option causes all the aliases to be unset. --- 7086,7096 ---- .RE .sp .ne 2 .na ! \fB+unalias\fR \fB[\fR\fB-a\fR\fB]\fR \fIname\fR .ad .sp .6 .RS 4n The aliases specified by the list of \fIname\fRs are removed from the alias list. The \fB-a\fR option causes all the aliases to be unset.
*** 6560,6570 **** .RE .sp .ne 2 .na ! \fB\fB+unset\fR \fB[\fR\fB-fnv\fR\fB]\fR \fIvname\fR\fR .ad .sp .6 .RS 4n The variables specified by the list of \fIvname\fRs are unassigned, i.e., their values and attributes are erased. Read-only variables cannot be unset. If the --- 7097,7107 ---- .RE .sp .ne 2 .na ! \fB+unset\fR \fB[\fR\fB-fnv\fR\fB]\fR \fIvname\fR .ad .sp .6 .RS 4n The variables specified by the list of \fIvname\fRs are unassigned, i.e., their values and attributes are erased. Read-only variables cannot be unset. If the
*** 6578,6588 **** .RE .sp .ne 2 .na ! \fB\fBwait\fR \fB[\fR\fIjob\fR\fB]\fR\fR .ad .sp .6 .RS 4n Wait for the specified job and report its termination status. If \fIjob\fR is not specified, then all currently active child processes are waited for. The --- 7115,7125 ---- .RE .sp .ne 2 .na ! \fBwait\fR \fB[\fR\fIjob\fR\fB]\fR .ad .sp .6 .RS 4n Wait for the specified job and report its termination status. If \fIjob\fR is not specified, then all currently active child processes are waited for. The
*** 6592,6602 **** .RE .sp .ne 2 .na ! \fB\fBwhence\fR \fB[\fR\fB-afpv\fR\fB]\fR \fIname ...\fR\fR .ad .sp .6 .RS 4n For each \fIname\fR, indicate how it would be interpreted if used as a command name. The \fB-v\fR option produces a more verbose report. The \fB-f\fR option --- 7129,7139 ---- .RE .sp .ne 2 .na ! \fBwhence\fR \fB[\fR\fB-afpv\fR\fB]\fR \fIname ...\fR .ad .sp .6 .RS 4n For each \fIname\fR, indicate how it would be interpreted if used as a command name. The \fB-v\fR option produces a more verbose report. The \fB-f\fR option
*** 6605,6615 **** \fB-a\fR option is similar to the -v option but causes all interpretations of the specified name to be reported. .RE .SS "Invocation" - .LP If the shell is invoked by \fBexec\fR(2), and the first character of argument zero (\fB$0\fR) is \fB-\fR, then the shell is assumed to be a login shell and commands are read from \fB/etc/profile\fR and then from either .\fBprofile\fR in the current directory or \fB$HOME/.profile\fR, if either file exists. Next, for interactive shells, commands are read first from \fB/etc/ksh.kshrc\fR, and --- 7142,7151 ----
*** 6628,6638 **** Commands are then read as described, and the following options are interpreted by the shell when it is invoked: .sp .ne 2 .na ! \fB\fB-c\fR\fR .ad .RS 15n If the \fB-c\fR option is present, then commands are read from the first \fIarg\fR. Any remaining arguments become positional parameters starting at \fB0\fR. --- 7164,7174 ---- Commands are then read as described, and the following options are interpreted by the shell when it is invoked: .sp .ne 2 .na ! \fB-c\fR .ad .RS 15n If the \fB-c\fR option is present, then commands are read from the first \fIarg\fR. Any remaining arguments become positional parameters starting at \fB0\fR.
*** 6639,6649 **** .RE .sp .ne 2 .na ! \fB\fB-D\fR\fR .ad .RS 15n A list of all double quoted strings that are preceded by a \fB$\fR is printed on standard output and the shell exits. This set of strings is subject to language translation when the locale is not C or POSIX. No commands are --- 7175,7185 ---- .RE .sp .ne 2 .na ! \fB-D\fR .ad .RS 15n A list of all double quoted strings that are preceded by a \fB$\fR is printed on standard output and the shell exits. This set of strings is subject to language translation when the locale is not C or POSIX. No commands are
*** 6651,6663 **** .RE .sp .ne 2 .na ! \fB\fB-i\fR\fR .ad .RS 15n If the \fB-i\fR option is present or if the shell input and output are attached to a terminal (as told by \fBtcgetattr\fR(3C), this shell is interactive. In this case \fBTERM\fR is ignored (so that \fBkill 0\fR does not kill an interactive shell) and \fBINTR\fR is caught and ignored (so that wait is interruptible). In all cases, \fBQUIT\fR is ignored by the shell. --- 7187,7209 ---- .RE .sp .ne 2 .na ! \fB-E\fR .ad .RS 15n + Reads the file named by the \fBENV\fR variable or by \fB$HOME/.kshrc\fR if + not defined after the profiles. + .RE + + .sp + .ne 2 + .na + \fB-i\fR + .ad + .RS 15n If the \fB-i\fR option is present or if the shell input and output are attached to a terminal (as told by \fBtcgetattr\fR(3C), this shell is interactive. In this case \fBTERM\fR is ignored (so that \fBkill 0\fR does not kill an interactive shell) and \fBINTR\fR is caught and ignored (so that wait is interruptible). In all cases, \fBQUIT\fR is ignored by the shell.
*** 6664,6694 **** .RE .sp .ne 2 .na ! \fB\fB-R\fR \fIfilename\fR\fR .ad .RS 15n The \fB-R\fR \fIfilename\fR option is used to generate a cross reference database that can be used by a separate utility to find definitions and references for variables and commands. .RE .sp .ne 2 .na ! \fB\fB-r\fR\fR .ad .RS 15n If the \fB-r\fR option is present, the shell is a restricted shell. .RE .sp .ne 2 .na ! \fB\fB-s\fR\fR .ad .RS 15n If the \fB-s\fR option is present or if no arguments remain, then commands are read from the standard input. Shell output, except for the output of the \fBSpecial Commands\fR listed, is written to file descriptor 2. --- 7210,7250 ---- .RE .sp .ne 2 .na ! \fB-P\fR .ad .RS 15n + If \fB-P\fR or \fB-o\fR profile is present, the shell is a profile shell + (see \fBpfexec\fR(1)). + .RE + + .sp + .ne 2 + .na + \fB-R\fR \fIfilename\fR + .ad + .RS 15n The \fB-R\fR \fIfilename\fR option is used to generate a cross reference database that can be used by a separate utility to find definitions and references for variables and commands. .RE .sp .ne 2 .na ! \fB-r\fR .ad .RS 15n If the \fB-r\fR option is present, the shell is a restricted shell. .RE .sp .ne 2 .na ! \fB-s\fR .ad .RS 15n If the \fB-s\fR option is present or if no arguments remain, then commands are read from the standard input. Shell output, except for the output of the \fBSpecial Commands\fR listed, is written to file descriptor 2.
*** 6697,6707 **** .sp .LP The remaining options and arguments are described under the \fBset\fR command. An optional \fB-\fR as the first argument is ignored. .SS "\fBrksh93\fR Only" - .LP \fBrksh93\fR is used to set up login names and execution environments whose capabilities are more controlled than those of the standard shell. .sp .LP The actions of \fBrksh93\fR are identical to those of \fBksh93\fR, except that --- 7253,7262 ----
*** 6764,6784 **** control over user actions, by performing guaranteed setup actions and leaving the user in an appropriate directory (probably not the login directory). The system administrator often sets up a directory of commands, for example, \fB/usr/rbin\fR, that can be safely invoked by \fBrksh\fR. .SH USAGE - .LP See \fBlargefile\fR(5) for the description of the behavior of \fBksh93\fR and \fBrksh93\fR when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). .SH EXIT STATUS - .LP The following exit values are returned: .sp .ne 2 .na ! \fB\fBnon-zero\fR\fR .ad .sp .6 .RS 4n Returns \fBnon-zero\fR when errors, such as syntax errors, are detected by the shell. --- 7319,7337 ---- control over user actions, by performing guaranteed setup actions and leaving the user in an appropriate directory (probably not the login directory). The system administrator often sets up a directory of commands, for example, \fB/usr/rbin\fR, that can be safely invoked by \fBrksh\fR. .SH USAGE See \fBlargefile\fR(5) for the description of the behavior of \fBksh93\fR and \fBrksh93\fR when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). .SH EXIT STATUS The following exit values are returned: .sp .ne 2 .na ! \fBnon-zero\fR .ad .sp .6 .RS 4n Returns \fBnon-zero\fR when errors, such as syntax errors, are detected by the shell.
*** 6789,6799 **** .RE .sp .ne 2 .na ! \fB\fIexit status of last command executed\fR\fR .ad .sp .6 .RS 4n Returns the exit status of the last command executed. .sp --- 7342,7352 ---- .RE .sp .ne 2 .na ! \fB\fIexit status of last command executed\fR .ad .sp .6 .RS 4n Returns the exit status of the last command executed. .sp
*** 6806,6836 **** .RE .SH FILES .ne 2 .na ! \fB\fB/etc/profile\fR\fR .ad .sp .6 .RS 4n The system initialization file, executed for login shells. .RE .sp .ne 2 .na ! \fB\fB/etc/ksh.kshrc\fR\fR .ad .sp .6 .RS 4n The system wide startup file, executed for interactive shells. .RE .sp .ne 2 .na ! \fB\fB$HOME/.profile\fR\fR .ad .sp .6 .RS 4n The personal initialization file, executed for login shells after \fB/etc/profile\fR. --- 7359,7389 ---- .RE .SH FILES .ne 2 .na ! \fB/etc/profile\fR .ad .sp .6 .RS 4n The system initialization file, executed for login shells. .RE .sp .ne 2 .na ! \fB/etc/ksh.kshrc\fR .ad .sp .6 .RS 4n The system wide startup file, executed for interactive shells. .RE .sp .ne 2 .na ! \fB$HOME/.profile\fR .ad .sp .6 .RS 4n The personal initialization file, executed for login shells after \fB/etc/profile\fR.
*** 6837,6847 **** .RE .sp .ne 2 .na ! \fB\fB$HOME/.kshrc\fR\fR .ad .sp .6 .RS 4n Default personal initialization file, executed after \fB/etc/ksh.kshrc\fR, for interactive shells when \fBENV\fR is not set. --- 7390,7400 ---- .RE .sp .ne 2 .na ! \fB$HOME/.kshrc\fR .ad .sp .6 .RS 4n Default personal initialization file, executed after \fB/etc/ksh.kshrc\fR, for interactive shells when \fBENV\fR is not set.
*** 6848,6858 **** .RE .sp .ne 2 .na ! \fB\fB/etc/suid-profile\fR\fR .ad .sp .6 .RS 4n Alternative initialization file, executed instead of the personal initialization file when the real and effective user or group id do not match. --- 7401,7411 ---- .RE .sp .ne 2 .na ! \fB/etc/suid-profile\fR .ad .sp .6 .RS 4n Alternative initialization file, executed instead of the personal initialization file when the real and effective user or group id do not match.
*** 6859,6880 **** .RE .sp .ne 2 .na ! \fB\fB/dev/null\fR\fR .ad .sp .6 .RS 4n NULL device. .RE .SH AUTHORS - .LP David Korn, \fBdgk@research.att.com\fR .SH ATTRIBUTES - .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS --- 7412,7431 ---- .RE .sp .ne 2 .na ! \fB/dev/null\fR .ad .sp .6 .RS 4n NULL device. .RE .SH AUTHORS David Korn, \fBdgk@research.att.com\fR .SH ATTRIBUTES See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS
*** 6889,6902 **** .sp .LP The scripting interface is Uncommitted. The environment variables, \fB\&.paths\fR feature, and editing modes are Volatile. .SH SEE ALSO - .LP \fBcat\fR(1), \fBcd\fR(1), \fBchmod\fR(1), \fBcut\fR(1), \fBdate\fR(1), \fBegrep\fR(1), \fBecho\fR(1), \fBegrep\fR(1), \fBenv\fR(1), \fBfgrep\fR(1), ! \fBgrep\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpaste\fR(1), \fBprintf\fR(1), \fBstty\fR(1), \fBtest\fR(1), \fBumask\fR(1), \fBvi\fR(1), \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBioctl\fR(2), \fBlseek\fR(2), \fBpathconf\fR(2), \fBpipe\fR(2), \fBsysconf\fR(3C), \fBulimit\fR(2), \fBumask\fR(2), \fBrand\fR(3C), \fBtcgetattr\fR(3C), \fBwait\fR(3C), \fBa.out\fR(4), \fBprofile\fR(4), \fBattributes\fR(5), \fBenviron\fR(5), --- 7440,7452 ---- .sp .LP The scripting interface is Uncommitted. The environment variables, \fB\&.paths\fR feature, and editing modes are Volatile. .SH SEE ALSO \fBcat\fR(1), \fBcd\fR(1), \fBchmod\fR(1), \fBcut\fR(1), \fBdate\fR(1), \fBegrep\fR(1), \fBecho\fR(1), \fBegrep\fR(1), \fBenv\fR(1), \fBfgrep\fR(1), ! \fBgrep\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpaste\fR(1), \fBpfexec\fR(1), \fBprintf\fR(1), \fBstty\fR(1), \fBtest\fR(1), \fBumask\fR(1), \fBvi\fR(1), \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBioctl\fR(2), \fBlseek\fR(2), \fBpathconf\fR(2), \fBpipe\fR(2), \fBsysconf\fR(3C), \fBulimit\fR(2), \fBumask\fR(2), \fBrand\fR(3C), \fBtcgetattr\fR(3C), \fBwait\fR(3C), \fBa.out\fR(4), \fBprofile\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
*** 6908,6918 **** .sp .LP \fIPOSIX-Part 2: Shell and Utilities, IEEE Std 1003.2-1992, ISO/IEC 9945-2\fR, IEEE, 1993. .SH NOTES - .LP \fBksh93\fR scripts should choose shell function names outside the namespace used by reserved keywords of the ISO C99, C++ and JAVA languages to avoid collisions with future enhancements to \fBksh93\fR. .sp .LP --- 7458,7467 ----