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

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man1/ksh93.1
          +++ new/usr/src/man/man1/ksh93.1
   1    1  '\" te
   2    2  .\" Copyright (c) 1982-2007 AT&T Knowledge Ventures
   3      -.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
        3 +.\" To view license terms, see http://www.eclipse.org/org/documents/epl-v10.html
   4    4  .\" Portions Copyright (c) 2009, Sun Microsystems, Inc.
   5      -.TH KSH93 1 "Jun 27, 2018"
        5 +.\" Portions Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
        6 +.TH KSH93 1 "Jan 06, 2020"
   6    7  .SH NAME
   7    8  ksh93, rksh93 \- Korn Shell, a standard and restricted command and programming
   8    9  language
   9   10  .SH SYNOPSIS
  10      -.LP
  11   11  .nf
  12   12  \fBksh93\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [ \fB\(+-o\fR \fIoption\fR] ...
  13   13         [-] [\fIarg\fR ...]
  14   14  .fi
  15   15  
  16   16  .LP
  17   17  .nf
  18   18  \fBrksh93\fR [\fB\(+-abcefhikmnoprstuvxBCD\fR] [\fB-R\fR \fIfile\fR] [\fB\(+-o\fR \fIoption\fR] ...
  19   19         [-] [\fIarg\fR ...]
  20   20  .fi
  21   21  
  22   22  .SH DESCRIPTION
  23      -.LP
  24   23  \fBksh93\fR is a command and programming language that executes commands read
  25   24  from a terminal or a file. \fBrksh93\fR is a restricted version of the command
  26   25  interpreter \fBksh93\fR. \fBrksh93\fR is used to set up login names and
  27   26  execution environments whose capabilities are more controlled than those of the
  28   27  standard shell.
  29   28  .sp
  30   29  .LP
  31   30  See \fBInvocation\fR for the meaning of arguments to the shell.
  32   31  .SS "Definitions"
  33      -.LP
  34   32  A \fImetacharacter\fR is defined as one of the following characters:
  35   33  .sp
  36   34  .in +2
  37   35  .nf
  38   36  ; & ( ) | < > NEWLINE SPACE TAB
  39   37  .fi
  40   38  .in -2
  41   39  .sp
  42   40  
  43   41  .sp
↓ open down ↓ 19 lines elided ↑ open up ↑
  63   61  language. The shell reads each command and carries out the desired action
  64   62  either directly or by invoking separate utilities. A built-in command is a
  65   63  command that is carried out by the shell itself without creating a separate
  66   64  process. Some commands are built-in purely for convenience and are not
  67   65  documented in this manual page. Built-ins that cause side effects in the shell
  68   66  environment and built-ins that are found before performing a path search (see
  69   67  \fBExecution\fR) are documented in this manual page. For historical reasons,
  70   68  some of these built-ins behave differently than other built-ins and are called
  71   69  special built-ins.
  72   70  .SS "Commands"
  73      -.LP
  74   71  A \fIsimple-command\fR is a list of variable assignments (see \fBVariable
  75   72  Assignments\fR) or a sequence of \fIblank\fR-separated words which can be
  76   73  preceded by a list of variable assignments. See the \fBEnvironment\fR section
  77   74  of this manual page.
  78   75  .sp
  79   76  .LP
  80   77  The first word specifies the name of the command to be executed. Except as
  81   78  specified in this section, the remaining words are passed as arguments to the
  82   79  invoked command. The command name is passed as argument 0. See \fBexec\fR(2).
  83   80  The \fIvalue\fR of a simple-command is its exit status. If it terminates
↓ open down ↓ 38 lines elided ↑ open up ↑
 122  119  preceded by a semicolon. This semicolon is ignored unless the \fBshowme\fR
 123  120  option is enabled as described with the \fBset\fR built-in.
 124  121  .sp
 125  122  .LP
 126  123  A \fIcommand\fR is either a simple-command or one of commands in the following
 127  124  list. Unless otherwise stated, the value returned by a command is that of the
 128  125  last simple-command executed in the command.
 129  126  .sp
 130  127  .ne 2
 131  128  .na
 132      -\fB\fBfor\fR \fIvname\fR \fB[ in\fR \fIword\fR \fB\&... ] ;do\fR \fIlist\fR
 133      -\fB;done\fR\fR
      129 +\fBfor\fR \fIvname\fR \fB[ in\fR \fIword\fR \fB\&... ] ;do\fR \fIlist\fR
      130 +\fB;done\fR
 134  131  .ad
 135  132  .sp .6
 136  133  .RS 4n
 137  134  Each time a \fBfor\fR command is executed, \fIvname\fR is set to the next
 138  135  \fIword\fR taken from the \fBin\fR \fIword\fR list. If \fBin\fR \fIword ...\fR
 139  136  is omitted, the \fBfor\fR command executes the \fBdo\fR \fIlist\fR once for
 140  137  each positional parameter that is set starting from 1. Execution ends when
 141  138  there are no more words in the list. See \fBParameter Expansion\fR.
 142  139  .RE
 143  140  
 144  141  .sp
 145  142  .ne 2
 146  143  .na
 147      -\fB\fB(( [\fR\fIexpr1\fR\fB] ; [\fR\fIexpr2\fR] ; [\fIexpr3\fR\fB] )) ;do\fR
 148      -\fIlist\fR \fB;done\fR\fR
      144 +\fBfor (( [\fR\fIexpr1\fR\fB] ; [\fR\fIexpr2\fR] ; [\fIexpr3\fR\fB] )) ;do\fR
      145 +\fIlist\fR \fB;done\fR
 149  146  .ad
 150  147  .sp .6
 151  148  .RS 4n
 152  149  The arithmetic expression \fIexpr1\fR is evaluated first. The arithmetic
 153  150  expression \fIexpr2\fR is repeatedly evaluated until it evaluates to \fBzero\fR
 154  151  and when \fBnon-zero\fR, \fIlist\fR is executed and the arithmetic expression
 155  152  \fIexpr3\fR evaluated. If any expression is omitted, then it behaves as if it
 156  153  evaluated to \fB1\fR. See \fBArithmetic Evaluation\fR.
 157  154  .RE
 158  155  
 159  156  .sp
 160  157  .ne 2
 161  158  .na
 162      -\fB\fBselect\fR \fIvname\fR [ in \fIword\fR \fB\&... ] ;do\fR \fIlist\fR
 163      -\fB;done\fR\fR
      159 +\fBselect\fR \fIvname\fR [ in \fIword\fR \fB\&... ] ;do\fR \fIlist\fR
      160 +\fB;done\fR
 164  161  .ad
 165  162  .sp .6
 166  163  .RS 4n
 167  164  A \fBselect\fR command prints on standard error (file descriptor 2) the set of
 168  165  \fIwords\fR, each preceded by a number. If \fBin\fR \fIword...\fR is omitted,
 169  166  the positional parameters starting from \fB1\fR are used instead. See
 170  167  \fBParameter Expansion\fR. The \fBPS3\fR prompt is printed and a line is read
 171  168  from the standard input. If this line consists of the number of one of the
 172  169  listed \fIword\fRs, then the value of the variable \fIvname\fR is set to the
 173  170  \fIword\fR corresponding to this number. If this line is empty, the selection
↓ open down ↓ 1 lines elided ↑ open up ↑
 175  172  to \fBnull\fR. The contents of the line read from standard input is saved in
 176  173  the variable \fBREPLY\fR. The \fIlist\fR is executed for each selection until a
 177  174  break or \fBEOF\fR is encountered. If the \fBREPLY\fR variable is set to
 178  175  \fBnull\fR by the execution of \fIlist\fR, the selection list is printed before
 179  176  displaying the \fBPS3\fR prompt for the next selection.
 180  177  .RE
 181  178  
 182  179  .sp
 183  180  .ne 2
 184  181  .na
 185      -\fB\fBcase\fR \fIword\fR \fBin [ [(]\fR \fIpattern\fR \fB[ |\fR \fIpattern\fR
 186      -\fB] ... )\fR \fIlist\fR \fB;; ] ... esac\fR\fR
      182 +\fBcase\fR \fIword\fR \fBin [ [(]\fR \fIpattern\fR \fB[ |\fR \fIpattern\fR
      183 +\fB] ... )\fR \fIlist\fR \fB;; ] ... esac\fR
 187  184  .ad
 188  185  .sp .6
 189  186  .RS 4n
 190  187  A \fBcase\fR command executes the \fIlist\fR associated with the first
 191  188  \fIpattern\fR that matches \fIword\fR. The form of the patterns is the same as
 192  189  that used for file name generation. See \fBFile Name Generation\fR.
 193  190  .sp
 194  191  The \fB;;\fR operator causes execution of \fBcase\fR to terminate. If \fB;&\fR
 195  192  is used in place of \fB;;\fR the next subsequent list, if any, is executed.
 196  193  .RE
 197  194  
 198  195  .sp
 199  196  .ne 2
 200  197  .na
 201      -\fB\fBif\fR \fIlist\fR \fB;then\fR \fIlist\fR \fB[ ;elif\fR \fIlist\fR
 202      -\fB;then\fR \fIlist\fR ] \fB\&... [ ;else\fR \fIlist\fR \fB]\fR \fB;fi\fR\fR
      198 +\fBif\fR \fIlist\fR \fB;then\fR \fIlist\fR \fB[ ;elif\fR \fIlist\fR
      199 +\fB;then\fR \fIlist\fR ] \fB\&... [ ;else\fR \fIlist\fR \fB]\fR \fB;fi\fR
 203  200  .ad
 204  201  .sp .6
 205  202  .RS 4n
 206  203  The \fIlist\fR following \fBif\fR is executed and, if it returns a \fBzero\fR
 207  204  exit status, the \fIlist\fR following the first \fBthen\fR is executed.
 208  205  Otherwise, the \fIlist\fR following \fBelif\fR is executed, and, if its value
 209  206  is \fBzero\fR, the \fIlist\fR following the next \fBthen\fR is executed.
 210  207  Failing each successive \fBelif\fR \fIlist\fR, the \fBelse\fR \fIlist\fR is
 211  208  executed. If the \fBif\fR \fIlist\fR has \fBnon-zero\fR exit status and there
 212  209  is no \fBelse\fR \fIlist\fR, then the \fBif\fR command returns a \fBzero\fR
 213  210  exit status.
 214  211  .RE
 215  212  
 216  213  .sp
 217  214  .ne 2
 218  215  .na
 219      -\fB\fBwhile\fR \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR
      216 +\fBwhile\fR \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR
 220  217  .ad
 221  218  .br
 222  219  .na
 223      -\fBuntil \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR\fR
      220 +\fBuntil \fIlist\fR \fB;do\fR \fIlist\fR \fB;done\fR
 224  221  .ad
 225  222  .sp .6
 226  223  .RS 4n
 227  224  A \fBwhile\fR command repeatedly executes the while \fIlist\fR and, if the exit
 228  225  status of the last command in the list is zero, executes the \fBdo\fR
 229  226  \fIlist\fR, otherwise the loop terminates. If no commands in the \fBdo\fR
 230  227  \fIlist\fR are executed, then the \fBwhile\fR command returns a \fBzero\fR exit
 231  228  status, \fBuntil\fR can be used in place of \fBwhile\fR to negate the loop
 232  229  termination test.
 233  230  .RE
 234  231  
 235  232  .sp
 236  233  .ne 2
 237  234  .na
 238      -\fB\fB((\fR\fIexpression\fR\fB))\fR\fR
      235 +\fB((\fR\fIexpression\fR\fB))\fR
 239  236  .ad
 240  237  .sp .6
 241  238  .RS 4n
 242  239  The \fIexpression\fR is evaluated using the rules for arithmetic evaluation
 243  240  described in this manual page. If the value of the arithmetic expression is
 244  241  \fBnon-zero\fR, the exit status is \fB0\fR. Otherwise the exit status is
 245  242  \fB1\fR.
 246  243  .RE
 247  244  
 248  245  .sp
 249  246  .ne 2
 250  247  .na
 251      -\fB\fB(\fR\fIlist\fR\fB;)\fR\fR
      248 +\fB(\fR\fIlist\fR\fB)\fR
 252  249  .ad
 253  250  .sp .6
 254  251  .RS 4n
 255      -Execute list in a separate environment. If two adjacent open parentheses are
 256      -needed for nesting, a SPACE must be inserted to avoid evaluation as an
      252 +Execute \fIlist\fR in a separate environment. If two adjacent open parentheses
      253 +are needed for nesting, a SPACE must be inserted to avoid evaluation as an
 257  254  arithmetic command as described in this section.
      255 +.RE
      256 +
 258  257  .sp
      258 +.ne 2
      259 +.na
      260 +\fB{\fR \fIlist\fR\fB;}
      261 +.sp
      262 +.RS 4n
 259  263  \fIlist\fR is simply executed. Unlike the metacharacters, \fB(\fR and \fB)\fR,
 260  264  \fB{\fR and \fB}\fR are \fIreserved words\fR and must occur at the beginning of
 261  265  a line or after a \fB;\fR to be recognized.
 262  266  .RE
 263  267  
 264  268  .sp
 265  269  .ne 2
 266  270  .na
 267      -\fB\fB[[\fR \fIexpression\fR \fB]]\fR\fR
      271 +\fB[[\fR \fIexpression\fR \fB]]\fR
 268  272  .ad
 269  273  .sp .6
 270  274  .RS 4n
 271  275  Evaluates \fIexpression\fR and returns a \fBzero\fR exit status when
 272  276  \fIexpression\fR is true. See \fBConditional Expressions\fR for a description
 273  277  of \fIexpression\fR.
 274  278  .RE
 275  279  
 276  280  .sp
 277  281  .ne 2
 278  282  .na
 279      -\fB\fBfunction\fR \fIvarname\fR \fB{\fR \fIlist\fR \fB;}\fR\fR
      283 +\fBfunction\fR \fIvarname\fR \fB{\fR \fIlist\fR \fB;}\fR
 280  284  .ad
 281  285  .br
 282  286  .na
 283      -\fB\fIvarname\fR \fB() {\fR \fIlist\fR \fB;}\fR\fR
      287 +\fB\fIvarname\fR \fB() {\fR \fIlist\fR \fB;}\fR
 284  288  .ad
 285  289  .sp .6
 286  290  .RS 4n
 287  291  Define a function which is referenced by \fIvarname\fR. A function whose
 288      -\fIvarname\fR contains a \fB\&.\fR is called a discipline function and the
      292 +\fIvarname\fR contains a dot (\fB\&.\fR) is called a discipline function and the
 289  293  portion of the \fIvarname\fR preceding the last \fB\&.\fR must refer to an
 290  294  existing variable.
 291  295  .sp
 292  296  The body of the function is the \fIlist\fR of commands between \fB{\fR and
 293  297  \fB}\fR. A function defined with the function \fIvarname\fR syntax can also be
 294  298  used as an argument to the \fB\&.\fR special built-in command to get the
 295  299  equivalent behavior as if the \fIvarname\fR\fB()\fR syntax were used to define
 296  300  it. See \fBFunctions\fR.
 297  301  .RE
 298  302  
 299  303  .sp
 300  304  .ne 2
 301  305  .na
 302      -\fB\fBtime [\fR \fIpipeline\fR \fB]\fR\fR
      306 +\fBnamespace\fR \fIidentifier\fR \fB{\fR \fIlist\fR \fB};\fR
 303  307  .ad
 304  308  .sp .6
 305  309  .RS 4n
      310 +Defines or uses the name space \fIidentifier\fR and runs the commands in
      311 +\fIlist\fR in this name space.
      312 +See \fBName Spaces\fR.
      313 +.RE
      314 +
      315 +.sp
      316 +.ne 2
      317 +.na
      318 +\fBtime [\fR \fIpipeline\fR \fB]\fR
      319 +.ad
      320 +.sp .6
      321 +.RS 4n
 306  322  If \fIpipeline\fR is omitted, the user and system time for the current shell
 307  323  and completed child processes is printed on standard error. Otherwise,
 308  324  \fIpipeline\fR is executed and the elapsed time as well as the user and system
 309  325  time are printed on standard error. The \fBTIMEFORMAT\fR variable can be set to
 310  326  a format string that specifies how the timing information should be displayed.
 311  327  See \fBShell Variables\fR for a description of the \fBTIMEFORMAT\fR variable.
 312  328  .RE
 313  329  
 314  330  .sp
 315  331  .LP
 316  332  The following reserved words are recognized as reserved only when they are the
 317  333  first word of a command and are not quoted:
 318      -.br
      334 +.sp
 319  335  .in +2
 320  336  \fBcase\fR
 321  337  .in -2
 322  338  .br
 323  339  .in +2
 324  340  \fBdo\fR
 325  341  .in -2
 326  342  .br
 327  343  .in +2
 328  344  \fBdone\fR
↓ open down ↓ 52 lines elided ↑ open up ↑
 381  397  .in -2
 382  398  .br
 383  399  .in +2
 384  400  \fB[[ ]]\fR
 385  401  .in -2
 386  402  .br
 387  403  .in +2
 388  404  \fB!\fR
 389  405  .in -2
 390  406  .SS "Variable Assignments"
 391      -.LP
 392  407  One or more variable assignments can start a simple command or can be arguments
 393      -to the \fBtypeset\fR, \fBexport\fR, or \fBreadonly\fR special built-in
 394      -commands. The syntax for an \fIassignment\fR is of the form:
      408 +to the \fBtypeset\fR, \fBenum\fR, \fBexport\fR, or \fBreadonly\fR special
      409 +built-in commands. The syntax for an \fIassignment\fR is of the form:
 395  410  .sp
 396  411  .ne 2
 397  412  .na
 398      -\fB\fIvarname\fR\fB=\fR\fIword\fR\fR
      413 +\fB\fIvarname\fR\fB=\fR\fIword\fR
 399  414  .ad
 400  415  .br
 401  416  .na
 402      -\fB\fIvarname\fR\fB[\fR\fIword\fR\fB]=\fR\fIword\fR\fR
      417 +\fB\fIvarname\fR\fB[\fR\fIword\fR\fB]=\fR\fIword\fR
 403  418  .ad
 404  419  .sp .6
 405  420  .RS 4n
 406  421  No space is permitted between \fIvarname\fR and the \fB=\fR or between \fB=\fR
 407  422  and \fIword\fR.
      423 +The variable \fIvarname\fR is unset before the assignment.
 408  424  .RE
 409  425  
 410  426  .sp
 411  427  .ne 2
 412  428  .na
 413      -\fB\fIvarname\fR\fB=(\fR\fIassignlist\fR\fB)\fR\fR
      429 +\fB\fIvarname\fR\fB=(\fR\fIassignlist\fR\fB)\fR
 414  430  .ad
 415  431  .sp .6
 416  432  .RS 4n
 417  433  No space is permitted between \fIvarname\fR and the \fB=\fR. An
 418  434  \fIassignlist\fR can be one of the following:
 419  435  .sp
 420  436  .ne 2
 421  437  .na
 422      -\fB\fIword ...\fR\fR
      438 +\fB\fIword ...\fR
 423  439  .ad
 424  440  .sp .6
 425  441  .RS 4n
 426  442  Indexed array assignment.
 427  443  .RE
 428  444  
 429  445  .sp
 430  446  .ne 2
 431  447  .na
 432      -\fB\fB[\fR\fIword\fR\fB]=\fR\fIword ...\fR\fR
      448 +\fB[\fR\fIword\fR\fB]=\fR\fIword ...\fR
 433  449  .ad
 434  450  .sp .6
 435  451  .RS 4n
 436  452  Associative array assignment. If prefixed by \fBtypeset\fR \fB-a\fR, creates an
 437  453  indexed array instead.
 438  454  .RE
 439  455  
 440  456  .sp
 441  457  .ne 2
 442  458  .na
 443      -\fB\fIassignment ...\fR\fR
      459 +\fB\fIassignment ...\fR
 444  460  .ad
 445  461  .sp .6
 446  462  .RS 4n
 447  463  Compound variable assignment. This creates a compound variable \fIvarname\fR
 448  464  with sub-variables of the form \fIvarname.name\fR, where \fIname\fR is the name
 449  465  portion of assignment. The value of \fIvarname\fR contains all the assignment
 450  466  elements. Additional assignments made to sub-variables of \fIvarname\fR are
 451  467  also displayed as part of the value of \fIvarname\fR. If no \fIassignment\fRs
 452  468  are specified, \fIvarname\fR is a compound variable allowing subsequence child
 453  469  elements to be defined.
 454  470  .RE
 455  471  
 456  472  .sp
 457  473  .ne 2
 458  474  .na
 459      -\fB\fBtypeset [\fR\fIoptions\fR] \fIassignment\fR \fB\&...\fR\fR
      475 +\fBtypeset [\fR\fIoptions\fR] \fIassignment\fR \fB\&...\fR
 460  476  .ad
 461  477  .sp .6
 462  478  .RS 4n
 463  479  Nested variable assignment. Multiple assignments can be specified by separating
 464  480  each of them with a \fB;\fR. The previous value is unset before the assignment.
 465  481  .RE
 466  482  
      483 +.sp
      484 +.ne 2
      485 +.na
      486 +\fB.\fR \fIfilename\fR
      487 +.ad
      488 +.sp .6
      489 +.RS 4n
      490 +Include the assignment commands contained in \fIfilename\fR.
      491 +.RE
      492 +
 467  493  In addition, a \fB+=\fR can be used in place of the \fB=\fR to signify adding
 468  494  to or appending to the previous value. When \fB+=\fR is applied to an
 469  495  arithmetic type, \fIword\fR is evaluated as an arithmetic expression and added
 470  496  to the current value. When applied to a string variable, the value defined by
 471  497  \fIword\fR is appended to the value. For compound assignments, the previous
 472  498  value is not unset and the new values are appended to the current ones provided
 473  499  that the types are compatible.
      500 +
      501 +The right hand side of a variable assignment undergoes all the expansion
      502 +listed below except word splitting, brace expansion, and file name generation.
      503 +When the left hand side is an assignment is a compound variable and
      504 +the right hand is the name of a compound variable, the compound variable
      505 +on the right will be copied or appended to the compound variable on the left.
      506 +
 474  507  .RE
 475  508  
 476  509  .SS "Comments"
 477      -.LP
 478  510  A word beginning with \fB#\fR causes that word and all the following characters
 479  511  up to a NEWLINE to be commented, or ignored.
 480  512  .SS "Aliasing"
 481      -.LP
 482  513  The first word of each command is replaced by the text of an alias if an alias
 483  514  for this word has been defined. An alias name consists of any number of
 484  515  characters excluding metacharacters, quoting characters, file expansion
 485  516  characters, parameter expansion characters, command substitution characters,
 486      -and \fB=\fR. The replacement string can contain any valid shell script
 487      -including the metacharacters listed in the \fBCommands\fR section. The first
 488      -word of each command in the replaced text, other than any that are in the
 489      -process of being replaced, are tested for aliases. If the last character of the
 490      -alias value is a BLANK then the word following the alias is also checked for
 491      -alias substitution.
      517 +the characters \fB/\fR and \fB=\fR. The replacement string can contain any
      518 +valid shell script including the metacharacters listed in the \fBCommands\fR
      519 +section. The first word of each command in the replaced text, other than any
      520 +that are in the process of being replaced, are tested for aliases. If the last
      521 +character of the alias value is a BLANK then the word following the alias is
      522 +also checked for alias substitution.
 492  523  .sp
 493  524  .LP
 494  525  Aliases can be used to redefine built-in commands but cannot be used to
 495  526  redefine the reserved words listed in the \fBCommands\fR section. Aliases can
 496  527  be created and listed with the alias command and can be removed with the
 497  528  \fBunalias\fR command.
 498  529  .sp
 499  530  .LP
 500  531  Aliasing is performed when scripts are read, not while they are executed. For
 501  532  an alias to take effect, the \fBalias\fR definition command has to be executed
 502  533  before the command which references the alias is read. The following aliases
 503  534  are compiled into the shell but can be unset or redefined:
 504  535  .sp
 505  536  .in +2
 506  537  .nf
 507  538  autoload='typeset -fu'
 508  539  command='command '
      540 +compound='typeset -C'
 509  541  fc=hist
 510  542  float='typeset -lE'
 511  543  functions='typeset -f'
 512  544  hash='alias -t --'
 513  545  history='hist -l'
 514  546  integer='typeset -li'
 515  547  nameref='typeset -n'
 516  548  nohup='nohup '
 517  549  r='hist -s'
 518  550  redirect='command exec'
 519  551  source='command .'
 520  552  stop='kill -s STOP'
 521  553  suspend='kill -s STOP $$'
 522  554  times='{ { time;} 2>&1;}'
 523  555  type='whence -v'
 524  556  .fi
 525  557  .in -2
 526  558  .sp
 527  559  
 528  560  .SS "Tilde Substitution"
 529      -.LP
 530  561  After alias substitution is performed, each word is checked to see if it begins
 531  562  with an unquoted tilde (\fB~\fR). For tilde substitution, \fIword\fR also
 532  563  refers to the \fIword\fR portion of parameter expansion. See \fBParameter
 533  564  Expansion\fR.
 534  565  .sp
 535  566  .LP
 536  567  If it does, the word up to a \fB/\fR is checked to see if it matches a user
 537  568  name in the password database. If a match is found, the \fB~\fR and the matched
 538  569  login name are replaced by the login directory of the matched user. If no match
 539  570  is found, the original text is left unchanged. A \fB~\fR by itself, or in front
 540  571  of a \fB/\fR, is replaced by \fB$HOME\fR. A \fB~\fR followed by a \fB+\fR or
 541  572  \fB-\fR is replaced by the value of \fB$PWD\fR and \fB$OLDPWD\fR respectively.
 542  573  .sp
 543  574  .LP
 544  575  In addition, when expanding a \fIvariable assignment\fR, tilde substitution is
 545  576  attempted when the value of the assignment begins with a \fB~\fR, and when a
 546  577  \fB~\fR appears after a colon (\fB:\fR). The \fB:\fR also terminates a \fB~\fR
 547  578  login name.
 548  579  .SS "Command Substitution"
 549      -.LP
 550  580  The standard output from a command enclosed in parentheses preceded by a dollar
 551      -sign (\fB$\fR) or a pair of grave accents (\fB``\fR) can be used as part or all
 552      -of a word. Trailing NEWLINEs are removed. In the second (obsolete) form, the
 553      -string between the quotes is processed for special quoting characters before
 554      -the command is executed. See \fBQuoting\fR.
      581 +sign ( \fB$(\fR\fIlist\fR\fB)\fR ), or in a brace group preceded by a dollar
      582 +sign ( \fB${\fR \fIlist\fR\fB;}\fR ), or in a pair of grave accents (\fB``\fR)
      583 +can be used as part or all of a word. Trailing NEWLINEs are removed. In the
      584 +second case, the \fB{\fR and \fB}\fR are treated as a reserved words so that
      585 +\fB{\fR must be followed by a blank and \fB}\fR must appear at the beginning of
      586 +the line or follow a \fB;\fR. In the third (obsolete) form, the string between
      587 +the quotes is processed for special quoting characters before the command is
      588 +executed. See \fBQuoting\fR.
 555  589  .sp
 556  590  .LP
 557  591  The command substitution \fB$(cat file)\fR can be replaced by the equivalent
 558  592  but faster \fB$(<file)\fR. The command substitution \fB$(\fR\fIn\fR\fB<#)\fR
 559      -expands to the current byte offset for file descriptor \fIn\fR.
      593 +expands to the current byte offset for file descriptor \fIn\fR. Except for the
      594 +second form, the command list is run in a subshell so that no side effects are
      595 +possible. For the second form, the final \fB}\fR will be recognized as a
      596 +reserved word after any token.
 560  597  .SS "Arithmetic Substitution"
 561      -.LP
 562  598  An arithmetic expression enclosed in double parentheses preceded by a dollar
 563  599  sign ( \fB$((\fR\fIarithmetic_expression\fR\fB))\fR) is replaced by the value
 564  600  of the arithmetic expression within the double parentheses.
 565  601  .SS "Process Substitution"
 566      -.LP
 567      -Process substitution is only available on versions of the UNIX operating system
 568      -that support the \fB/dev/fd\fR directory for naming open files.
 569      -.sp
 570      -.LP
 571  602  Each command argument of the form \fB<(\fR\fIlist\fR\fB)\fR or
 572  603  \fB>(\fR\fIlist\fR\fB)\fR runs process \fIlist\fR asynchronously connected to
 573  604  some file in \fB/dev/fd\fR. The name of this file becomes the argument to the
 574  605  command. If the form with \fB>\fR is selected then writing on this file
 575  606  provides input for \fIlist\fR. If \fB<\fR is used, then the file passed as an
 576  607  argument contains the output of the \fIlist\fR process.
 577  608  .sp
 578  609  .LP
 579  610  For example,
 580  611  .sp
↓ open down ↓ 5 lines elided ↑ open up ↑
 586  617  .in -2
 587  618  .sp
 588  619  
 589  620  .sp
 590  621  .LP
 591  622  \fBcut\fRs fields 1 and 3 from the files \fIfile1\fR and \fIfile2\fR
 592  623  respectively, \fBpaste\fRs the results together, and sends it to the processes
 593  624  \fIprocess1\fR and \fIprocess2\fR. It also displays the results to the standard
 594  625  output. The file, which is passed as an argument to the command, is a UNIX
 595  626  \fBpipe\fR(2). Programs that expect to \fBlseek\fR(2) on the file do not work.
      627 +.sp
      628 +Process substitution of the form \fB<\fR(\fIlist\fR\fB)\fR can also be used
      629 +with the \fB<\fR redirection operator which causes the output of list to be
      630 +standard input or the input for whatever file descriptor is specified.
 596  631  .SS "Parameter Expansion"
 597      -.LP
 598  632  A parameter is a variable, one or more digits, or any of the characters
 599  633  \fB*\fR, \fB@\fR, \fB#\fR, \fB?\fR, \fB-\fR, \fB$\fR, and \fB!\fR. A variable
 600  634  is denoted by a \fIvname\fR. To create a variable whose \fIvname\fR contains a
 601  635  \fB\&.\fR, a variable whose \fBvname\fR consists of everything before the
 602  636  last . must already exist. A variable has a value and zero or more attributes.
 603  637  Variables can be assigned values and attributes by using the \fBtypeset\fR
 604  638  special built-in command. The attributes supported by the shell are described
 605  639  later with the \fBtypeset\fR special built-in command. Exported variables pass
 606  640  values and attributes to the environment.
 607  641  .sp
 608  642  .LP
 609  643  The shell supports both indexed and associative arrays. An element of an array
 610  644  variable is referenced by a subscript. A subscript for an indexed array is
 611  645  denoted by an arithmetic expression, (see \fBArithmetic Evaluation\fR), between
 612      -a \fB[\fR and a \fB]\fR. Use \fBset -A\fR \fIvname value ...\fR to assign
 613      -values to an indexed array. The value of all subscripts must be in the range of
 614      -\fB0\fR through \fB1,048,575\fR. Indexed arrays do not need to be declared. Any
 615      -reference to a variable with a valid subscript is legal and an array is created
 616      -if necessary.
      646 +a \fB[\fR and a \fB]\fR.
      647 +To assign values to an indexed array, use \fIvname\fR\fB=(\fR\fIvalue\fR
      648 +\&...\fB)\fR or \fBset -A\fR \fIvname value ...\fR .
      649 +The value of all subscripts must be in the range of
      650 +\fB0\fR through \fB4,194,303\fR. A negative subscript is treated as an offset
      651 +from the maximum current index +1 so that -1 refers to the last element.
      652 +Indexed arrays can be declared with the \fB-a\fR option to typeset. Indexed
      653 +arrays need not be declared. Any reference to a variable with a valid
      654 +subscript is legal and an array will be created if necessary.
 617  655  .sp
 618  656  .LP
 619  657  An associative array is created with the \fB-A\fR option to \fBtypeset\fR. A
 620  658  subscript for an associative array is denoted by a string enclosed between
 621  659  \fB[\fR and \fB]\fR.
 622  660  .sp
 623  661  .LP
 624  662  Referencing any array without a subscript is equivalent to referencing the
 625  663  array with subscript \fB0\fR.
 626  664  .sp
↓ open down ↓ 10 lines elided ↑ open up ↑
 637  675  .sp
 638  676  .LP
 639  677  or
 640  678  .sp
 641  679  .in +2
 642  680  .nf
 643  681  \fIvname\fR[\fIsubscript\fR]=\fIvalue\fR [\fIvname\fR[\fIsubscript\fR]=\fIvalue\fR] ...
 644  682  .fi
 645  683  .in -2
 646  684  .sp
 647      -
      685 +Note that no space is allowed before or after the \fB=\fR.
 648  686  .sp
      687 +Attributes assigned by the \fItypeset\fR special built-in command apply to all
      688 +elements of the array.
      689 +An array element can be a simple variable, a compound variable or an array
      690 +variable.
      691 +An element of an indexed array can be either an indexed array or an associative
      692 +array.
      693 +An element of an associative array can also be either.
      694 +To refer to an array element that is part of an array
      695 +element, concatenate the subscript in brackets.  For example, to refer
      696 +to the \fIfoobar\fR element of an associative array that is defined as the
      697 +third element of the indexed array, use
      698 +\fB${\fIvname\fR\fB[\fR\fI3\fR\fB][\fR\fIfoobar\fR\fB]}\fR
      699 +.sp
 649  700  .LP
 650      -No space is allowed before or after the \fB=\fR. A \fInameref\fR is a variable
 651      -that is a reference to another variable. A \fInameref\fR is created with the
 652      -\fB-n\fR attribute of \fBtypeset\fR. The value of the variable at the time of
 653      -the \fBtypeset\fR command becomes the variable that is referenced whenever the
 654      -\fInameref\fR variable is used. The name of a \fInameref\fR cannot contain a
 655      -dot (\fI\&.\fR). When a variable or function name contains a \fB\&.,\fR and the
 656      -portion of the name up to the first \fB\&.\fR matches the name of a
 657      -\fInameref\fR, the variable referred to is obtained by replacing the
 658      -\fInameref\fR portion with the name of the variable referenced by the
 659      -\fInameref\fR. If a \fInameref\fR is used as the index of a \fBfor\fR loop, a
 660      -name reference is established for each item in the list. A \fInameref\fR
 661      -provides a convenient way to refer to the variable inside a function whose name
 662      -is passed as an argument to a function. For example, if the name of a variable
 663      -is passed as the first argument to a function, the command
      701 +A \fInameref\fR is a variable that is a reference to another variable. A
      702 +\fInameref\fR is created with the \fB-n\fR attribute of \fBtypeset\fR. The
      703 +value of the variable at the time of the \fBtypeset\fR command becomes the
      704 +variable that is referenced whenever the \fInameref\fR variable is used. The
      705 +name of a \fInameref\fR cannot contain a dot (\fI\&.\fR). When a variable or
      706 +function name contains a dot (\fB\&.\fR) and the portion of the name up to the
      707 +first \fB\&.\fR matches the name of a \fInameref\fR, the variable referred to
      708 +is obtained by replacing the \fInameref\fR portion with the name of the
      709 +variable referenced by the \fInameref\fR. If a \fInameref\fR is used as the
      710 +index of a \fBfor\fR loop, a name reference is established for each item in the
      711 +list. A \fInameref\fR provides a convenient way to refer to the variable inside
      712 +a function whose name is passed as an argument to a function. For example, if
      713 +the name of a variable is passed as the first argument to a function, the
      714 +command
 664  715  .sp
 665  716  .in +2
 666  717  .nf
 667  718   typeset -n var=$1
 668  719  .fi
 669  720  .in -2
 670  721  .sp
 671  722  
 672  723  .sp
 673  724  .LP
 674  725  inside the function causes references and assignments to \fIvar\fR to be
 675  726  references and assignments to the variable whose name has been passed to the
 676      -function. If either of the floating point attributes, \fB-E\fR, or \fB-F\fR, or
 677      -the integer attribute, \fB-i\fR, is set for \fIvname\fR, then the \fIvalue\fR
 678      -is subject to arithmetic evaluation as described in this manual page.
 679      -Positional parameters, parameters denoted by a number, can be assigned values
 680      -with the \fBset\fR special built-in command. Parameter \fB$0\fR is set from
 681      -argument zero when the shell is invoked. The character \fB$\fR is used to
 682      -introduce substitutable parameters.
      727 +function. If any of the floating point attributes, \fB-E\fR,\fB-F\fR or
      728 +\fB-X\fR, or the integer attribute, \fB-i\fR, is set for \fIvname\fR, then the
      729 +\fIvalue\fR is subject to arithmetic evaluation as described in this manual
      730 +page. Positional parameters, parameters denoted by a number, can be assigned
      731 +values with the \fBset\fR special built-in command. Parameter \fB$0\fR is set
      732 +from argument zero when the shell is invoked.
 683  733  .sp
      734 +The character \fB$\fR is used to introduce substitutable parameters.
      735 +.sp
 684  736  .ne 2
 685  737  .na
 686      -\fB\fB${\fR\fIparameter\fR\fB}\fR\fR
      738 +\fB${\fR\fIparameter\fR\fB}\fR
 687  739  .ad
 688  740  .sp .6
 689  741  .RS 4n
 690  742  The shell reads all the characters from \fB${\fR to the matching \fB}\fR as
 691  743  part of the same word even if it contains braces or metacharacters. The value,
 692  744  if any, of the parameter is substituted. The braces are required when
 693  745  \fIparameter\fR is followed by a letter, digit, or underscore that is not to be
 694      -interpreted as part of its name, when the variable name contains a \fB\&.\fR,
 695      -or when a variable is subscripted. If \fIparameter\fR is one or more digits
 696      -then it is a positional parameter. A positional parameter of more than one
 697      -digit must be enclosed in braces. If \fIparameter\fR is \fB*\fR or \fB@\fR,
 698      -then all the positional parameters, starting with \fB$1\fR, are substituted and
 699      -separated by a field separator character. If an array \fIvname\fR with
 700      -subscript \fB*\fR or \fB@\fR is used, then the value for each of the elements
 701      -is substituted, separated by the first character of the value of \fBIFS\fR.
      746 +interpreted as part of its name or when the variable name contains a dot
      747 +(\fB\&.\fR). The braces are also required when a variable is subscripted unless
      748 +it is part of an Arithmetic Expression or a Conditional Expression. If
      749 +\fIparameter\fR is one or more digits then it is a positional parameter. A
      750 +positional parameter of more than one digit must be enclosed in braces. If
      751 +\fIparameter\fR is \fB*\fR or \fB@\fR, then all the positional parameters,
      752 +starting with \fB$1\fR, are substituted and separated by a field separator
      753 +character. If an array \fIvname\fR with last subscript \fB*\fR or \fB@\fR is
      754 +used, or for index arrays of the form \fIsub1\fR \fB\&..\fR \fIsub2\fR is used,
      755 +then the value for each of the elements between \fIsub1\fR and \fIsub2\fR
      756 +inclusive (or all elements for \fB*\fR and \fB@\fR) is substituted, separated
      757 +by the first character of the value of \fBIFS\fR.
 702  758  .RE
 703  759  
 704  760  .sp
 705  761  .ne 2
 706  762  .na
 707      -\fB\fB${#\fR\fIparameter\fR\fB}\fR\fR
      763 +\fB${#\fR\fIparameter\fR\fB}\fR
 708  764  .ad
 709  765  .sp .6
 710  766  .RS 4n
 711  767  If \fIparameter\fR is \fB*\fR or \fB@\fR, the number of positional parameters
 712  768  is substituted. Otherwise, the length of the value of the \fIparameter\fR is
 713  769  substituted.
 714  770  .RE
 715  771  
 716  772  .sp
 717  773  .ne 2
 718  774  .na
 719      -\fB\fB${#\fR\fIvname\fR\fB[*]}\fR\fR
      775 +\fB${#\fR\fIvname\fR\fB[*]}\fR
 720  776  .ad
 721  777  .br
 722  778  .na
 723      -\fB\fB${#\fR\fIvname\fR\fB[@]}\fR\fR
      779 +\fB${#\fR\fIvname\fR\fB[@]}\fR
 724  780  .ad
 725  781  .sp .6
 726  782  .RS 4n
 727  783  The number of elements in the array \fIvname\fR is substituted.
 728  784  .RE
 729  785  
      786 +.ne 2
      787 +.na
      788 +\fB${@\fR\fIvname\fR\fB}\fR
      789 +.ad
      790 +.sp .6
      791 +.RS 4n
      792 +Expands to the type name or attributes of the variable referred to by
      793 +\fIvname\fR. See \fIType Variables\fR.
      794 +.RE
      795 +
 730  796  .sp
 731  797  .ne 2
 732  798  .na
 733      -\fB\fB${!\fR\fIvname\fR\fB}\fR\fR
      799 +\fB${!\fR\fIvname\fR\fB}\fR
 734  800  .ad
 735  801  .sp .6
 736  802  .RS 4n
 737  803  Expands to the name of the variable referred to by \fIvname\fR. This is
 738  804  \fIvname\fR except when \fIvname\fR is a name reference.
 739  805  .RE
 740  806  
 741  807  .sp
 742  808  .ne 2
 743  809  .na
 744      -\fB\fB${!\fR\fIvname\fR\fB[\fR\fIsubscript\fR\fB]}\fR\fR
      810 +\fB${!\fR\fIvname\fR\fB[\fR\fIsubscript\fR\fB]}\fR
 745  811  .ad
 746  812  .sp .6
 747  813  .RS 4n
 748      -Expands to name of the subscript unless \fIsubscript\fR is \fB*\fR or \fB@\fR.
      814 +Expands to name of the subscript unless \fIsubscript\fR is \fB*\fR or \fB@\fR,
      815 +or of the form \fIsub1\fR \fB..\fR \fIsub2\fR.
 749  816  When \fIsubscript\fR is \fB*\fR, the list of array subscripts for \fIvname\fR
 750  817  is generated. For a variable that is not an array, the value is \fB0\fR if the
 751      -variable is set. Otherwise it is \fBnull\fR. When \fIsubscript\fR is \fB@\fR,
      818 +variable is set, otherwise it is \fBnull\fR. When \fIsubscript\fR is \fB@\fR,
 752  819  it is the same as \fB$ {\fR\fIvname\fR\fB[\fR\fI*\fR\fB]}\fR, except that when
 753  820  used in double quotes, each array subscript yields a separate argument.
      821 +When subscript is of the form \fIsub1\fR \fB..\fR \fIsub2\fR it expands to the
      822 +list of subscripts between \fIsub1\fR and \fIsub2\fR inclusive using the same
      823 +quoting rules as \fB@\fR.
 754  824  .RE
 755  825  
 756  826  .sp
 757  827  .ne 2
 758  828  .na
 759      -\fB\fB${!\fR\fIprefix\fR\fB*}\fR\fR
      829 +\fB${!\fR\fIprefix\fR\fB*}\fR
 760  830  .ad
 761  831  .sp .6
 762  832  .RS 4n
 763  833  Expands to the names of the variables whose names begin with \fIprefix\fR.
 764  834  .RE
 765  835  
 766  836  .sp
 767  837  .ne 2
 768  838  .na
 769      -\fB\fB${\fR\fIparameter\fR\fB:-\fR\fIword\fR\fB}\fR\fR
      839 +\fB${\fR\fIparameter\fR\fB:-\fR\fIword\fR\fB}\fR
 770  840  .ad
 771  841  .sp .6
 772  842  .RS 4n
 773  843  If \fIparameter\fR is set and is non-null then substitute its value. Otherwise
 774  844  substitute \fIword\fR.
 775      -.sp
 776      -\fIword\fR is not evaluated unless it is to be used as the substituted string.
 777      -.sp
 778      -In the following example, \fBpwd\fR is executed only if \fBd\fR is not set or
 779      -is NULL:
 780      -.sp
 781      -.in +2
 782      -.nf
 783      -print ${d:-$(pwd)}
 784      -.fi
 785      -.in -2
 786      -.sp
 787      -
 788      -If the colon (\fB:\fR ) is omitted from the expression, the shell only checks
 789      -whether \fIparameter\fR is set or not.
 790  845  .RE
 791  846  
 792  847  .sp
 793  848  .ne 2
 794  849  .na
 795      -\fB\fB${\fR\fIparameter\fR\fB:=\fR\fIword\fR\fB}\fR\fR
      850 +\fB${\fR\fIparameter\fR\fB:=\fR\fIword\fR\fB}\fR
 796  851  .ad
 797  852  .sp .6
 798  853  .RS 4n
 799  854  If \fIparameter\fR is not set or is \fBnull\fR, set it to \fIword\fR. The value
 800  855  of the parameter is then substituted. Positional parameters cannot be assigned
 801  856  to in this way.
 802      -.sp
 803      -\fIword\fR is not evaluated unless it is to be used as the substituted string.
 804      -.sp
 805      -In the following example, \fBpwd\fR is executed only if \fBd\fR is not set or
 806      -is NULL:
 807      -.sp
 808      -.in +2
 809      -.nf
 810      -print ${d:-$(pwd)}
 811      -.fi
 812      -.in -2
 813      -.sp
 814      -
 815      -If the colon (\fB:\fR) is omitted from the expression, the shell only checks
 816      -whether \fIparameter\fR is set or not.
 817  857  .RE
 818  858  
 819  859  .sp
 820  860  .ne 2
 821  861  .na
 822      -\fB\fB${\fR\fIparameter\fR\fB:?\fR\fIword\fR\fB}\fR\fR
      862 +\fB${\fR\fIparameter\fR\fB:?\fR\fIword\fR\fB}\fR
 823  863  .ad
 824  864  .sp .6
 825  865  .RS 4n
 826  866  If \fIparameter\fR is set and is non-null, substitute its value. Otherwise,
 827  867  print \fIword\fR and exit from the shell , if the shell is not interactive. If
 828  868  \fIword\fR is omitted then a standard message is printed.
 829      -.sp
 830      -\fIword\fR is not evaluated unless it is to be used as the substituted string.
 831      -.sp
 832      -In the following example, \fBpwd\fR is executed only if \fBd\fR is not set or
 833      -is NULL:
 834      -.sp
 835      -.in +2
 836      -.nf
 837      -print ${d:-$(pwd)}
 838      -.fi
 839      -.in -2
 840      -.sp
 841      -
 842      -If the colon (\fB:\fR ) is omitted from the expression, the shell only checks
 843      -whether \fIparameter\fR is set or not.
 844  869  .RE
 845  870  
 846  871  .sp
 847  872  .ne 2
 848  873  .na
 849      -\fB\fB${\fR\fIparameter\fR\fB:+\fR\fIword\fR\fB}\fR\fR
      874 +\fB${\fR\fIparameter\fR\fB:+\fR\fIword\fR\fB}\fR
 850  875  .ad
 851  876  .sp .6
 852  877  .RS 4n
 853  878  If \fIparameter\fR is set and is non-null, substitute \fIword\fR. Otherwise
 854  879  substitute nothing.
      880 +.RE
      881 +
      882 +In the above, \fIword\fR is not evaluated unless it is to be used as the
      883 +substituted string. In the following example, \fBpwd\fR is executed only if
      884 +\fBd\fR is not set or is NULL:
 855  885  .sp
 856      -\fIword\fR is not evaluated unless it is to be used as the substituted string.
 857      -.sp
 858      -In the following example, \fBpwd\fR is executed only if \fBd\fR is not set or
 859      -is NULL:
 860      -.sp
 861  886  .in +2
 862  887  .nf
 863  888  print ${d:-$(pwd)}
 864  889  .fi
 865  890  .in -2
 866  891  .sp
 867  892  
 868  893  If the colon (\fB:\fR) is omitted from the expression, the shell only checks
 869  894  whether \fIparameter\fR is set or not.
 870      -.RE
 871  895  
 872  896  .sp
 873  897  .ne 2
 874  898  .na
 875      -\fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR:\fIlength\fR}\fR
      899 +\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR:\fIlength\fR}\fR
 876  900  .ad
 877  901  .br
 878  902  .na
 879      -\fB\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR\fB}\fR\fR
      903 +\fB${\fR\fIparameter\fR\fB:\fR\fIoffset\fR\fB}\fR
 880  904  .ad
 881  905  .sp .6
 882  906  .RS 4n
 883  907  Expands to the portion of the value of \fIparameter\fR starting at the
 884  908  character (counting from \fB0\fR) determined by expanding offset as an
 885  909  arithmetic expression and consisting of the number of characters determined by
 886  910  the arithmetic expression defined by \fIlength\fR.
 887  911  .sp
 888  912  In the second form, the remainder of the value is used. A negative offset
 889  913  counts backwards from the end of \fIparameter\fR.
↓ open down ↓ 2 lines elided ↑ open up ↑
 892  916  from interpreting the operator as \fB:-\fR. If parameter is \fB*\fR or \fB@\fR,
 893  917  or is an array name indexed by \fB*\fR or \fB@\fR, then \fIoffset\fR and
 894  918  \fIlength\fR refer to the array index and number of elements respectively. A
 895  919  negative \fIoffset\fR is taken relative to one greater than the highest
 896  920  subscript for indexed arrays. The order for associative arrays is unspecified.
 897  921  .RE
 898  922  
 899  923  .sp
 900  924  .ne 2
 901  925  .na
 902      -\fB\fB${\fR\fIparameter\fR\fB#\fR\fIpattern\fR\fB}\fR\fR
      926 +\fB${\fR\fIparameter\fR\fB#\fR\fIpattern\fR\fB}\fR
 903  927  .ad
 904  928  .br
 905  929  .na
 906      -\fB\fB${\fR\fIparameter\fR\fB##\fR\fIpattern\fR\fB}\fR\fR
      930 +\fB${\fR\fIparameter\fR\fB##\fR\fIpattern\fR\fB}\fR
 907  931  .ad
 908  932  .sp .6
 909  933  .RS 4n
 910  934  If the shell \fIpattern\fR matches the beginning of the value of
 911  935  \fIparameter\fR, then the value of this expansion is the value of the
 912  936  \fIparameter\fR with the matched portion deleted. Otherwise the value of this
 913  937  \fIparameter\fR is substituted. In the first form the smallest matching
 914  938  \fIpattern\fR is deleted and in the second form the largest matching
 915  939  \fIpattern\fR is deleted. When \fIparameter\fR is \fB@\fR, \fB*\fR, or an array
 916  940  variable with subscript \fB@\fR or \fB*\fR, the substring operation is applied
 917  941  to each element in turn.
 918  942  .RE
 919  943  
 920  944  .sp
 921  945  .ne 2
 922  946  .na
 923      -\fB\fB${\fR\fIparameter\fR\fB%\fR\fIpattern\fR\fB}\fR\fR
      947 +\fB${\fR\fIparameter\fR\fB%\fR\fIpattern\fR\fB}\fR
 924  948  .ad
 925  949  .br
 926  950  .na
 927      -\fB\fB${\fR\fIparameter\fR\fB%%\fR\fIpattern\fR\fB}\fR\fR
      951 +\fB${\fR\fIparameter\fR\fB%%\fR\fIpattern\fR\fB}\fR
 928  952  .ad
 929  953  .sp .6
 930  954  .RS 4n
 931  955  If the shell \fIpattern\fR matches the end of the value of \fIparameter\fR,
 932  956  then the value of this expansion is the value of the parameter with the matched
 933  957  part deleted. Otherwise substitute the value of \fIparameter\fR. In the first
 934  958  form the smallest matching pattern is deleted, and in the second form the
 935  959  largest matching pattern is deleted. When parameter is \fB@\fR, \fB*\fR, or an
 936  960  array variable with subscript \fB@\fR or \fB*\fR, the substring operation is
 937  961  applied to each element in turn.
 938  962  .RE
 939  963  
 940  964  .sp
 941  965  .ne 2
 942  966  .na
 943      -\fB\fB${\fR\fIparameter\fR\fB/\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
      967 +\fB${\fR\fIparameter\fR\fB/\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR
 944  968  .ad
 945  969  .br
 946  970  .na
 947      -\fB\fB${\fR\fIparameter\fR\fB//\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
      971 +\fB${\fR\fIparameter\fR\fB//\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR
 948  972  .ad
 949  973  .br
 950  974  .na
 951      -\fB\fB${\fR\fIparameter\fR\fB/#\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
      975 +\fB${\fR\fIparameter\fR\fB/#\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR
 952  976  .ad
 953  977  .br
 954  978  .na
 955      -\fB\fB${\fR\fIparameter\fR\fB/%\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR\fR
      979 +\fB${\fR\fIparameter\fR\fB/%\fR\fIpattern\fR\fB/\fR\fIstring\fR\fB}\fR
 956  980  .ad
 957  981  .sp .6
 958  982  .RS 4n
 959  983  Expands \fIparameter\fR and replaces the longest match of \fIpattern\fR with
 960  984  the specified \fIstring\fR. Each occurrence of \fB\e\fR\fIn\fR in \fIstring\fR
 961  985  is replaced by the portion of \fIparameter\fR that matches the \fIn\fR\fBth\fR
 962  986  sub-pattern.
 963  987  .sp
 964  988  When \fIstring\fR is null, the \fIpattern\fR is deleted and the \fB/\fR in
 965  989  front of string can be omitted. When \fIparameter\fR is \fB@\fR, \fB*\fR, or an
↓ open down ↓ 11 lines elided ↑ open up ↑
 977 1001  .sp
 978 1002  The fourth form restricts the pattern match to the end of the \fIstring\fR.
 979 1003  .RE
 980 1004  
 981 1005  .sp
 982 1006  .LP
 983 1007  The following parameters are automatically set by the shell:
 984 1008  .sp
 985 1009  .ne 2
 986 1010  .na
 987      -\fB\fB#\fR\fR
     1011 +\fB#\fR
 988 1012  .ad
 989 1013  .RS 19n
 990 1014  The number of positional parameters in decimal.
 991 1015  .RE
 992 1016  
 993 1017  .sp
 994 1018  .ne 2
 995 1019  .na
 996      -\fB\fB-\fR\fR
     1020 +\fB-\fR
 997 1021  .ad
 998 1022  .RS 19n
 999 1023  Options supplied to the shell on invocation or by the \fBset\fR command.
1000 1024  .RE
1001 1025  
1002 1026  .sp
1003 1027  .ne 2
1004 1028  .na
1005      -\fB\fB?\fR\fR
     1029 +\fB?\fR
1006 1030  .ad
1007 1031  .RS 19n
1008 1032  The decimal value returned by the last executed command.
1009 1033  .RE
1010 1034  
1011 1035  .sp
1012 1036  .ne 2
1013 1037  .na
1014      -\fB\fB$\fR\fR
     1038 +\fB$\fR
1015 1039  .ad
1016 1040  .RS 19n
1017 1041  The process number of this shell.
1018 1042  .RE
1019 1043  
1020 1044  .sp
1021 1045  .ne 2
1022 1046  .na
1023      -\fB\fB_\fR\fR
     1047 +\fB_\fR
1024 1048  .ad
1025 1049  .RS 19n
1026 1050  Initially, the value of \fB_\fR is the absolute pathname of the shell or script
1027 1051  being executed as passed in the environment. It is subsequently assigned the
1028 1052  last argument of the previous command.
1029 1053  .sp
1030 1054  This parameter is not set for commands which are asynchronous. This parameter
1031 1055  is also used to hold the name of the matching \fBMAIL\fR file when checking for
1032 1056  mail.
1033 1057  .RE
1034 1058  
1035 1059  .sp
1036 1060  .ne 2
1037 1061  .na
1038      -\fB\fB!\fR\fR
     1062 +\fB!\fR
1039 1063  .ad
1040 1064  .RS 19n
1041      -The process number of the last background command invoked or the most recent
1042      -job put in the background with the \fBbg\fR built-in command.
     1065 +The process id or the pool name and job number of the last background command
     1066 +invoked or the most recent job put in the background with the
     1067 +\fBbg\fR built-in command. Background jobs started in a named pool with be
     1068 +in the form \fIpool\fR.\fInumber\fR where \fIpool\fR is the pool name and
     1069 +\fInumber\fR is the job number within that pool.
1043 1070  .RE
1044 1071  
1045 1072  .sp
1046 1073  .ne 2
1047 1074  .na
1048      -\fB\fB\&.sh.command\fR\fR
     1075 +\fB\&.sh.command\fR
1049 1076  .ad
1050 1077  .RS 19n
1051 1078  When processing a \fBDEBUG\fR trap, this variable contains the current command
1052 1079  line that is about to run.
1053 1080  .RE
1054 1081  
1055 1082  .sp
1056 1083  .ne 2
1057 1084  .na
1058      -\fB\fB\&.sh.edchar\fR\fR
     1085 +\fB\&.sh.edchar\fR
1059 1086  .ad
1060 1087  .RS 19n
1061 1088  This variable contains the value of the keyboard character (or sequence of
1062 1089  characters if the first character is an ESC, \fBASCII 033\fR) that has been
1063 1090  entered when processing a \fBKEYBD\fR trap. If the value is changed as part of
1064 1091  the trap action, then the new value replaces the key (or key sequence) that
1065 1092  caused the trap. See the \fBKey Bindings\fR section of this manual page.
1066 1093  .RE
1067 1094  
1068 1095  .sp
1069 1096  .ne 2
1070 1097  .na
1071      -\fB\fB\&.sh.edcol\fR\fR
     1098 +\fB\&.sh.edcol\fR
1072 1099  .ad
1073 1100  .RS 19n
1074 1101  The character position of the cursor at the time of the most recent \fBKEYBD\fR
1075 1102  trap.
1076 1103  .RE
1077 1104  
1078 1105  .sp
1079 1106  .ne 2
1080 1107  .na
1081      -\fB\fB\&.sh.edmode\fR\fR
     1108 +\fB\&.sh.edmode\fR
1082 1109  .ad
1083 1110  .RS 19n
1084 1111  The value is set to ESC when processing a \fBKEYBD\fR trap while in \fBvi\fR
1085 1112  insert mode. Otherwise, \fB\&.sh.edmode\fR is null when processing a
1086 1113  \fBKEYBD\fR trap. See the \fBvi Editing Mode\fR section of this manual page.
1087 1114  .RE
1088 1115  
1089 1116  .sp
1090 1117  .ne 2
1091 1118  .na
1092      -\fB\fB\&.sh.edtext\fR\fR
     1119 +\fB\&.sh.edtext\fR
1093 1120  .ad
1094 1121  .RS 19n
1095 1122  The characters in the input buffer at the time of the most recent \fBKEYBD\fR
1096 1123  trap. The value is null when not processing a \fBKEYBD\fR trap.
1097 1124  .RE
1098 1125  
1099 1126  .sp
1100 1127  .ne 2
1101 1128  .na
1102      -\fB\fB\&.sh.file\fR\fR
     1129 +\fB\&.sh.file\fR
1103 1130  .ad
1104 1131  .RS 19n
1105 1132  The pathname of the file than contains the current command.
1106 1133  .RE
1107 1134  
1108 1135  .sp
1109 1136  .ne 2
1110 1137  .na
1111      -\fB\fB\&.sh.fun\fR\fR
     1138 +\fB\&.sh.fun\fR
1112 1139  .ad
1113 1140  .RS 19n
1114 1141  The name of the current function that is being executed.
1115 1142  .RE
1116 1143  
1117 1144  .sp
1118 1145  .ne 2
1119 1146  .na
1120      -\fB\fB\&.sh.match\fR\fR
     1147 +\fB\&.sh.match\fR
1121 1148  .ad
1122 1149  .RS 19n
1123 1150  An indexed array which stores the most recent match and sub-pattern matches
1124 1151  after conditional pattern matches that match and after variables expansions
1125 1152  using the operators \fB#\fR, \fB%\fR, or \fB/\fR. The \fB0\fRth element stores
1126 1153  the complete match and the \fIi\fRth element stores the \fIi\fRth sub-match.
1127 1154  The \fB\&.sh.match\fR variable is unset when the variable that has expanded is
1128 1155  assigned a new value.
1129 1156  .RE
1130 1157  
1131 1158  .sp
1132 1159  .ne 2
1133 1160  .na
1134      -\fB\fB\&.sh.name\fR\fR
     1161 +\fB\&.sh.math\fR
1135 1162  .ad
1136 1163  .RS 19n
     1164 +Used for defining arithmetic functions (see \fIArithmetic evaluation\fR) and
     1165 +stores the list of user-defined arithmetic functions.
     1166 +.RE
     1167 +
     1168 +.sp
     1169 +.ne 2
     1170 +.na
     1171 +\fB\&.sh.name\fR
     1172 +.ad
     1173 +.RS 19n
1137 1174  Set to the name of the variable at the time that a discipline function is
1138 1175  invoked.
1139 1176  .RE
1140 1177  
1141 1178  .sp
1142 1179  .ne 2
1143 1180  .na
1144      -\fB\fB\&.sh.subscript\fR\fR
     1181 +\fB\&.sh.subscript\fR
1145 1182  .ad
1146 1183  .RS 19n
1147 1184  Set to the name subscript of the variable at the time that a discipline
1148 1185  function is invoked.
1149 1186  .RE
1150 1187  
1151 1188  .sp
1152 1189  .ne 2
1153 1190  .na
1154      -\fB\fB\&.sh.subshell\fR\fR
     1191 +\fB\&.sh.subshell\fR
1155 1192  .ad
1156 1193  .RS 19n
1157 1194  The current depth for sub-shells and command substitution.
1158 1195  .RE
1159 1196  
1160 1197  .sp
1161 1198  .ne 2
1162 1199  .na
1163      -\fB\fB\&.sh.value\fR\fR
     1200 +\fB\&.sh.value\fR
1164 1201  .ad
1165 1202  .RS 19n
1166 1203  Set to the value of the variable at the time that the set or append discipline
1167      -function is invoked.
     1204 +function is invoked. When a user-defined arithmetic function is invoked, the
     1205 +value of \fB.sh.value\fR is saved and \fB.sh.value\fR is set to long double
     1206 +precision floating point. \fB.sh.value\fR is restored when the function
     1207 +returns.
1168 1208  .RE
1169 1209  
1170 1210  .sp
1171 1211  .ne 2
1172 1212  .na
1173      -\fB\fB\&.sh.version\fR\fR
     1213 +\fB\&.sh.version\fR
1174 1214  .ad
1175 1215  .RS 19n
1176 1216  Set to a value that identifies the version of this shell.
1177 1217  .RE
1178 1218  
1179 1219  .sp
1180 1220  .ne 2
1181 1221  .na
1182      -\fB\fBLINENO\fR\fR
     1222 +\fBLINENO\fR
1183 1223  .ad
1184 1224  .RS 19n
1185 1225  The current line number within the script or function being executed.
1186 1226  .RE
1187 1227  
1188 1228  .sp
1189 1229  .ne 2
1190 1230  .na
1191      -\fB\fBOLDPWD\fR\fR
     1231 +\fBOLDPWD\fR
1192 1232  .ad
1193 1233  .RS 19n
1194 1234  The previous working directory set by the \fBcd\fR command.
1195 1235  .RE
1196 1236  
1197 1237  .sp
1198 1238  .ne 2
1199 1239  .na
1200      -\fB\fBOPTARG\fR\fR
     1240 +\fBOPTARG\fR
1201 1241  .ad
1202 1242  .RS 19n
1203 1243  The value of the last option argument processed by the \fBgetopts\fR built-in
1204 1244  command.
1205 1245  .RE
1206 1246  
1207 1247  .sp
1208 1248  .ne 2
1209 1249  .na
1210      -\fB\fBOPTIND\fR\fR
     1250 +\fBOPTIND\fR
1211 1251  .ad
1212 1252  .RS 19n
1213 1253  The index of the last option argument processed by the \fBgetopts\fR built-in
1214 1254  command.
1215 1255  .RE
1216 1256  
1217 1257  .sp
1218 1258  .ne 2
1219 1259  .na
1220      -\fB\fBPPID\fR\fR
     1260 +\fBPPID\fR
1221 1261  .ad
1222 1262  .RS 19n
1223 1263  The process number of the parent of the shell.
1224 1264  .RE
1225 1265  
1226 1266  .sp
1227 1267  .ne 2
1228 1268  .na
1229      -\fB\fBPWD\fR\fR
     1269 +\fBPWD\fR
1230 1270  .ad
1231 1271  .RS 19n
1232 1272  The present working directory set by the \fBcd\fR command.
1233 1273  .RE
1234 1274  
1235 1275  .sp
1236 1276  .ne 2
1237 1277  .na
1238      -\fB\fBRANDOM\fR\fR
     1278 +\fBRANDOM\fR
1239 1279  .ad
1240 1280  .RS 19n
1241 1281  Each time this variable is referenced, a random integer, uniformly distributed
1242 1282  between \fB0\fR and \fB32767\fR, is generated. The sequence of random numbers
1243 1283  can be initialized by assigning a numeric value to \fBRANDOM\fR.
1244 1284  .RE
1245 1285  
1246 1286  .sp
1247 1287  .ne 2
1248 1288  .na
1249      -\fB\fBREPLY\fR\fR
     1289 +\fBREPLY\fR
1250 1290  .ad
1251 1291  .RS 19n
1252 1292  This variable is set by the \fBselect\fR statement and by the \fBread\fR
1253 1293  built-in command when no arguments are supplied.
1254 1294  .RE
1255 1295  
1256 1296  .sp
1257 1297  .ne 2
1258 1298  .na
1259      -\fB\fBSECONDS\fR\fR
     1299 +\fBSECONDS\fR
1260 1300  .ad
1261 1301  .RS 19n
1262 1302  Each time this variable is referenced, the number of seconds since shell
1263 1303  invocation is returned. If this variable is assigned a value, then the value
1264 1304  returned upon reference is the value that was assigned plus the number of
1265 1305  seconds since the assignment.
1266 1306  .RE
1267 1307  
1268 1308  .sp
     1309 +.ne 2
     1310 +.na
     1311 +\fBSHLVL\fR
     1312 +.ad
     1313 +.RS 19n
     1314 +An integer variable the is incremented each time the shell is invoked and is
     1315 +exported.  If \fBSHLVL\fR is not in the environment when the shell is invoked,
     1316 +it is set to 1.
     1317 +.RE
     1318 +
     1319 +.sp
1269 1320  .LP
1270 1321  The following variables are used by the shell:
1271 1322  .sp
1272 1323  .ne 2
1273 1324  .na
1274      -\fB\fBCDPATH\fR\fR
     1325 +\fBCDPATH\fR
1275 1326  .ad
1276 1327  .RS 14n
1277 1328  Defines the search path for the \fBcd\fR command.
1278 1329  .RE
1279 1330  
1280 1331  .sp
1281 1332  .ne 2
1282 1333  .na
1283      -\fB\fBCOLUMNS\fR\fR
     1334 +\fBCOLUMNS\fR
1284 1335  .ad
1285 1336  .RS 14n
1286 1337  Defines the width of the edit window for the shell edit modes and for printing
1287 1338  select lists.
1288 1339  .RE
1289 1340  
1290 1341  .sp
1291 1342  .ne 2
1292 1343  .na
1293      -\fB\fBEDITOR\fR\fR
     1344 +\fBEDITOR\fR
1294 1345  .ad
1295 1346  .RS 14n
1296 1347  If the \fBVISUAL\fR variable is not set, the value of this variable is checked
1297 1348  for the patterns as described with \fBVISUAL\fR and the corresponding editing
1298 1349  option is turned on.
1299 1350  .sp
1300 1351  See the \fBset\fR command in the \fBSpecial Command\fR section of this manual
1301 1352  page.
1302 1353  .RE
1303 1354  
1304 1355  .sp
1305 1356  .ne 2
1306 1357  .na
1307      -\fB\fBENV\fR\fR
     1358 +\fBENV\fR
1308 1359  .ad
1309 1360  .RS 14n
1310 1361  Performs parameter expansion, command substitution, and arithmetic substitution
1311 1362  on the value to generate the pathname of the script that is executed when the
1312 1363  shell is invoked. This file is typically used for alias and function
1313 1364  definitions. The default value is \fB$HOME/.kshrc\fR.
1314 1365  .sp
1315 1366  See the \fBInvocation\fR section of this manual page.
1316 1367  .sp
1317 1368  \fBENV\fR is not set by the shell.
1318 1369  .RE
1319 1370  
1320 1371  .sp
1321 1372  .ne 2
1322 1373  .na
1323      -\fB\fBFCEDIT\fR\fR
     1374 +\fBFCEDIT\fR
1324 1375  .ad
1325 1376  .RS 14n
1326 1377  Obsolete name for the default editor name for the \fBhist\fR command.
1327 1378  \fBFCEDIT\fR is not used when \fBHISTEDIT\fR is set.
1328 1379  .sp
1329 1380  The shell specifies a default value to \fBFCEDIT\fR.
1330 1381  .RE
1331 1382  
1332 1383  .sp
1333 1384  .ne 2
1334 1385  .na
1335      -\fB\fBFIGNORE\fR\fR
     1386 +\fBFIGNORE\fR
1336 1387  .ad
1337 1388  .RS 14n
1338 1389  A pattern that defines the set of file names that is ignored when performing
1339 1390  file name matching.
1340 1391  .RE
1341 1392  
1342 1393  .sp
1343 1394  .ne 2
1344 1395  .na
1345      -\fB\fBFPATH\fR\fR
     1396 +\fBFPATH\fR
1346 1397  .ad
1347 1398  .RS 14n
1348 1399  The search path for function definitions. The directories in this path are
1349 1400  searched for a file with the same name as the function or command when a
1350 1401  function with the \fB-u\fR attribute is referenced and when a command is not
1351 1402  found. If an executable file with the name of that command is found, then it is
1352 1403  read and executed in the current environment. Unlike \fBPATH\fR, the current
1353 1404  directory must be represented explicitly by dot (\fB\&.\fR) rather than by
1354 1405  adjacent colon (\fB:\fR) characters or a beginning or ending colon (\fB:\fR).
1355 1406  .RE
1356 1407  
1357 1408  .sp
1358 1409  .ne 2
1359 1410  .na
1360      -\fB\fBHISTCMD\fR\fR
     1411 +\fBHISTCMD\fR
1361 1412  .ad
1362 1413  .RS 14n
1363 1414  The number of the current command in the history file.
1364 1415  .RE
1365 1416  
1366 1417  .sp
1367 1418  .ne 2
1368 1419  .na
1369      -\fB\fBHISTEDIT\fR\fR
     1420 +\fBHISTEDIT\fR
1370 1421  .ad
1371 1422  .RS 14n
1372 1423  The name for the default editor name for the \fBhist\fR command.
1373 1424  .RE
1374 1425  
1375 1426  .sp
1376 1427  .ne 2
1377 1428  .na
1378      -\fB\fBHISTFILE\fR\fR
     1429 +\fBHISTFILE\fR
1379 1430  .ad
1380 1431  .RS 14n
1381 1432  If this variable is set when the shell is invoked, the value is the pathname of
1382 1433  the file that is used to store the command history. See the \fBCommand
1383 1434  Re-entry\fR section of this manual page.
1384 1435  .RE
1385 1436  
1386 1437  .sp
1387 1438  .ne 2
1388 1439  .na
1389      -\fB\fBHISTSIZE\fR\fR
     1440 +\fBHISTSIZE\fR
1390 1441  .ad
1391 1442  .RS 14n
1392 1443  If this variable is set when the shell is invoked, then the number of
1393 1444  previously entered commands that are accessible by this shell is greater than
1394 1445  or equal to this number. The default is \fB512\fR.
1395 1446  .RE
1396 1447  
1397 1448  .sp
1398 1449  .ne 2
1399 1450  .na
1400      -\fB\fBHOME\fR\fR
     1451 +\fBHOME\fR
1401 1452  .ad
1402 1453  .RS 14n
1403 1454  The default argument (home directory) for the \fBcd\fR command.
1404 1455  .sp
1405 1456  \fBHOME\fR is not set by the shell. \fBHOME\fR is set by \fBlogin\fR(1).
1406 1457  .RE
1407 1458  
1408 1459  .sp
1409 1460  .ne 2
1410 1461  .na
1411      -\fB\fBIFS\fR\fR
     1462 +\fBIFS\fR
1412 1463  .ad
1413 1464  .RS 14n
1414 1465  Internal field separators, normally SPACE, TAB, and NEWLINE that are used to
1415 1466  separate the results of command substitution or parameter expansion and to
1416 1467  separate fields with the built-in command read. The first character of the
1417 1468  \fBIFS\fR variable is used to separate arguments for the \fB"$*"\fR
1418 1469  substitution. See the \fBQuoting\fR section of this manual page.
1419 1470  .sp
1420 1471  Each single occurrence of an \fBIFS\fR character in the string to be split,
1421 1472  that is not in the \fBissspace\fR character class, and any adjacent characters
↓ open down ↓ 3 lines elided ↑ open up ↑
1425 1476  appears consecutively inside \fBIFS\fR, this character is treated as if it were
1426 1477  not in the \fBissspace\fR class, so that if \fBIFS\fR consists of two tab
1427 1478  characters, then two adjacent tab characters delimit a null field.
1428 1479  .sp
1429 1480  The shell specifies a default value to \fBIFS\fR.
1430 1481  .RE
1431 1482  
1432 1483  .sp
1433 1484  .ne 2
1434 1485  .na
1435      -\fB\fBLANG\fR\fR
     1486 +\fBJOBMAX\fR
1436 1487  .ad
1437 1488  .RS 14n
     1489 +This variable defines the maximum number running background jobs that can run
     1490 +at a time.  When this limit is reached, the shell will wait for a job to
     1491 +complete before staring a new job.
     1492 +.RE
     1493 +
     1494 +.sp
     1495 +.ne 2
     1496 +.na
     1497 +\fBLANG\fR
     1498 +.ad
     1499 +.RS 14n
1438 1500  This variable determines the locale category for any category not specifically
1439 1501  selected with a variable starting with \fBLC_\fR or \fBLANG\fR.
1440 1502  .RE
1441 1503  
1442 1504  .sp
1443 1505  .ne 2
1444 1506  .na
1445      -\fB\fBLC_ALL\fR\fR
     1507 +\fBLC_ALL\fR
1446 1508  .ad
1447 1509  .RS 14n
1448 1510  This variable overrides the value of the \fBLANG\fR variable and any other
1449 1511  \fBLC_\fR variable.
1450 1512  .RE
1451 1513  
1452 1514  .sp
1453 1515  .ne 2
1454 1516  .na
1455      -\fB\fBLC_COLLATE\fR\fR
     1517 +\fBLC_COLLATE\fR
1456 1518  .ad
1457 1519  .RS 14n
1458 1520  This variable determines the locale category for character collation
1459 1521  information.
1460 1522  .RE
1461 1523  
1462 1524  .sp
1463 1525  .ne 2
1464 1526  .na
1465      -\fB\fBLC_CTYPE\fR\fR
     1527 +\fBLC_CTYPE\fR
1466 1528  .ad
1467 1529  .RS 14n
1468 1530  This variable determines the locale category for character handling functions.
1469 1531  It determines the character classes for pattern matching. See the \fBFile Name
1470 1532  Generation\fR section of this manual page.
1471 1533  .RE
1472 1534  
1473 1535  .sp
1474 1536  .ne 2
1475 1537  .na
1476      -\fB\fBLC_NUMERIC\fR\fR
     1538 +\fBLC_NUMERIC\fR
1477 1539  .ad
1478 1540  .RS 14n
1479 1541  This variable determines the locale category for the decimal point character.
1480 1542  .RE
1481 1543  
1482 1544  .sp
1483 1545  .ne 2
1484 1546  .na
1485      -\fB\fBLINES\fR\fR
     1547 +\fBLINES\fR
1486 1548  .ad
1487 1549  .RS 14n
1488 1550  If this variable is set, the value is used to determine the column length for
1489 1551  printing select lists. Select lists prints vertically until about two-thirds of
1490 1552  \fBLINES\fR lines are filled.
1491 1553  .RE
1492 1554  
1493 1555  .sp
1494 1556  .ne 2
1495 1557  .na
1496      -\fB\fBMAIL\fR\fR
     1558 +\fBMAIL\fR
1497 1559  .ad
1498 1560  .RS 14n
1499 1561  If this variable is set to the name of a mail file \fBand\fR the \fBMAILPATH\fR
1500 1562  variable is not set, then the shell informs the user of arrival of mail in the
1501 1563  specified file.
1502 1564  .sp
1503 1565  \fBMAIL\fR is not set by the shell. On some systems, \fBMAIL\fR is set by
1504 1566  \fBlogin\fR(1).
1505 1567  .RE
1506 1568  
1507 1569  .sp
1508 1570  .ne 2
1509 1571  .na
1510      -\fB\fBMAILCHECK\fR\fR
     1572 +\fBMAILCHECK\fR
1511 1573  .ad
1512 1574  .RS 14n
1513 1575  Specifies how often in seconds the shell checks for changes in the modification
1514 1576  time of any of the files specified by the \fBMAILPATH\fR or \fBMAIL\fR
1515 1577  variables. The default value is \fB600\fR seconds. When the time has elapsed
1516 1578  the shell checks before issuing the next prompt.
1517 1579  .sp
1518 1580  The shell specifies a default value to \fBMAILCHECK\fR.
1519 1581  .RE
1520 1582  
1521 1583  .sp
1522 1584  .ne 2
1523 1585  .na
1524      -\fB\fBMAILPATH\fR\fR
     1586 +\fBMAILPATH\fR
1525 1587  .ad
1526 1588  .RS 14n
1527 1589  A colon ( \fB:\fR ) separated list of file names. If this variable is set, then
1528 1590  the shell informs the user of any modifications to the specified files that
1529 1591  have occurred within the last \fBMAILCHECK\fR seconds. Each file name can be
1530 1592  followed by a \fB?\fR and a message that is printed. The message undergoes
1531 1593  parameter expansion, command substitution, and arithmetic substitution with the
1532 1594  variable \fB$_\fR defined as the name of the file that has changed. The default
1533 1595  message is \fByou have mail in $_\fR.
1534 1596  .RE
1535 1597  
1536 1598  .sp
1537 1599  .ne 2
1538 1600  .na
1539      -\fB\fBPATH\fR\fR
     1601 +\fBPATH\fR
1540 1602  .ad
1541 1603  .RS 14n
1542 1604  The search path for commands. Except in \fB\&.profile\fR, users cannot change
1543 1605  \fBPATH\fR if executing under \fBrksh93\fR. See the \fBExecution\fR section of
1544 1606  this manual page.
1545 1607  .sp
1546 1608  The shell specifies a default value to \fBPATH\fR.
1547 1609  .RE
1548 1610  
1549 1611  .sp
1550 1612  .ne 2
1551 1613  .na
1552      -\fB\fBPS1\fR\fR
     1614 +\fBPS1\fR
1553 1615  .ad
1554 1616  .RS 14n
1555 1617  The value of this variable is expanded for parameter expansion, command
1556 1618  substitution, and arithmetic substitution to define the primary prompt string
1557 1619  which by default is \fB$\fR. The character \fB!\fR in the primary prompt string
1558 1620  is replaced by the command number. Two successive occurrences of \fB!\fR
1559 1621  produces a single \fB!\fR when the prompt string is printed. See the \fBCommand
1560 1622  Re-entry\fR section of this manual page.
1561 1623  .sp
1562 1624  The shell specifies a default value to \fBPS1\fR.
1563 1625  .RE
1564 1626  
1565 1627  .sp
1566 1628  .ne 2
1567 1629  .na
1568      -\fB\fBPS2\fR\fR
     1630 +\fBPS2\fR
1569 1631  .ad
1570 1632  .RS 14n
1571 1633  Secondary prompt string, by default, \fB>\fR.
1572 1634  .sp
1573 1635  The shell specifies a default value to \fBPS2\fR.
1574 1636  .RE
1575 1637  
1576 1638  .sp
1577 1639  .ne 2
1578 1640  .na
1579      -\fB\fBPS3\fR\fR
     1641 +\fBPS3\fR
1580 1642  .ad
1581 1643  .RS 14n
1582 1644  Selection prompt string used within a select loop, by default \fB#?\fR.
1583 1645  .sp
1584 1646  The shell specifies a default value to \fBPS3\fR.
1585 1647  .RE
1586 1648  
1587 1649  .sp
1588 1650  .ne 2
1589 1651  .na
1590      -\fB\fBPS4\fR\fR
     1652 +\fBPS4\fR
1591 1653  .ad
1592 1654  .RS 14n
1593 1655  The value of this variable is expanded for parameter evaluation, command
1594 1656  substitution, and arithmetic substitution and precedes each line of an
1595 1657  execution trace. By default, \fBPS4\fR is \fB+\fR. When \fBPS4\fR is unset, the
1596 1658  execution trace prompt is also \fB+\fR .
1597 1659  .sp
1598 1660  The shell specifies a default value to \fBPS4\fR.
1599 1661  .RE
1600 1662  
1601 1663  .sp
1602 1664  .ne 2
1603 1665  .na
1604      -\fB\fBSHELL\fR\fR
     1666 +\fBSHELL\fR
1605 1667  .ad
1606 1668  .RS 14n
1607 1669  The pathname of the shell is kept in the environment. At invocation, if the
1608 1670  basename of this variable is \fBrsh\fR, \fBrksh\fR, \fBrksh93\fR, or
1609 1671  \fBkrsh\fR, the shell becomes restricted.
1610 1672  .sp
1611 1673  \fBSHELL\fR is not set by the shell. On some systems, \fBSHELL\fR is set by
1612 1674  \fBlogin\fR(1).
1613 1675  .RE
1614 1676  
1615 1677  .sp
1616 1678  .ne 2
1617 1679  .na
1618      -\fB\fBTIMEFORMAT\fR\fR
     1680 +\fBTIMEFORMAT\fR
1619 1681  .ad
1620 1682  .RS 14n
1621 1683  The value of this parameter is used as a format string specifying how the
1622 1684  timing information for pipelines prefixed with the \fBtime\fR reserved word
1623 1685  should be displayed. The \fB%\fR character introduces a format sequence that is
1624 1686  expanded to a time value or other information.
1625 1687  .sp
1626 1688  The format sequences and their meanings are as follows.
1627 1689  .sp
1628 1690  .ne 2
1629 1691  .na
1630      -\fB\fB%%\fR\fR
     1692 +\fB%%\fR
1631 1693  .ad
1632 1694  .sp .6
1633 1695  .RS 4n
1634 1696  A literal \fB%\fR.
1635 1697  .RE
1636 1698  
1637 1699  .sp
1638 1700  .ne 2
1639 1701  .na
1640      -\fB\fB%[\fIp\fR][l]R\fR\fR
     1702 +\fB%[\fIp\fR][l]R\fR
1641 1703  .ad
1642 1704  .sp .6
1643 1705  .RS 4n
1644 1706  The elapsed time in seconds.
1645 1707  .RE
1646 1708  
1647 1709  .sp
1648 1710  .ne 2
1649 1711  .na
1650      -\fB\fB%[\fIp\fR][l]U\fR\fR
     1712 +\fB%[\fIp\fR][l]U\fR
1651 1713  .ad
1652 1714  .sp .6
1653 1715  .RS 4n
1654 1716  The number of CPU seconds spent in user mode.
1655 1717  .RE
1656 1718  
1657 1719  .sp
1658 1720  .ne 2
1659 1721  .na
1660      -\fB\fB%[\fIp\fR][l]S\fR\fR
     1722 +\fB%[\fIp\fR][l]S\fR
1661 1723  .ad
1662 1724  .sp .6
1663 1725  .RS 4n
1664 1726  The number of CPU seconds spent in system mode.
1665 1727  .RE
1666 1728  
1667 1729  .sp
1668 1730  .ne 2
1669 1731  .na
1670      -\fB\fB%P\fR\fR
     1732 +\fB%P\fR
1671 1733  .ad
1672 1734  .sp .6
1673 1735  .RS 4n
1674 1736  The CPU percentage, computed as \fB(U + S) / R\fR.
1675 1737  .RE
1676 1738  
1677 1739  The braces denote optional portions. The optional \fIp\fR is a digit specifying
1678 1740  the \fIprecision\fR, the number of fractional digits after a decimal point. A
1679 1741  value of \fB0\fR causes no decimal point or fraction to be output. At most
1680 1742  three places after the decimal point can be displayed. Values of \fIp\fR
↓ open down ↓ 5 lines elided ↑ open up ↑
1686 1748  determines whether or not the fraction is included.
1687 1749  .sp
1688 1750  All other characters are output without change and a trailing NEWLINE is added.
1689 1751  If unset, the default value, \fB$'\enreal\et%2lR\enuser\et%2lU\ensys%2lS'\fR,
1690 1752  is used. If the value is null, no timing information is displayed.
1691 1753  .RE
1692 1754  
1693 1755  .sp
1694 1756  .ne 2
1695 1757  .na
1696      -\fB\fBTMOUT\fR\fR
     1758 +\fBTMOUT\fR
1697 1759  .ad
1698 1760  .RS 14n
1699 1761  If set to a value greater than zero, \fBTMOUT\fR is the default time-out value
1700 1762  for the \fBread\fR built-in command. The \fBselect\fR compound command
1701 1763  terminates after \fBTMOUT\fR seconds when input is from a terminal. Otherwise,
1702 1764  the shell terminates if a line is not entered within the prescribed number of
1703 1765  seconds while reading from a terminal. The shell can be compiled with a maximum
1704 1766  bound for this value which cannot be exceeded.
1705 1767  .sp
1706 1768  The shell specifies a default value to \fBTMOUT\fR.
1707 1769  .RE
1708 1770  
1709 1771  .sp
1710 1772  .ne 2
1711 1773  .na
1712      -\fB\fBVISUAL\fR\fR
     1774 +\fBVISUAL\fR
1713 1775  .ad
1714 1776  .RS 14n
1715 1777  If the value of this variable matches the pattern \fB*[Vv][Ii]*\fR, then the
1716 1778  \fBvi\fR option is turned on. See \fBSpecial Commands\fR. If the value matches
1717 1779  the pattern \fB*gmacs*\fR , the \fBgmacs\fR option is turned on. If the value
1718 1780  matches the pattern \fB*macs*\fR, then the \fBemacs\fR option is turned on. The
1719 1781  value of \fBVISUAL\fR overrides the value of \fBEDITOR\fR.
1720 1782  .RE
1721 1783  
1722 1784  .SS "Field Splitting"
1723      -.LP
1724 1785  After parameter expansion and command substitution, the results of
1725 1786  substitutions are scanned for the field separator characters (those found in
1726 1787  \fBIFS\fR) and split into distinct fields where such characters are found.
1727 1788  Explicit null fields (\fB""\fR or \fB\&''\fR) are retained. Implicit null
1728 1789  fields, those resulting from parameters that have no values or command
1729 1790  substitutions with no output, are removed.
1730 1791  .sp
1731 1792  .LP
1732 1793  If the \fBbraceexpand\fR (\fB-B\fR) option is set, each of the fields resulting
1733 1794  from \fBIFS\fR are checked to see if they contain one or more of the brace
↓ open down ↓ 25 lines elided ↑ open up ↑
1759 1820  .LP
1760 1821  In the remaining forms, a field is created for each number starting at
1761 1822  \fIn1\fR. This continues until it reaches \fIn2\fR and increments \fIn1\fR by
1762 1823  \fIn3\fR. The cases where \fIn3\fR is not specified behave as if \fIn3\fR were
1763 1824  1 if \fIn1\fR\fB<=\fR\fIn2\fR, and \fB-1\fR otherwise. In forms which specify
1764 1825  \fB%\fR\fIfmt\fR, any format flags, widths and precisions can be specified and
1765 1826  \fIfmt\fR can end in any of the specifiers \fBcdiouxX\fR. For example,
1766 1827  \fB{a,z}{1..5..3%02d}{b..c}x\fR expands to the 8 fields, \fBa01bx, a01cx,
1767 1828  a04bx, a04cx, z01bx, z01cx, z04bx,\fR and \fBz04cx\fR.
1768 1829  .SS "File Name Generation"
1769      -.LP
1770 1830  Following splitting, each field is scanned for the characters \fB*\fR, \fB?\fR,
1771 1831  \fB(\fR, and \fB[\fR, unless the \fB-f\fR option has been set. If one of these
1772 1832  characters appears, then the word is regarded as a pattern.
1773 1833  .sp
1774 1834  .LP
1775 1835  Each file name component that contains any pattern character is replaced with a
1776 1836  lexicographically sorted set of names that matches the pattern from that
1777 1837  directory. If no file name is found that matches the pattern, then that
1778 1838  component of the file name is left unchanged unless the pattern is prefixed
1779 1839  with \fB~(N)\fR in which case it is removed. If \fBFIGNORE\fR is set, then each
1780 1840  file name component that matches the pattern defined by the value of
1781 1841  \fBFIGNORE\fR is ignored when generating the matching file names. The names
1782 1842  \fB\&.\fR and \fB\&..\fR are also ignored. If \fBFIGNORE\fR is not set, the
1783 1843  character \fB\&.\fR at the start of each file name component is ignored unless
1784 1844  the first character of the pattern corresponding to this component is the
1785 1845  character \fB\&.\fR itself. For other uses of pattern matching the \fB/\fR and
1786 1846  \fB\&.\fR are not specially treated.
1787 1847  .sp
1788 1848  .ne 2
1789 1849  .na
1790      -\fB\fB*\fR\fR
     1850 +\fB*\fR
1791 1851  .ad
1792 1852  .RS 11n
1793 1853  Match any string, including the null string. When used for file name expansion,
1794 1854  if the \fBglobstar\fR option is on, two adjacent \fB*\fRs by themselves match
1795 1855  all files and zero or more directories and subdirectories. If the two adjacent
1796 1856  \fB*\fRs are followed by a \fB/\fR, only directories and subdirectories match.
1797 1857  .RE
1798 1858  
1799 1859  .sp
1800 1860  .ne 2
1801 1861  .na
1802      -\fB\fB?\fR\fR
     1862 +\fB?\fR
1803 1863  .ad
1804 1864  .RS 11n
1805 1865  Matches any single character.
1806 1866  .RE
1807 1867  
1808 1868  .sp
1809 1869  .ne 2
1810 1870  .na
1811 1871  \fB[\fB\&...\fR]\fR
1812 1872  .ad
1813 1873  .RS 11n
1814 1874  Match any one of the enclosed characters. A pair of characters separated by
1815 1875  \fB-\fR matches any character lexically between the pair, inclusive. If the
1816      -first character following the opening \fB[\fR is a \fB!\fR, any character not
1817      -enclosed is matched. A \fB-\fR can be included in the character set by putting
1818      -it as the first or last character. Within \fB[\fR and \fB]\fR, character
1819      -classes can be specified with the syntax \fB[:\fR\fIclass\fR\fB:]\fR where
1820      -\fIclass\fR is one of the following classes defined in the \fBANSI-C\fR
     1876 +first character following the opening \fB[\fR is a \fB!\fR or \fB^\fR, any
     1877 +character not enclosed is matched. A \fB-\fR can be included in the character
     1878 +set by putting it as the first or last character. Within \fB[\fR and \fB]\fR,
     1879 +character classes can be specified with the syntax \fB[:\fR\fIclass\fR\fB:]\fR
     1880 +where \fIclass\fR is one of the following classes defined in the \fBANSI-C\fR
1821 1881  standard:
1822 1882  .sp
1823 1883  .in +2
1824 1884  .nf
1825 1885  \fIalnum alpha blank cntrl digit graph
1826 1886  lower print punct space upper
1827 1887  word xdigit\fR
1828 1888  .fi
1829 1889  .in -2
1830 1890  .sp
↓ open down ↓ 8 lines elided ↑ open up ↑
1839 1899  
1840 1900  .sp
1841 1901  .LP
1842 1902  A \fIpattern-list\fR is a list of one or more patterns separated from each
1843 1903  other with an \fB&\fR or \fB|\fR. An \fB&\fR signifies that all patterns must
1844 1904  be matched whereas \fB|\fR requires that only one pattern be matched. Composite
1845 1905  patterns can be formed with one or more of the following sub-patterns:
1846 1906  .sp
1847 1907  .ne 2
1848 1908  .na
1849      -\fB\fB?(\fR\fIpattern-list\fR\fB)\fR\fR
     1909 +\fB?(\fR\fIpattern-list\fR\fB)\fR
1850 1910  .ad
1851 1911  .RS 22n
1852 1912  Optionally matches any one of the specified patterns.
1853 1913  .RE
1854 1914  
1855 1915  .sp
1856 1916  .ne 2
1857 1917  .na
1858      -\fB\fB*(\fR\fIpattern-list\fR\fB)\fR\fR
     1918 +\fB*(\fR\fIpattern-list\fR\fB)\fR
1859 1919  .ad
1860 1920  .RS 22n
1861 1921  Matches zero or more occurrences of the specified patterns.
1862 1922  .RE
1863 1923  
1864 1924  .sp
1865 1925  .ne 2
1866 1926  .na
1867      -\fB\fB+(\fR\fIpattern-list\fR\fB)\fR\fR
     1927 +\fB+(\fR\fIpattern-list\fR\fB)\fR
1868 1928  .ad
1869 1929  .RS 22n
1870 1930  Matches one or more occurrences of the specified patterns.
1871 1931  .RE
1872 1932  
1873 1933  .sp
1874 1934  .ne 2
1875 1935  .na
1876      -\fB\fB{\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR\fR
     1936 +\fB{\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR
1877 1937  .ad
1878 1938  .RS 22n
1879 1939  Matches \fIn\fR occurrences of the specified patterns.
1880 1940  .RE
1881 1941  
1882 1942  .sp
1883 1943  .ne 2
1884 1944  .na
1885      -\fB\fB{\fR\fIm\fR\fB,\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR\fR
     1945 +\fB{\fR\fIm\fR\fB,\fR\fIn\fR\fB(\fR\fIpattern-list\fR\fB)\fR
1886 1946  .ad
1887 1947  .RS 22n
1888 1948  Matches from \fIm\fR to \fIn\fR occurrences of the specified patterns. If
1889 1949  \fIm\fR is omitted, \fB0\fR is used. If \fIn\fR is omitted at least \fIm\fR
1890 1950  occurrences are matched.
1891 1951  .RE
1892 1952  
1893 1953  .sp
1894 1954  .ne 2
1895 1955  .na
1896      -\fB\fB@(\fR\fIpattern-list\fR\fB)\fR\fR
     1956 +\fB@(\fR\fIpattern-list\fR\fB)\fR
1897 1957  .ad
1898 1958  .RS 22n
1899 1959  Matches exactly one of the specified patterns.
1900 1960  .RE
1901 1961  
1902 1962  .sp
1903 1963  .ne 2
1904 1964  .na
1905      -\fB\fB!(\fR\fIpattern-list\fR\fB)\fR\fR
     1965 +\fB!(\fR\fIpattern-list\fR\fB)\fR
1906 1966  .ad
1907 1967  .RS 22n
1908 1968  Matches anything except one of the specified patterns.
1909 1969  .RE
1910 1970  
1911 1971  .sp
1912 1972  .LP
1913 1973  By default, each pattern, or sub-pattern matches the longest string possible
1914 1974  consistent with generating the longest overall match. If more than one match is
1915 1975  possible, the one starting closest to the beginning of the string is chosen.
↓ open down ↓ 2 lines elided ↑ open up ↑
1918 1978  to be used.
1919 1979  .sp
1920 1980  .LP
1921 1981  When \fIpattern-list\fR is contained within parentheses, the backslash
1922 1982  character \fB\e\fR is treated specially even when inside a character class. All
1923 1983  \fBANSI-C\fR character escapes are recognized and match the specified
1924 1984  character. In addition the following escape sequences are recognized:
1925 1985  .sp
1926 1986  .ne 2
1927 1987  .na
1928      -\fB\fB\ed\fR\fR
     1988 +\fB\ed\fR
1929 1989  .ad
1930 1990  .RS 7n
1931 1991  Matches any character in the digit class.
1932 1992  .RE
1933 1993  
1934 1994  .sp
1935 1995  .ne 2
1936 1996  .na
1937      -\fB\fB\eD\fR\fR
     1997 +\fB\eD\fR
1938 1998  .ad
1939 1999  .RS 7n
1940 2000  Matches any character not in the digit class.
1941 2001  .RE
1942 2002  
1943 2003  .sp
1944 2004  .ne 2
1945 2005  .na
1946      -\fB\fB\es\fR\fR
     2006 +\fB\es\fR
1947 2007  .ad
1948 2008  .RS 7n
1949 2009  Matches any character in the space class.
1950 2010  .RE
1951 2011  
1952 2012  .sp
1953 2013  .ne 2
1954 2014  .na
1955      -\fB\fB\eS\fR\fR
     2015 +\fB\eS\fR
1956 2016  .ad
1957 2017  .RS 7n
1958 2018  Matches any character not in the space class.
1959 2019  .RE
1960 2020  
1961 2021  .sp
1962 2022  .ne 2
1963 2023  .na
1964      -\fB\fB\ew\fR\fR
     2024 +\fB\ew\fR
1965 2025  .ad
1966 2026  .RS 7n
1967 2027  Matches any character in the word class.
1968 2028  .RE
1969 2029  
1970 2030  .sp
1971 2031  .ne 2
1972 2032  .na
1973      -\fB\fB\eW\fR\fR
     2033 +\fB\eW\fR
1974 2034  .ad
1975 2035  .RS 7n
1976 2036  Matches any character not in the word class.
1977 2037  .RE
1978 2038  
1979 2039  .sp
1980 2040  .LP
1981 2041  A pattern of the form \fB%(\fR\fIpattern-pairs\fR\fB)\fR is a sub-pattern that
1982 2042  can be used to match nested character expressions. Each \fIpattern-pair\fR is a
1983 2043  two character sequence which cannot contain \fB&\fR or \fB|\fR. The first
1984 2044  \fIpattern-pair\fR specifies the starting and ending characters for the match.
1985 2045  Each subsequent \fIpattern-pair\fR represents the beginning and ending
1986 2046  characters of a nested group that is skipped over when counting starting and
1987 2047  ending character matches. The behavior is unspecified when the first character
1988 2048  of a \fIpattern-pair\fR is alphanumeric except for the following:
1989 2049  .sp
1990 2050  .ne 2
1991 2051  .na
1992      -\fB\fBD\fR\fR
     2052 +\fBD\fR
1993 2053  .ad
1994 2054  .RS 5n
1995 2055  Causes the ending character to terminate the search for this pattern without
1996 2056  finding a match.
1997 2057  .RE
1998 2058  
1999 2059  .sp
2000 2060  .ne 2
2001 2061  .na
2002      -\fB\fBE\fR\fR
     2062 +\fBE\fR
2003 2063  .ad
2004 2064  .RS 5n
2005 2065  Causes the ending character to be interpreted as an escape character.
2006 2066  .RE
2007 2067  
2008 2068  .sp
2009 2069  .ne 2
2010 2070  .na
2011      -\fB\fBL\fR\fR
     2071 +\fBL\fR
2012 2072  .ad
2013 2073  .RS 5n
2014 2074  Causes the ending character to be interpreted as a quote character causing all
2015 2075  characters to be ignored when looking for a match.
2016 2076  .RE
2017 2077  
2018 2078  .sp
2019 2079  .ne 2
2020 2080  .na
2021      -\fB\fBQ\fR\fR
     2081 +\fBQ\fR
2022 2082  .ad
2023 2083  .RS 5n
2024 2084  Causes the ending character to be interpreted as a quote character causing all
2025 2085  characters other than any escape character to be ignored when looking for a
2026 2086  match.
2027 2087  .RE
2028 2088  
2029 2089  .sp
2030 2090  .LP
2031 2091  \fB%({}Q"E\e)\fR, matches characters starting at \fB{\fR until the matching
↓ open down ↓ 5 lines elided ↑ open up ↑
2037 2097  Each sub-pattern in a composite pattern is numbered, starting at \fB1\fR, by
2038 2098  the location of the \fB(\fR within the pattern. The sequence \fB\e\fR\fIn\fR,
2039 2099  where \fIn\fR is a single digit and \fB\e\fR\fIn\fR comes after the \fIn\fRth.
2040 2100  sub-pattern, matches the same string as the sub-pattern itself.
2041 2101  .sp
2042 2102  .LP
2043 2103  A pattern can contain sub-patterns of the form
2044 2104  \fB~(\fR\fIoptions\fR\fB:\fR\fIpattern-list\fR\fB)\fR, where either
2045 2105  \fIoptions\fR or \fB:\fR\fIpattern-list\fR can be omitted. Unlike the other
2046 2106  compound patterns, these sub-patterns are not counted in the numbered
2047      -sub-patterns. If \fIoptions\fR is present, it can consist of one or more of the
     2107 +sub-patterns. \fB:\fR\fIpattern-list\fR must be omitted for options
     2108 +\fBF, G, N\fR and \fBV\fR below.
     2109 +If \fIoptions\fR is present, it can consist of one or more of the
2048 2110  following:
2049 2111  .sp
2050 2112  .ne 2
2051 2113  .na
2052      -\fB\fB+\fR\fR
     2114 +\fB+\fR
2053 2115  .ad
2054 2116  .RS 5n
2055 2117  Enable the following options. This is the default.
2056 2118  .RE
2057 2119  
2058 2120  .sp
2059 2121  .ne 2
2060 2122  .na
2061      -\fB\fB-\fR\fR
     2123 +\fB-\fR
2062 2124  .ad
2063 2125  .RS 5n
2064 2126  Disable the following options.
2065 2127  .RE
2066 2128  
2067 2129  .sp
2068 2130  .ne 2
2069 2131  .na
2070      -\fB\fBE\fR\fR
     2132 +\fBE\fR
2071 2133  .ad
2072 2134  .RS 5n
2073 2135  The remainder of the pattern uses extended regular expression syntax like the
2074 2136  \fBegrep\fR(1) command.
2075 2137  .RE
2076 2138  
2077 2139  .sp
2078 2140  .ne 2
2079 2141  .na
2080      -\fB\fBF\fR\fR
     2142 +\fBF\fR
2081 2143  .ad
2082 2144  .RS 5n
2083 2145  The remainder of the pattern uses \fBfgrep\fR(1) expression syntax.
2084 2146  .RE
2085 2147  
2086 2148  .sp
2087 2149  .ne 2
2088 2150  .na
2089      -\fB\fBg\fR\fR
     2151 +\fBg\fR
2090 2152  .ad
2091 2153  .RS 5n
2092 2154  File the longest match (greedy).
2093 2155  .sp
2094 2156  This is the default.
2095 2157  .RE
2096 2158  
2097 2159  .sp
2098 2160  .ne 2
2099 2161  .na
2100      -\fB\fBG\fR\fR
     2162 +\fBG\fR
2101 2163  .ad
2102 2164  .RS 5n
2103 2165  The remainder of the pattern uses basic regular expression syntax like the
2104 2166  \fBgrep\fR(1) command.
2105 2167  .RE
2106 2168  
2107 2169  .sp
2108 2170  .ne 2
2109 2171  .na
2110      -\fB\fBi\fR\fR
     2172 +\fBi\fR
2111 2173  .ad
2112 2174  .RS 5n
2113 2175  Treat the match as case insensitive.
2114 2176  .RE
2115 2177  
2116 2178  .sp
2117 2179  .ne 2
2118 2180  .na
2119      -\fB\fBK\fR\fR
     2181 +\fBK\fR
2120 2182  .ad
2121 2183  .RS 5n
2122 2184  The remainder of the pattern uses shell pattern syntax.
2123 2185  .sp
2124 2186  This is the default.
2125 2187  .RE
2126 2188  
2127 2189  .sp
2128 2190  .ne 2
2129 2191  .na
2130      -\fB\fBl\fR\fR
     2192 +\fBl\fR
2131 2193  .ad
2132 2194  .RS 5n
2133 2195  Left anchor the pattern.
2134 2196  .sp
2135 2197  This is the default for \fBK\fR style patterns.
2136 2198  .RE
2137 2199  
2138 2200  .sp
2139 2201  .ne 2
2140 2202  .na
2141      -\fB\fBN\fR\fR
     2203 +\fBN\fR
2142 2204  .ad
2143 2205  .RS 5n
2144 2206  This is ignored. However, when it is the first letter and is used with file
2145 2207  name generation, and no matches occur, the file pattern expands to the empty
2146 2208  string.
2147 2209  .RE
2148 2210  
2149 2211  .sp
2150 2212  .ne 2
2151 2213  .na
2152      -\fB\fBr\fR\fR
     2214 +\fBr\fR
2153 2215  .ad
2154 2216  .RS 5n
2155 2217  Right anchor the pattern.
2156 2218  .sp
2157 2219  This is the default for \fBK\fR style patterns.
2158 2220  .RE
2159 2221  
2160 2222  .sp
2161      -.LP
2162      -If both \fIoptions\fR and \fB:\fR\fIpattern-list\fR are specified, then the
2163      -options apply only to \fIpattern-list\fR. Otherwise, these options remain in
2164      -effect until they are disabled by a subsequent \fB~(...)\fR or at the end of
2165      -the sub-pattern containing \fB~(...)\fR.
2166      -.SS "Quoting"
2167      -.LP
2168      -Each of the metacharacters listed in the \fBDefinitions\fR has a special
2169      -meaning to the shell.
     2223 +.ne 2
     2224 +.na
     2225 +\fBX\fR
     2226 +.ad
     2227 +.RS 5n
     2228 +The remainder of the pattern uses augmented regular expression syntax.
     2229 +.RE
     2230 +
2170 2231  .sp
2171 2232  .ne 2
2172 2233  .na
2173      -\fB\fBg\fR\fR
     2234 +\fBP\fR
2174 2235  .ad
2175 2236  .RS 5n
2176      -File the longest match (greedy). This is the default.
     2237 +The remainder of the pattern uses \fIperl\fR(1) regular expression syntax. Not
     2238 +all perl regular expression syntax is currently implemented.
2177 2239  .RE
2178 2240  
2179 2241  .sp
2180 2242  .ne 2
2181 2243  .na
2182      -\fB\fBi\fR\fR
     2244 +\fBV\fR
2183 2245  .ad
2184 2246  .RS 5n
2185      -Treat the match as case insensitive.
     2247 +The remainder of the pattern uses System V regular expression syntax.
2186 2248  .RE
2187 2249  
2188 2250  .sp
2189 2251  .LP
2190 2252  If both \fIoptions\fR and \fB:\fR\fIpattern-list\fR are specified, then the
2191      -options apply only to \fIpattern-list\fR. Otherwise, the options remain in
     2253 +options apply only to \fIpattern-list\fR. Otherwise, these options remain in
2192 2254  effect until they are disabled by a subsequent \fB~(...)\fR or at the end of
2193 2255  the sub-pattern containing \fB~(...)\fR.
2194      -.sp
2195      -.LP
     2256 +.SS "Quoting"
2196 2257  Each of the metacharacters listed in the \fBDefinitions\fR section of this
2197 2258  manual page has a special meaning to the shell and causes termination of a word
2198 2259  unless quoted. A character can be quoted, that is, made to stand for itself, by
2199 2260  preceding it with a backslash (\fB\e\fR). The pair \fB\e\fRNEWLINE is removed.
2200 2261  All characters enclosed between a pair of single quote marks (\fB\&''\fR) that
2201 2262  is not preceded by a \fB$\fR are quoted. A single quote cannot appear within
2202 2263  the single quotes. A single quoted string preceded by an unquoted \fB$\fR is
2203 2264  processed as an \fBANSI-C\fR string except for the following:
2204 2265  .sp
2205 2266  .ne 2
2206 2267  .na
2207      -\fB\fB\e0\fR\fR
     2268 +\fB\e0\fR
2208 2269  .ad
2209 2270  .RS 19n
2210 2271  Causes the remainder of the string to be ignored.
2211 2272  .RE
2212 2273  
2213 2274  .sp
2214 2275  .ne 2
2215 2276  .na
2216      -\fB\fB\ec\fR\fIx\fR\fR
     2277 +\fB\ec\fR\fIx\fR
2217 2278  .ad
2218 2279  .RS 19n
2219 2280  Expands to the character CTRL-x.
2220 2281  .RE
2221 2282  
2222 2283  .sp
2223 2284  .ne 2
2224 2285  .na
2225      -\fB\fB\eC\fR[\fB\&.\fR\fIname\fR\fB\&.\fR]\fR
     2286 +\fB\eC\fR[\fB\&.\fR\fIname\fR\fB\&.\fR]\fR
2226 2287  .ad
2227 2288  .RS 19n
2228 2289  Expands to the collating element \fIname\fR.
2229 2290  .RE
2230 2291  
2231 2292  .sp
2232 2293  .ne 2
2233 2294  .na
2234      -\fB\fB\ee\fR\fR
     2295 +\fB\ee\fR
2235 2296  .ad
2236 2297  .RS 19n
2237 2298  Equivalent to the escape character (\fBASCII\fR 033),
2238 2299  .RE
2239 2300  
2240 2301  .sp
2241 2302  .ne 2
2242 2303  .na
2243      -\fB\fB\eE\fR\fR
     2304 +\fB\eE\fR
2244 2305  .ad
2245 2306  .RS 19n
2246 2307  Equivalent to the escape character (\fBASCII\fR 033),
2247 2308  .RE
2248 2309  
2249 2310  .sp
2250 2311  .LP
2251 2312  Inside double quote marks (\fB""\fR), parameter and command substitution occur
2252 2313  and \fB\e\fR quotes the characters \fB\e\fR, \fB`\fR, \fB"\fR, and \fB$\fR. A
2253 2314  \fB$\fR in front of a double quoted string is ignored in the \fBC\fR or
2254 2315  \fBPOSIX\fR locale, and might cause the string to be replaced by a locale
2255 2316  specific string otherwise. The meaning of \fB$*\fR and \fB$@\fR is identical
2256 2317  when not quoted or when used as a variable assignment value or as a file name.
2257 2318  However, when used as a command argument, \fB"$*"\fR is equivalent to
2258 2319  \fB"$1\fId\fR$2\fId\fR..."\fR, where \fId\fR is the first character of the IFS
2259 2320  variable, whereas \fB"$@"\fR is equivalent to \fB"$1" "$2" ....\fR Inside grave
2260      -quote marks (\fB``\fR), \fB\\fR quotes the characters \fB\e\fR, \fB`\fR, and
     2321 +quote marks (\fB``\fR), \fB\\\fR quotes the characters \fB\e\fR, \fB`\fR, and
2261 2322  \fB$\fR. If the grave quotes occur within double quotes, then \fB\e\fR also
2262 2323  quotes the character \fB"\fR.
2263 2324  .sp
2264 2325  .LP
2265 2326  The special meaning of reserved words or aliases can be removed by quoting any
2266 2327  character of the reserved word. The recognition of function names or built-in
2267 2328  command names cannot be altered by quoting them.
2268 2329  .SS "Arithmetic Evaluation"
2269      -.LP
2270 2330  The shell performs arithmetic evaluation for arithmetic substitution, to
2271 2331  evaluate an arithmetic command, to evaluate an indexed array subscript, and to
2272 2332  evaluate arguments to the built-in commands \fBshift\fR and \fBlet\fR.
2273 2333  Arithmetic evaluation is also performed on argument operands of the built-in
2274 2334  command printf that correspond to numeric format specifiers in the format
2275 2335  operand. See \fBprintf\fR(1). Evaluations are performed using double precision
2276 2336  floating point arithmetic or long double precision floating point for systems
2277 2337  that provide this data type. Floating point constants follow the \fBANSI-C\fR
2278      -programming language floating point conventions. Integer constants follow the
2279      -\fBANSI-C\fR programming language integer constant conventions although only
2280      -single byte character constants are recognized and character casts are not
2281      -recognized. Constants can be of the form \fB[\fR\fIbase#\fR\fB]\fR\fIn\fR where
2282      -\fIbase\fR is a decimal number between two and sixty-four representing the
2283      -arithmetic base and \fIn\fR is a number in that base. The digits greater than
2284      -\fB9\fR are represented by the lower case letters, the upper case letters,
2285      -\fB@\fR, and \fB_\fR respectively. For bases less than or equal to \fB36\fR,
2286      -upper and lower case characters can be used interchangeably.
     2338 +programming language floating point conventions. The floating point constants
     2339 +\fBNan\fR and \fBInf\fR can be used to represent "not a number" and
     2340 +infinity respectively. Integer constants follow the \fBANSI-C\fR programming
     2341 +language integer constant conventions although only single byte character
     2342 +constants are recognized and character casts are not recognized. Constants can
     2343 +be of the form \fB[\fR\fIbase#\fR\fB]\fR\fIn\fR where \fIbase\fR is a decimal
     2344 +number between two and sixty-four representing the arithmetic base and \fIn\fR
     2345 +is a number in that base. The digits greater than \fB9\fR are represented by
     2346 +the lower case letters, the upper case letters, \fB@\fR, and \fB_\fR
     2347 +respectively. For bases less than or equal to \fB36\fR, upper and lower case
     2348 +characters can be used interchangeably.
2287 2349  .sp
2288 2350  .LP
2289 2351  An arithmetic expression uses the same syntax, precedence, and associativity of
2290 2352  expression as the C language. All the C language operators that apply to
2291 2353  floating point quantities can be used. In addition, the operator \fB**\fR can
2292 2354  be used for exponentiation. It has higher precedence than multiplication and is
2293 2355  left associative. When the value of an arithmetic variable or subexpression can
2294 2356  be represented as a long integer, all C language integer arithmetic operations
2295 2357  can be performed. Variables can be referenced by name within an arithmetic
2296 2358  expression without using the parameter expansion syntax. When a variable is
2297 2359  referenced, its value is evaluated as an arithmetic expression.
2298 2360  .sp
2299 2361  .LP
2300 2362  Any of the following math library functions that are in the C math library can
2301 2363  be used within an arithmetic expression:
2302 2364  .sp
2303 2365  .in +2
2304 2366  .nf
2305      -abs acos acosh asin asinh atan atan2 atanh cbrt
2306      -copysign cos cosh erf erfc exp exp2 expm1 fabs
2307      -fdim finite floor fma fmax fmod hypot ilogb
2308      -int isinf isnan lgamma log log2 logb
2309      -nearbyint nextafter nexttoward pow remainder
2310      -rint round sin sinh sqrt tan tanh tgamma trunc
     2367 +rint round sin sinh sqrt tan tanh tgamma trunc abs acos
     2368 +acosh asin asinh atan atan2 atanh cbrt ceil copysign cos
     2369 +cosh erf erfc exp exp2 expm1 fabs fpclassify fdim finite
     2370 +floor fma fmax fmin fmod hypot ilogb int isfinite sinf isnan
     2371 +isnormal issubnormal issubor- dered iszero j0 j1 jn lgamma
     2372 +log log10 log2 logb nearbyint nextafter nexttoward pow
     2373 +remainder rint round scanb signbit sin sinh sqrt tan tanh
     2374 +tgamma trunc y0 y1 yn
2311 2375  .fi
2312 2376  .in -2
2313 2377  .sp
2314 2378  
2315 2379  .sp
2316 2380  .LP
     2381 +In addition, arithmetic functions can be defined as shell functions with a
     2382 +variant of the \fBfunction\fR \fIname\fR syntax:
     2383 +
     2384 +\fBfunction .sh.math.\fR\fIname\fR \fIident\fR ... \fB{\fR \fIlist\fR \fB;}\fR
     2385 +.RS 5
     2386 +where \fIname\fR is the function name used in the arithmetic expression and
     2387 +each identified \fIident\fR is a name reference to the long double precision
     2388 +floating point argument. The value of \fB.sh.value\fR when the function returns
     2389 +is the value of this function. User defined functions can take up to 3
     2390 +arguments and override C math library functions.
     2391 +.RE
     2392 +
     2393 +.sp
     2394 +.LP
2317 2395  An internal representation of a \fIvariable\fR as a double precision floating
2318      -point can be specified with the \fB-E [\fR\fIn\fR\fB]\fR or \fB-F
2319      -[\fR\fIn\fR\fB]\fR option of the \fBtypeset\fR special built-in command. The
     2396 +point can be specified with the \fB-E [\fR\fIn\fR\fB]\fR, \fB-F
     2397 +[\fR\fIn\fR\fB]\fR, or \fB-X [\fR\fIn\fR\fB]\fR options of the \fBtypeset\fR
     2398 +special built-in command. The
2320 2399  \fB-E\fR option causes the expansion of the value to be represented using
2321 2400  scientific notation when it is expanded. The optional option argument \fIn\fR
2322 2401  defines the number of significant figures. The \fB-F\fR option causes the
2323 2402  expansion to be represented as a floating decimal number when it is expanded.
2324 2403  The optional option argument \fIn\fR defines the number of places after the
2325      -decimal point in this case.
     2404 +decimal point in this case. The \fB-X\fR option causes the expansion to be
     2405 +represented using the \fB%a\fR format defined by ISO C-99. The optional option
     2406 +argument n defines the number of places after the decimal (or radix) point in
     2407 +this case.
     2408 +
2326 2409  .sp
2327 2410  .LP
2328 2411  An internal integer representation of a \fIvariable\fR can be specified with
2329 2412  the \fB-i\fR \fB[\fR\fIn\fR\fB]\fR option of the \fBtypeset\fR special built-in
2330 2413  command. The optional option argument \fIn\fR specifies an arithmetic base to
2331 2414  be used when expanding the variable. If you do not specify an arithmetic base,
2332 2415  base 10 is used.
2333 2416  .sp
2334 2417  .LP
2335 2418  Arithmetic evaluation is performed on the value of each assignment to a
2336      -variable with the \fB-E\fR, \fB-F\fR, or \fB-i\fR option. Assigning a floating
2337      -point number to a variable whose type is an integer causes the fractional part
2338      -to be truncated.
     2419 +variable with the \fB-E\fR, \fB-F\fR, \fB-X\fR or \fB-i\fR option. Assigning a
     2420 +floating point number to a variable whose type is an integer causes the
     2421 +fractional part to be truncated.
2339 2422  .SS "Prompting"
2340      -.LP
2341 2423  When used interactively, the shell prompts with the value of \fBPS1\fR after
2342 2424  expanding it for parameter expansion, command substitution, and arithmetic
2343 2425  substitution, before reading a command. In addition, each single \fB!\fR in the
2344 2426  prompt is replaced by the command number. A \fB!!\fR is required to place
2345 2427  \fB!\fR in the prompt. If at any time a NEWLINE is typed and further input is
2346 2428  needed to complete a command, then the secondary prompt, that is, the value of
2347 2429  \fBPS2\fR, is issued.
2348 2430  .SS "Conditional Expressions"
2349      -.LP
2350 2431  A \fBconditional expression\fR is used with the \fB[[\fR compound command to
2351 2432  test attributes of files and to compare strings. Field splitting and file name
2352 2433  generation are not performed on the words between \fB[[\fR and \fB]]\fR.
2353 2434  .sp
2354 2435  .LP
2355 2436  Each expression can be constructed from one or more of the following unary or
2356 2437  binary expressions:
2357 2438  .sp
2358 2439  .ne 2
2359 2440  .na
2360      -\fB\fB-a\fR \fIfile\fR\fR
     2441 +\fB-a\fR \fIfile\fR
2361 2442  .ad
2362 2443  .RS 21n
2363 2444  True, if \fIfile\fR exists.
2364 2445  .sp
2365 2446  This option is the same as \fB-e\fR. This option is obsolete.
2366 2447  .RE
2367 2448  
2368 2449  .sp
2369 2450  .ne 2
2370 2451  .na
2371      -\fB\fB-b\fR \fIfile\fR\fR
     2452 +\fB-b\fR \fIfile\fR
2372 2453  .ad
2373 2454  .RS 21n
2374 2455  True, if \fIfile\fR exists and is a block special file.
2375 2456  .RE
2376 2457  
2377 2458  .sp
2378 2459  .ne 2
2379 2460  .na
2380      -\fB\fB-c\fR \fIfile\fR\fR
     2461 +\fB-c\fR \fIfile\fR
2381 2462  .ad
2382 2463  .RS 21n
2383 2464  True, if \fIfile\fR exists and is a character special file.
2384 2465  .RE
2385 2466  
2386 2467  .sp
2387 2468  .ne 2
2388 2469  .na
2389      -\fB\fB-d\fR \fIfile\fR\fR
     2470 +\fB-d\fR \fIfile\fR
2390 2471  .ad
2391 2472  .RS 21n
2392 2473  True, if \fIfile\fR exists and is a directory.
2393 2474  .RE
2394 2475  
2395 2476  .sp
2396 2477  .ne 2
2397 2478  .na
2398      -\fB\fB-e\fR \fIfile\fR\fR
     2479 +\fB-e\fR \fIfile\fR
2399 2480  .ad
2400 2481  .RS 21n
2401 2482  True, if \fIfile\fR exists.
2402 2483  .RE
2403 2484  
2404 2485  .sp
2405 2486  .ne 2
2406 2487  .na
2407      -\fB\fB-f\fR \fIfile\fR\fR
     2488 +\fB-f\fR \fIfile\fR
2408 2489  .ad
2409 2490  .RS 21n
2410 2491  True, if \fIfile\fR exists and is an ordinary file.
2411 2492  .RE
2412 2493  
2413 2494  .sp
2414 2495  .ne 2
2415 2496  .na
2416      -\fB\fB-g\fR \fIfile\fR\fR
     2497 +\fB-g\fR \fIfile\fR
2417 2498  .ad
2418 2499  .RS 21n
2419 2500  True, if \fIfile\fR exists and it has its \fBsetgid\fR bit set.
2420 2501  .RE
2421 2502  
2422 2503  .sp
2423 2504  .ne 2
2424 2505  .na
2425      -\fB\fB-G\fR \fIfile\fR\fR
     2506 +\fB-G\fR \fIfile\fR
2426 2507  .ad
2427 2508  .RS 21n
2428 2509  True, if \fIfile\fR exists and its group matches the effective group id of this
2429 2510  process.
2430 2511  .RE
2431 2512  
2432 2513  .sp
2433 2514  .ne 2
2434 2515  .na
2435      -\fB\fB-h\fR \fIfile\fR\fR
     2516 +\fB-h\fR \fIfile\fR
2436 2517  .ad
2437 2518  .RS 21n
2438 2519  True, if \fIfile\fR exists and is a symbolic link.
2439 2520  .RE
2440 2521  
2441 2522  .sp
2442 2523  .ne 2
2443 2524  .na
2444      -\fB\fB-k\fR \fIfile\fR\fR
     2525 +\fB-k\fR \fIfile\fR
2445 2526  .ad
2446 2527  .RS 21n
2447 2528  True, if \fIfile\fR exists and it has its sticky bit set.
2448 2529  .RE
2449 2530  
2450 2531  .sp
2451 2532  .ne 2
2452 2533  .na
2453      -\fB\fB-L\fR \fIfile\fR\fR
     2534 +\fB-L\fR \fIfile\fR
2454 2535  .ad
2455 2536  .RS 21n
2456 2537  True, if \fIfile\fR exists and is a symbolic link.
2457 2538  .RE
2458 2539  
2459 2540  .sp
2460 2541  .ne 2
2461 2542  .na
2462      -\fB\fB-n\fR \fIstring\fR\fR
     2543 +\fB-n\fR \fIstring\fR
2463 2544  .ad
2464 2545  .RS 21n
2465 2546  True, if length of \fIstring\fR is \fBnon-zero\fR.
2466 2547  .RE
2467 2548  
2468 2549  .sp
2469 2550  .ne 2
2470 2551  .na
2471      -\fB\fB-N\fR \fIfile\fR\fR
     2552 +\fB-N\fR \fIfile\fR
2472 2553  .ad
2473 2554  .RS 21n
2474 2555  True, if \fIfile\fR exists and the modification time is greater than the last
2475 2556  access time.
2476 2557  .RE
2477 2558  
2478 2559  .sp
2479 2560  .ne 2
2480 2561  .na
2481      -\fB\fB-o\fR \fIoption\fR\fR
     2562 +\fB-o\fR \fIoption\fR
2482 2563  .ad
2483 2564  .RS 21n
2484 2565  True, if option named \fIoption\fR is on.
2485 2566  .RE
2486 2567  
2487 2568  .sp
2488 2569  .ne 2
2489 2570  .na
2490      -\fB\fB-o\fR \fI?option\fR\fR
     2571 +\fB-o\fR \fI?option\fR
2491 2572  .ad
2492 2573  .RS 21n
2493 2574  True, if option named \fIoption\fR is a valid option name.
2494 2575  .RE
2495 2576  
2496 2577  .sp
2497 2578  .ne 2
2498 2579  .na
2499      -\fB\fB-O\fR \fIfile\fR\fR
     2580 +\fB-O\fR \fIfile\fR
2500 2581  .ad
2501 2582  .RS 21n
2502 2583  True, if \fIfile\fR exists and is owned by the effective user id of this
2503 2584  process.
2504 2585  .RE
2505 2586  
2506 2587  .sp
2507 2588  .ne 2
2508 2589  .na
2509      -\fB\fB-p\fR \fIfile\fR\fR
     2590 +\fB-p\fR \fIfile\fR
2510 2591  .ad
2511 2592  .RS 21n
2512 2593  True, if \fIfile\fR exists and is a \fBFIFO\fR special file or a pipe.
2513 2594  .RE
2514 2595  
2515 2596  .sp
2516 2597  .ne 2
2517 2598  .na
2518      -\fB\fB-r\fR \fIfile\fR\fR
     2599 +\fB-r\fR \fIfile\fR
2519 2600  .ad
2520 2601  .RS 21n
2521 2602  True, if \fIfile\fR exists and is readable by current process.
2522 2603  .RE
2523 2604  
2524 2605  .sp
2525 2606  .ne 2
2526 2607  .na
2527      -\fB\fB-s\fR \fIfile\fR\fR
     2608 +\fB-R\fR \fIname\fR
2528 2609  .ad
2529 2610  .RS 21n
     2611 +True if variable \fIname\fR is a name reference.
     2612 +.RE
     2613 +
     2614 +.sp
     2615 +.ne 2
     2616 +.na
     2617 +\fB-s\fR \fIfile\fR
     2618 +.ad
     2619 +.RS 21n
2530 2620  True, if \fIfile\fR exists and has size greater than zero.
2531 2621  .RE
2532 2622  
2533 2623  .sp
2534 2624  .ne 2
2535 2625  .na
2536      -\fB\fB-S\fR \fIfile\fR\fR
     2626 +\fB-S\fR \fIfile\fR
2537 2627  .ad
2538 2628  .RS 21n
2539 2629  True, if \fIfile\fR exists and is a socket.
2540 2630  .RE
2541 2631  
2542 2632  .sp
2543 2633  .ne 2
2544 2634  .na
2545      -\fB\fB-t\fR \fIfildes\fR\fR
     2635 +\fB-t\fR \fIfildes\fR
2546 2636  .ad
2547 2637  .RS 21n
2548 2638  True, if file descriptor number \fIfildes\fR is open and associated with a
2549 2639  terminal device.
2550 2640  .RE
2551 2641  
2552 2642  .sp
2553 2643  .ne 2
2554 2644  .na
2555      -\fB\fB-u\fR \fIfile\fR\fR
     2645 +\fB-u\fR \fIfile\fR
2556 2646  .ad
2557 2647  .RS 21n
2558 2648  True, if \fIfile\fR exists and it has its \fBsetuid\fR bit set.
2559 2649  .RE
2560 2650  
2561 2651  .sp
2562 2652  .ne 2
2563 2653  .na
2564      -\fB\fB-w\fR \fIfile\fR\fR
     2654 +\fB-v\fR \fIname\fR
2565 2655  .ad
2566 2656  .RS 21n
     2657 +True, if variable \fIname\fR is a valid variable name and is set.
     2658 +.RE
     2659 +
     2660 +.sp
     2661 +.ne 2
     2662 +.na
     2663 +\fB-w\fR \fIfile\fR
     2664 +.ad
     2665 +.RS 21n
2567 2666  True, if \fIfile\fR exists and is writable by current process.
2568 2667  .RE
2569 2668  
2570 2669  .sp
2571 2670  .ne 2
2572 2671  .na
2573      -\fB\fB-x\fR \fIfile\fR\fR
     2672 +\fB-x\fR \fIfile\fR
2574 2673  .ad
2575 2674  .RS 21n
2576 2675  True, if \fIfile\fR exists and is executable by current process. If \fIfile\fR
2577 2676  exists and is a directory, then true if the current process has permission to
2578 2677  search in the directory.
2579 2678  .RE
2580 2679  
2581 2680  .sp
2582 2681  .ne 2
2583 2682  .na
2584      -\fB\fB-z\fR \fIstring\fR\fR
     2683 +\fB-z\fR \fIstring\fR
2585 2684  .ad
2586 2685  .RS 21n
2587 2686  True, if length of \fIstring\fR is zero.
2588 2687  .RE
2589 2688  
2590 2689  .sp
2591 2690  .ne 2
2592 2691  .na
2593      -\fB\fIfile1\fR \fB-ef\fR \fIfile2\fR\fR
     2692 +\fB\fIfile1\fR \fB-ef\fR \fIfile2\fR
2594 2693  .ad
2595 2694  .RS 21n
2596 2695  True, if \fIfile1\fR and \fIfile2\fR exist and refer to the same file.
2597 2696  .RE
2598 2697  
2599 2698  .sp
2600 2699  .ne 2
2601 2700  .na
2602      -\fB\fIfile1\fR \fB-nt\fR \fIfile2\fR\fR
     2701 +\fB\fIfile1\fR \fB-nt\fR \fIfile2\fR
2603 2702  .ad
2604 2703  .RS 21n
2605 2704  True, if \fIfile1\fR exists and \fIfile2\fR does not, or \fIfile1\fR is newer
2606 2705  than \fIfile2\fR.
2607 2706  .RE
2608 2707  
2609 2708  .sp
2610 2709  .ne 2
2611 2710  .na
2612      -\fB\fIfile1\fR \fB-ot\fR \fIfile2\fR\fR
     2711 +\fB\fIfile1\fR \fB-ot\fR \fIfile2\fR
2613 2712  .ad
2614 2713  .RS 21n
2615 2714  True, if \fIfile2\fR exists and \fIfile1\fR does not, or \fIfile1\fR is older
2616 2715  than \fIfile2\fR.
2617 2716  .RE
2618 2717  
2619 2718  .sp
2620 2719  .ne 2
2621 2720  .na
2622      -\fB\fIstring\fR\fR
     2721 +\fB\fIstring\fR
2623 2722  .ad
2624 2723  .RS 21n
2625 2724  True, if \fIstring\fR is not null.
2626 2725  .RE
2627 2726  
2628 2727  .sp
2629 2728  .ne 2
2630 2729  .na
2631      -\fB\fIstring\fR \fB==\fR \fIpattern\fR\fR
     2730 +\fB\fIstring\fR \fB==\fR \fIpattern\fR
2632 2731  .ad
2633 2732  .RS 21n
2634 2733  True, if \fIstring\fR matches \fIpattern\fR. Any part of \fIpattern\fR can be
2635 2734  quoted to cause it to be matched as a string. With a successful match to
2636 2735  \fIpattern\fR, the \fB\&.sh.match\fR array variable contains the match and
2637 2736  sub-pattern matches.
2638 2737  .RE
2639 2738  
2640 2739  .sp
2641 2740  .ne 2
2642 2741  .na
2643      -\fB\fIstring\fR \fB=\fR \fIpattern\fR\fR
     2742 +\fB\fIstring\fR \fB=\fR \fIpattern\fR
2644 2743  .ad
2645 2744  .RS 21n
2646 2745  Same as \fB==\fR, but is obsolete.
2647 2746  .RE
2648 2747  
2649 2748  .sp
2650 2749  .ne 2
2651 2750  .na
2652      -\fB\fIstring\fR \fB!=\fR \fIpattern\fR\fR
     2751 +\fB\fIstring\fR \fB!=\fR \fIpattern\fR
2653 2752  .ad
2654 2753  .RS 21n
2655 2754  True, if \fIstring\fR does not match \fIpattern\fR. When the \fIstring\fR
2656 2755  matches the \fIpattern\fR the \fB\&.sh.match\fR array variable contains the
2657 2756  match and sub-pattern matches.
2658 2757  .RE
2659 2758  
2660 2759  .sp
2661 2760  .ne 2
2662 2761  .na
2663      -\fB\fIstring\fR \fB=~\fR \fIere\fR\fR
     2762 +\fB\fIstring\fR \fB=~\fR \fIere\fR
2664 2763  .ad
2665 2764  .RS 21n
2666 2765  True if \fIstring\fR matches the pattern \fB~(E)\fR\fIere\fR where \fIere\fR is
2667 2766  an extended regular expression.
2668 2767  .RE
2669 2768  
2670 2769  .sp
2671 2770  .ne 2
2672 2771  .na
2673      -\fB\fIstring1\fR \fB<\fR \fIstring2\fR\fR
     2772 +\fB\fIstring1\fR \fB<\fR \fIstring2\fR
2674 2773  .ad
2675 2774  .RS 21n
2676 2775  True, if \fIstring1\fR comes before \fIstring2\fR based on \fBASCII\fR value of
2677 2776  their characters.
2678 2777  .RE
2679 2778  
2680 2779  .sp
2681 2780  .ne 2
2682 2781  .na
2683      -\fB\fIstring1\fR \fB>\fR \fIstring2\fR\fR
     2782 +\fB\fIstring1\fR \fB>\fR \fIstring2\fR
2684 2783  .ad
2685 2784  .RS 21n
2686 2785  True, if \fIstring1\fR comes after \fIstring2\fR based on \fBASCII\fR value of
2687 2786  their characters.
2688 2787  .RE
2689 2788  
2690 2789  .sp
2691      -.LP
2692      -In each of the following expressions, if \fIfile\fR is of the form
     2790 +In each of the above expressions, if \fIfile\fR is of the form
2693 2791  \fB/dev/fd/\fR\fIn\fR, where \fIn\fR is an integer, the test is applied to the
2694      -open file whose descriptor number is \fIn\fR. The following obsolete arithmetic
2695      -comparisons are supported:
     2792 +open file whose descriptor number is \fIn\fR.
2696 2793  .sp
     2794 +.LP
     2795 +The following obsolete arithmetic comparisons are also supported:
     2796 +.sp
2697 2797  .ne 2
2698 2798  .na
2699      -\fB\fIexp1\fR \fB-eq\fR \fIexp2\fR\fR
     2799 +\fB\fIexp1\fR \fB-eq\fR \fIexp2\fR
2700 2800  .ad
2701 2801  .RS 17n
2702 2802  True, if \fIexp1\fR is equal to \fIexp2\fR.
2703 2803  .RE
2704 2804  
2705 2805  .sp
2706 2806  .ne 2
2707 2807  .na
2708      -\fB\fIexp1\fR \fB-ge\fR \fIexp2\fR\fR
     2808 +\fB\fIexp1\fR \fB-ge\fR \fIexp2\fR
2709 2809  .ad
2710 2810  .RS 17n
2711 2811  True, if \fIexp1\fR is greater than or equal to \fIexp2\fR.
2712 2812  .RE
2713 2813  
2714 2814  .sp
2715 2815  .ne 2
2716 2816  .na
2717      -\fB\fIexp1\fR \fB-gt\fR \fIexp2\fR\fR
     2817 +\fB\fIexp1\fR \fB-gt\fR \fIexp2\fR
2718 2818  .ad
2719 2819  .RS 17n
2720 2820  True, if \fIexp1\fR is greater than \fIexp2\fR.
2721 2821  .RE
2722 2822  
2723 2823  .sp
2724 2824  .ne 2
2725 2825  .na
2726      -\fB\fIexp1\fR \fB-le\fR \fIexp2\fR\fR
     2826 +\fB\fIexp1\fR \fB-le\fR \fIexp2\fR
2727 2827  .ad
2728 2828  .RS 17n
2729 2829  True, if \fIexp1\fR is less than or equal to \fIexp2\fR.
2730 2830  .RE
2731 2831  
2732 2832  .sp
2733 2833  .ne 2
2734 2834  .na
2735      -\fB\fIexp1\fR \fB-lt\fR \fIexp2\fR\fR
     2835 +\fB\fIexp1\fR \fB-lt\fR \fIexp2\fR
2736 2836  .ad
2737 2837  .RS 17n
2738 2838  True, if \fIexp1\fR is less than \fIexp2\fR.
2739 2839  .RE
2740 2840  
2741 2841  .sp
2742 2842  .ne 2
2743 2843  .na
2744      -\fB\fIexp1\fR \fB-ne\fR \fIexp2\fR\fR
     2844 +\fB\fIexp1\fR \fB-ne\fR \fIexp2\fR
2745 2845  .ad
2746 2846  .RS 17n
2747 2847  True, if \fIexp1\fR is not equal to \fIexp2\fR.
2748 2848  .RE
2749 2849  
2750 2850  .sp
2751 2851  .LP
2752 2852  A compound expression can be constructed from these primitives by using any of
2753 2853  the following, listed in decreasing order of precedence:
2754 2854  .sp
2755 2855  .ne 2
2756 2856  .na
2757      -\fB\fB(\fR\fIexpression\fR\fB)\fR\fR
     2857 +\fB(\fR\fIexpression\fR\fB)\fR
2758 2858  .ad
2759 2859  .RS 30n
2760 2860  True, if \fIexpression\fR is true. Used to group expressions.
2761 2861  .RE
2762 2862  
2763 2863  .sp
2764 2864  .ne 2
2765 2865  .na
2766      -\fB\fB!\fR \fIexpression\fR\fR
     2866 +\fB!\fR \fIexpression\fR
2767 2867  .ad
2768 2868  .RS 30n
2769 2869  True, if \fIexpression\fR is false.
2770 2870  .RE
2771 2871  
2772 2872  .sp
2773 2873  .ne 2
2774 2874  .na
2775      -\fB\fIexpression1\fR \fB&&\fR \fIexpression2\fR\fR
     2875 +\fB\fIexpression1\fR \fB&&\fR \fIexpression2\fR
2776 2876  .ad
2777 2877  .RS 30n
2778 2878  True, if \fIexpression1\fR and \fIexpression2\fR are both true.
2779 2879  .RE
2780 2880  
2781 2881  .sp
2782 2882  .ne 2
2783 2883  .na
2784      -\fB\fIexpression1\fR \fB||\fR \fIexpression2\fR\fR
     2884 +\fB\fIexpression1\fR \fB||\fR \fIexpression2\fR
2785 2885  .ad
2786 2886  .RS 30n
2787 2887  True, if either \fIexpression1\fR or \fIexpression2\fR is true.
2788 2888  .RE
2789 2889  
2790 2890  .SS "Input and Output"
2791      -.LP
2792 2891  Before a command is executed, its input and output can be redirected using a
2793 2892  special notation interpreted by the shell. The following can appear anywhere in
2794 2893  a simple command or can precede or follow a command and are \fBnot\fR passed on
2795 2894  to the invoked command. Command substitution, parameter expansion, and
2796 2895  arithmetic substitution occur before \fIword\fR or \fIdigit\fR is used except
2797 2896  as noted in this section. File name generation occurs only if the shell is
2798 2897  interactive and the pattern matches a single file. Field splitting is not
2799 2898  performed.
2800 2899  .sp
2801 2900  .LP
↓ open down ↓ 4 lines elided ↑ open up ↑
2806 2905  host address, and \fIport\fR is a service specified by name or an integer port
2807 2906  number, then the redirection attempts to make a \fBtcp\fR, \fBsctp\fR or
2808 2907  \fBudp\fR connection to the corresponding socket.
2809 2908  .sp
2810 2909  .LP
2811 2910  No intervening space is allowed between the characters of redirection
2812 2911  operators.
2813 2912  .sp
2814 2913  .ne 2
2815 2914  .na
2816      -\fB\fB<\fR\fIword\fR\fR
     2915 +\fB<\fR\fIword\fR
2817 2916  .ad
2818 2917  .RS 14n
2819 2918  Use file \fIword\fR as standard input (file descriptor 0).
2820 2919  .RE
2821 2920  
2822 2921  .sp
2823 2922  .ne 2
2824 2923  .na
2825      -\fB\fB>\fR\fIword\fR\fR
     2924 +\fB>\fR\fIword\fR
2826 2925  .ad
2827 2926  .RS 14n
2828 2927  Use file \fIword\fR as standard output (file descriptor 1). If the file does
2829 2928  not exist then it is created. If the file exists, and the \fBnoclobber\fR
2830 2929  option is on, this causes an error. Otherwise, it is truncated to zero length.
2831 2930  .RE
2832 2931  
2833 2932  .sp
2834 2933  .ne 2
2835 2934  .na
2836      -\fB\fB>|\fR\fIword\fR\fR
     2935 +\fB>|\fR\fIword\fR
2837 2936  .ad
2838 2937  .RS 14n
2839 2938  Same as \fB>\fR, except that it overrides the \fBnoclobber\fR option.
2840 2939  .RE
2841 2940  
2842 2941  .sp
2843 2942  .ne 2
2844 2943  .na
2845      -\fB\fB>>\fR\fIword\fR\fR
     2944 +\fB>;\fR\fIword\fR
2846 2945  .ad
2847 2946  .RS 14n
     2947 +Write output to a temporary file.  If the command completes successfully rename
     2948 +it to word, otherwise, delete the temporary file.  >;word cannot be used with
     2949 +the \fBexec\fR(2) built-in.
     2950 +.RE
     2951 +
     2952 +.sp
     2953 +.ne 2
     2954 +.na
     2955 +\fB>>\fR\fIword\fR
     2956 +.ad
     2957 +.RS 14n
2848 2958  Use file \fIword\fR as standard output. If the file exists, then output is
2849 2959  appended to it (by first seeking to the end-of-file). Otherwise, the file is
2850 2960  created.
2851 2961  .RE
2852 2962  
2853 2963  .sp
2854 2964  .ne 2
2855 2965  .na
2856      -\fB\fB<>\fR\fIword\fR\fR
     2966 +\fB<>\fR\fIword\fR
2857 2967  .ad
2858 2968  .RS 14n
2859 2969  Open file \fIword\fR for reading and writing as standard input.
2860 2970  .RE
2861 2971  
2862 2972  .sp
2863 2973  .ne 2
2864 2974  .na
2865      -\fB\fB<<\fR\fB[-]\fR\fIword\fR\fR
     2975 +\fB<<\fR\fB[-]\fR\fIword\fR
2866 2976  .ad
2867 2977  .RS 14n
2868 2978  The shell input is read up to a line that is the same as \fIword\fR after any
2869 2979  quoting has been removed, or to an end-of-file. No parameter substitution,
2870 2980  command substitution, arithmetic substitution or file name generation is
2871 2981  performed on \fIword\fR. The resulting document, called a \fBhere-document\fR,
2872 2982  becomes the standard input. If any character of \fIword\fR is quoted, then no
2873 2983  interpretation is placed upon the characters of the document. Otherwise,
2874 2984  parameter expansion, command substitution, and arithmetic substitution occur,
2875 2985  \fB\e\fRNEWLINE is ignored, and \fB\e\fR must be used to quote the characters
↓ open down ↓ 1 lines elided ↑ open up ↑
2877 2987  leading tabs are stripped from \fIword\fR and from the document. If \fB#\fR is
2878 2988  appended to \fB<<\fR, then leading SPACEs and TABs are stripped off the first
2879 2989  line of the document and up to an equivalent indentation is stripped from the
2880 2990  remaining lines and from \fIword\fR. A tab stop is assumed to occur at every 8
2881 2991  columns for the purposes of determining the indentation.
2882 2992  .RE
2883 2993  
2884 2994  .sp
2885 2995  .ne 2
2886 2996  .na
2887      -\fB\fB<<<\fR\fIword\fR\fR
     2997 +\fB<<<\fR\fIword\fR
2888 2998  .ad
2889 2999  .RS 14n
2890 3000  A short form of here document in which \fIword\fR becomes the contents of the
2891 3001  here-document after any parameter expansion, command substitution, and
2892 3002  arithmetic substitution occur.
2893 3003  .RE
2894 3004  
2895 3005  .sp
2896 3006  .ne 2
2897 3007  .na
2898      -\fB\fB<&\fR\fIdigit\fR\fR
     3008 +\fB<&\fR\fIdigit\fR
2899 3009  .ad
2900 3010  .RS 14n
2901 3011  The standard input is duplicated from file descriptor \fIdigit\fR, and
2902 3012  similarly for the standard output using \fB>&\fR\fIdigit\fR. See \fBdup\fR(2).
2903 3013  .RE
2904 3014  
2905 3015  .sp
2906 3016  .ne 2
2907 3017  .na
2908      -\fB\fB<&\fR\fIdigit\fR\fB-\fR\fR
     3018 +\fB<&\fR\fIdigit\fR\fB-\fR
2909 3019  .ad
2910 3020  .RS 14n
2911 3021  The file descriptor specified by \fIdigit\fR is moved to standard input.
2912 3022  Similarly for the standard output using \fB>&\fR\fIdigit\fR\fB-\fR.
2913 3023  .RE
2914 3024  
2915 3025  .sp
2916 3026  .ne 2
2917 3027  .na
2918      -\fB\fB<&-\fR\fR
     3028 +\fB<&-\fR
2919 3029  .ad
2920 3030  .RS 14n
2921 3031  The standard input is closed. Similarly for the standard output using
2922 3032  \fB>&-\fR.
2923 3033  .RE
2924 3034  
2925 3035  .sp
2926 3036  .ne 2
2927 3037  .na
2928      -\fB\fB<&p\fR\fR
     3038 +\fB<&p\fR
2929 3039  .ad
2930 3040  .RS 14n
2931 3041  The input from the co-process is moved to standard input.
2932 3042  .RE
2933 3043  
2934 3044  .sp
2935 3045  .ne 2
2936 3046  .na
2937      -\fB\fB>&p\fR\fR
     3047 +\fB>&p\fR
2938 3048  .ad
2939 3049  .RS 14n
2940 3050  The output to the co-process is moved to standard output.
2941 3051  .RE
2942 3052  
2943 3053  .sp
2944 3054  .ne 2
2945 3055  .na
2946      -\fB\fB<#((\fR\fIexpr\fR\fB))\fR\fR
     3056 +\fB<#((\fR\fIexpr\fR\fB))\fR
2947 3057  .ad
2948 3058  .RS 14n
2949 3059  Evaluate arithmetic expression \fIexpr\fR and position file descriptor 0 to the
2950 3060  resulting value bytes from the start of the file. The variables \fBCUR\fR and
2951 3061  \fBEOF\fR evaluate to the current offset and end-of-file offset respectively
2952 3062  when evaluating \fIexpr\fR.
2953 3063  .RE
2954 3064  
2955 3065  .sp
2956 3066  .ne 2
2957 3067  .na
2958      -\fB\fB>#((\fR\fIexpr\fR\fB))\fR\fR
     3068 +\fB>#((\fR\fIexpr\fR\fB))\fR
2959 3069  .ad
2960 3070  .RS 14n
2961 3071  The same as \fB<#\fR except applies to file descriptor 1.
2962 3072  .RE
2963 3073  
2964 3074  .sp
2965 3075  .ne 2
2966 3076  .na
2967      -\fB\fB<#\fR\fIpattern\fR\fR
     3077 +\fB<#\fR\fIpattern\fR
2968 3078  .ad
2969 3079  .RS 14n
2970 3080  Seek forward to the beginning of the next line containing pattern.
2971 3081  .RE
2972 3082  
2973 3083  .sp
2974 3084  .ne 2
2975 3085  .na
2976      -\fB\fB<##\fR\fIpattern\fR\fR
     3086 +\fB<##\fR\fIpattern\fR
2977 3087  .ad
2978 3088  .RS 14n
2979 3089  The same as \fB<#\fR, except that the portion of the file that is skipped is
2980 3090  copied to standard output.
2981 3091  .RE
2982 3092  
2983 3093  .sp
2984 3094  .LP
2985 3095  If one of the redirection operators is preceded by a digit, with no intervening
2986 3096  space, then the file descriptor number referred to is that specified by the
↓ open down ↓ 43 lines elided ↑ open up ↑
3030 3140  first associates file descriptor 1 with file \fIfname\fR. It then associates
3031 3141  file descriptor 2 with the file associated with file descriptor 1, that is,
3032 3142  \fIfname\fR. If the order of redirections were reversed, file descriptor 2
3033 3143  would be associated with the terminal (assuming file descriptor 1 had been) and
3034 3144  then file descriptor 1 would be associated with file \fIfname\fR. If a command
3035 3145  is followed by \fB&\fR and job control is not active, the default standard
3036 3146  input for the command is the empty file \fB/dev/null\fR. Otherwise, the
3037 3147  environment for the execution of a command contains the file descriptors of the
3038 3148  invoking shell as modified by input and output specifications.
3039 3149  .SS "Environment"
3040      -.LP
3041 3150  The \fIenvironment\fR is a list of name-value pairs that is passed to an
3042 3151  executed program in the same way as a normal argument list. See
3043 3152  \fBenviron\fR(5).
3044 3153  .sp
3045 3154  .LP
3046 3155  The names must be \fIidentifiers\fR and the values are character strings. The
3047 3156  shell interacts with the environment in several ways. On invocation, the shell
3048 3157  scans the environment and creates a variable for each name found, giving it the
3049 3158  corresponding value and attributes and marking it \fBexport\fR. Executed
3050 3159  commands inherit the environment. If the user modifies the values of these
↓ open down ↓ 42 lines elided ↑ open up ↑
3093 3202  echo a=b c
3094 3203  .fi
3095 3204  .in -2
3096 3205  .sp
3097 3206  
3098 3207  .sp
3099 3208  .LP
3100 3209  This feature is intended for use with scripts written for early versions of the
3101 3210  shell and its use in new scripts is strongly discouraged.
3102 3211  .SS "Functions"
3103      -.LP
3104 3212  For historical reasons, there are two ways to define functions, the
3105 3213  \fBname()\fR syntax and the \fBfunction\fR \fBname\fR syntax. These are
3106 3214  described in the \fBCommands\fR section of this manual page.
3107 3215  .sp
3108 3216  .LP
3109 3217  Shell functions are read in and stored internally. Alias names are resolved
3110 3218  when the function is read. Functions are executed like commands with the
3111 3219  arguments passed as positional parameters. See the \fBExecution\fR section of
3112 3220  this manual page for details.
3113 3221  .sp
↓ open down ↓ 28 lines elided ↑ open up ↑
3142 3250  \fBtypeset\fR special built-in command. The text of functions, when available,
3143 3251  is also listed with \fB-f\fR. Functions can be undefined with the \fB-f\fR
3144 3252  option of the \fBunset\fR special built-in command.
3145 3253  .sp
3146 3254  .LP
3147 3255  Ordinarily, functions are unset when the shell executes a shell script.
3148 3256  Functions that need to be defined across separate invocations of the shell
3149 3257  should be placed in a directory and the \fBFPATH\fR variable should contain the
3150 3258  name of this directory. They can also be specified in the \fBENV\fR file.
3151 3259  .SS "Discipline Functions"
3152      -.LP
3153 3260  Each variable can have zero or more discipline functions associated with it.
3154 3261  The shell initially understands the discipline names \fBget\fR, \fBset\fR,
3155 3262  \fBappend\fR, and \fBunset\fR but on most systems others can be added at run
3156 3263  time via the C programming interface extension provided by the \fBbuiltin\fR
3157 3264  built-in utility. If the \fBget\fR discipline is defined for a variable, it is
3158 3265  invoked whenever the specified variable is referenced. If the variable
3159 3266  \fB\&.sh.value\fR is assigned a value inside the discipline function, the
3160 3267  referenced variable is evaluated to this value instead. If the \fBset\fR
3161 3268  discipline is defined for a variable, it is invoked whenever the specified
3162 3269  variable is assigned a value. If the \fBappend\fR discipline is defined for a
↓ open down ↓ 5 lines elided ↑ open up ↑
3168 3275  \fBunset\fR discipline is defined for a variable, it is invoked whenever the
3169 3276  specified variable is unset. The variable is not unset unless it is unset
3170 3277  explicitly from within this discipline function.
3171 3278  .sp
3172 3279  .LP
3173 3280  The variable \fB\&.sh.name\fR contains the name of the variable for which the
3174 3281  discipline function is called, \fB\&.sh.subscript\fR is the subscript of the
3175 3282  variable, and \fB\&.sh.value\fR contains the value being assigned inside the
3176 3283  \fBset\fR discipline function. For the \fBset\fR discipline, changing
3177 3284  \fB\&.sh.value\fR changes the value that gets assigned.
     3285 +The variable \fB_\fR is a reference to the variable including the subscript if
     3286 +any. For the set discipline, changing \fB\&.sh.value\fR will change the value
     3287 +that gets assigned. Finally, the expansion \fB${\fR \fIvar.name\fR\fB}\fR,
     3288 +when name is the name of a discipline, and there is no variable of this name,
     3289 +is equivalent to the command substitution \fB${\fR\fIvar.name\fR\fB;}\fR.
     3290 +
     3291 +.SS "Name Spaces"
     3292 +Commands and functions that are executed as part of the \fIlist\fR
     3293 +of a \fBnamespace\fR command that modify variables or create new ones, create
     3294 +a new variable whose name is the name of the name space as given by
     3295 +\fIidentifier\fR preceded by two dots (\fB\&..\fR).
     3296 +When a variable whose name is \fIname\fR is referenced, it is first searched
     3297 +for using \fB.\fR\fIidentifier\fR\fB.\fR\fIname\fR\fB.\fR
     3298 +Similarly, a function defined by a command in the \fBnamespace\fR \fIlist\fR
     3299 +is created using the name space name preceded by two dots (\fB\&..\fR).
     3300 +.PP
     3301 +When  the \fIlist\fR of a \fBnamespace\fR command contains a \fBnamespace\fR
     3302 +command, the names of variables and functions that are created consist
     3303 +of the variable or function name preceded by the list of \fIidentifier\fRs
     3304 +each preceded by two dots (\fB\&..\fR).
     3305 +.PP
     3306 +Outside of a name space, a variable or function created inside a
     3307 +name space can be referenced by preceding it with the name space name.
     3308 +.PP
     3309 +By default, variables staring with \fB.sh\fR are in the \fBsh\fR name space.
     3310 +
     3311 +.SS "Typed Variables"
     3312 +Typed variables provide a way to create data structure and objects. A type can
     3313 +be defined either by a shared library, by the \fBenum\fR built-in command
     3314 +described below, or by using the new \fB-T\fR option of the \fBtypeset\fR
     3315 +built-in command. With the \fB-T\fR option of \fBtypeset\fR, the type name,
     3316 +specified as an option argument to \fB-T\fR, is set with a compound variable
     3317 +assignment that defines the type. Function definitions can appear inside the
     3318 +compound variable assignment and these become discipline functions for this
     3319 +type and can be invoked or redefined by each instance of the type. The function
     3320 +name \fBcreate\fR is treated specially. It is invoked for each instance of the
     3321 +type that is created but is not inherited and cannot be redefined for each
     3322 +instance.
     3323 +
     3324 +When a type is defined a special built-in command of that name is added.  These
     3325 +built-ins are declaration commands and follow the same expansion rules as all
     3326 +the special built-in commands defined below that are preceded by a dot
     3327 +(\fB\&.\fR). These commands can subsequently be used inside further type
     3328 +definitions. The man page for these commands can be generated by using the
     3329 +\fB--man\fR option or any of the other \fB--\fR options described with
     3330 +\fBgetopts\fR. The \fB-r, -a, -A, -h\fR and \fB-S\fR options of \fBtypeset\fR
     3331 +are permitted with each of these new built-ins.
     3332 +
     3333 +An instance of a type is created by invoking the type name
     3334 +followed by one or more instance names.
     3335 +Each instance of the type is initialized with a copy of the sub-variables
     3336 +except for sub-variables that are defined with the \fB-s\fR
     3337 +option. Variables defined with \fB-S\fR are shared by all instances of the
     3338 +type. Each instance can change the value of any sub-variable and can also
     3339 +define new discipline functions of the same names as those defined by the type
     3340 +definition as well as any standard discipline names. No additional
     3341 +sub-variables can be defined for any instance.
     3342 +
     3343 +When defining a type, if the value of a sub-variable is not set and the
     3344 +\fB-r\fR attribute is specified, it causes the sub-variable to be a required
     3345 +sub-variable. Whenever an instance of a type is created, all required
     3346 +sub-variables must be specified. These sub-variables become readonly in each
     3347 +instance.
     3348 +
     3349 +When \fBunset\fR is invoked on a sub-variable within a type, and the \fB-r\fR
     3350 +attribute has not been specified for this field, the value is reset to the
     3351 +default value associative with the type. Invoking \fBunset\fR on a type
     3352 +instance not contained within another type deletes all sub-variables and the
     3353 +variable itself.
     3354 +
     3355 +A type definition can be derived from another type definition by defining the
     3356 +first sub-variable name as \fB_\fR and defining its type as the base type. Any
     3357 +remaining definitions will be additions and modifications that apply to the new
     3358 +type. If the new type name is the same is that of the base type, the type will
     3359 +be replaced and the original type will no longer be accessible.
     3360 +
     3361 +The \fBtypeset\fR command with \fB-T\fR and no option argument or operands will
     3362 +write all the type definitions to standard output in a form that that can be
     3363 +read in to create all the types.
     3364 +
3178 3365  .SS "Jobs"
3179      -.LP
3180 3366  If the monitor option of the \fBset\fR command is turned on, an interactive
3181 3367  shell associates a job with each pipeline. It keeps a table of current jobs,
3182 3368  printed by the \fBjobs\fR command, and assigns them small integer numbers. When
3183 3369  a job is started asynchronously with \fB&\fR, the shell prints a line which
3184 3370  looks like:
3185 3371  .sp
3186 3372  .in +2
3187 3373  .nf
3188 3374  [1] 1234
3189 3375  .fi
↓ open down ↓ 16 lines elided ↑ open up ↑
3206 3392  typed.
3207 3393  .sp
3208 3394  .LP
3209 3395  A job being run in the background stops if it tries to read from the terminal.
3210 3396  Background jobs are normally allowed to produce output, but this can be
3211 3397  disabled by giving the command \fBsttytostop\fR. If you set this \fBtty\fR
3212 3398  option, then background jobs stop when they try to produce output like they do
3213 3399  when they try to read input.
3214 3400  .sp
3215 3401  .LP
     3402 +A job pool is a collection of jobs started with \fIlist\fR \fB&\fR associated
     3403 +with a name.
     3404 +.sp
     3405 +.LP
3216 3406  There are several ways to refer to jobs in the shell. A job can be referred to
3217 3407  by the process id of any process of the job or by one of the following:
3218 3408  .sp
3219 3409  .ne 2
3220 3410  .na
3221      -\fB\fB%\fR\fInumber\fR\fR
     3411 +\fB%\fR\fInumber\fR
3222 3412  .ad
3223 3413  .RS 12n
3224 3414  The job with the specified number.
3225 3415  .RE
3226 3416  
3227 3417  .sp
3228 3418  .ne 2
3229 3419  .na
3230      -\fB\fB%\fR\fIstring\fR\fR
     3420 +\fIpool\fR
3231 3421  .ad
3232 3422  .RS 12n
     3423 +All the jobs in the job pool named by \fIpool\fR.
     3424 +.RE
     3425 +
     3426 +.sp
     3427 +.ne 2
     3428 +.na
     3429 +\fIpool\fR\fB.\fR\fInumber\fR
     3430 +.ad
     3431 +.RS 12n
     3432 +The job number \fInumber\fR in the pool named by \fIpool\fR.
     3433 +.RE
     3434 +
     3435 +.sp
     3436 +.ne 2
     3437 +.na
     3438 +\fB%\fR\fIstring\fR
     3439 +.ad
     3440 +.RS 12n
3233 3441  Any job whose command line begins with \fIstring\fR.
3234 3442  .RE
3235 3443  
3236 3444  .sp
3237 3445  .ne 2
3238 3446  .na
3239      -\fB\fB%?\fR\fIstring\fR\fR
     3447 +\fB%?\fR\fIstring\fR
3240 3448  .ad
3241 3449  .RS 12n
3242 3450  Any job whose command line contains \fIstring\fR.
3243 3451  .RE
3244 3452  
3245 3453  .sp
3246 3454  .ne 2
3247 3455  .na
3248      -\fB\fB%%\fR\fR
     3456 +\fB%%\fR
3249 3457  .ad
3250 3458  .RS 12n
3251 3459  Current job.
3252 3460  .RE
3253 3461  
3254 3462  .sp
3255 3463  .ne 2
3256 3464  .na
3257      -\fB\fB%+\fR\fR
     3465 +\fB%+\fR
3258 3466  .ad
3259 3467  .RS 12n
3260 3468  Equivalent to \fB%%\fR.
3261 3469  .RE
3262 3470  
3263 3471  .sp
3264 3472  .ne 2
3265 3473  .na
3266      -\fB\fB%-\fR\fR
     3474 +\fB%-\fR
3267 3475  .ad
3268 3476  .RS 12n
3269 3477  Previous job.
3270 3478  .RE
3271 3479  
3272 3480  .sp
     3481 +.ne 2
     3482 +In addition, unless noted otherwise, wherever a job can be specified,
     3483 +the name of a background job pool can be used to represent all the
     3484 +jobs in that pool.
     3485 +.na
     3486 +.ad
     3487 +
     3488 +.sp
3273 3489  .LP
3274 3490  The shell learns immediately whenever a process changes state. It normally
3275 3491  informs you whenever a job becomes blocked so that no further progress is
3276 3492  possible, but only just before it prints a prompt. This is done so that it does
3277 3493  not otherwise disturb your work. The notify option of the \fBset\fR command
3278 3494  causes the shell to print these job change messages as soon as they occur.
3279 3495  .sp
3280 3496  .LP
3281 3497  When the \fBmonitor\fR option is on, each background job that completes
3282 3498  triggers any trap set for \fBCHLD\fR.
3283 3499  .sp
3284 3500  .LP
3285 3501  When you try to leave the shell while jobs are running or stopped, you are
3286 3502  warned that \fBYou have stopped(running) jobs.\fR You can use the \fBjobs\fR
3287 3503  command to see what they are. If you immediately try to exit again, the shell
3288 3504  does not warn you a second time, and the stopped jobs are terminated. When a
3289 3505  login shell receives a \fBHUP\fR signal, it sends a \fBHUP\fR signal to each
3290 3506  job that has not been disowned with the \fBdisown\fR built-in command.
3291 3507  .SS "Signals"
3292      -.LP
3293 3508  The \fBINT\fR and \fBQUIT\fR signals for an invoked command are ignored if the
3294 3509  command is followed by \fB&\fR and the \fBmonitor\fR option is not active.
3295 3510  Otherwise, signals have the values inherited by the shell from its parent. See
3296 3511  the \fBtrap\fR built-in command.
3297 3512  .SS "Execution"
3298      -.LP
3299 3513  Each time a command is read, the substitutions are carried out. If the command
3300 3514  name matches one of the ones in the \fBSpecial Built-in Commands\fR section of
3301 3515  this manual page, it is executed within the current shell process. Next, the
3302 3516  command name is checked to see if it matches a user defined function. If it
3303 3517  does, the positional parameters are saved and then reset to the arguments of
3304 3518  the function call. A function is also executed in the current shell process.
3305 3519  When the function completes or issues a return, the positional parameter list
3306 3520  is restored. For functions defined with the \fBfunction\fR \fBname\fR syntax,
3307 3521  any trap set on \fBEXIT\fR within the function is executed. The exit value of a
3308 3522  function is the value of the last command executed. If a command name is not a
3309 3523  special built-in command or a user defined function, but it is one of the
3310 3524  built-in commands, it is executed in the current shell process.
3311 3525  .sp
3312 3526  .LP
3313      -The shell variable \fBPATH\fR defines the search path for the directory
3314      -containing the command. Alternative directory names are separated by a colon
3315      -(\fB:\fR). The default path is \fB/bin:/usr/bin:\fR, specifying \fB/bin\fR,
3316      -\fB/usr/bin\fR, and the current directory in that order. The current directory
3317      -can be specified by two or more adjacent colons, or by a colon at the beginning
3318      -or end of the path list. If the command name contains a slash (\fB/\fR), the
3319      -search path is not used. Otherwise, each directory in the path is searched for
3320      -an executable file of the specified name that is not a directory. If found, and
3321      -if the shell determines that there is a built-in version of a command
3322      -corresponding to a specified pathname, this built-in is invoked in the current
3323      -process. If found, and this directory is also contained in the value of the
3324      -\fBFPATH\fR variable, then this file is loaded into the current shell
3325      -environment as if it were the argument to the . command except that only preset
3326      -aliases are expanded, and a function of the specified name is executed as
3327      -described in this manual page. If not found, and the file \fB\&.paths\fR is
3328      -found, and this file contains a line of the form \fBFPATH=\fR\fIpath\fR where
3329      -\fIpath\fR is an existing directory, and this directory contains a file of the
3330      -specified name, then this file is loaded into the current shell environment as
3331      -if it were the argument to the \fB\&. special\fR built-in command and a
3332      -function of the specified name is executed. Otherwise, if found, a process is
3333      -created and an attempt is made to execute the command using \fBexec\fR(2).
     3527 +The shell variables \fBPATH\fR and \fBFPATH\fR define the search path for the
     3528 +directory containing the command. Alternative directory names are separated by
     3529 +a colon (\fB:\fR). The default path is \fB/bin:/usr/bin:\fR, specifying
     3530 +\fB/bin\fR, \fB/usr/bin\fR, and the current directory in that order. The
     3531 +current directory can be specified by two or more adjacent colons, or by a
     3532 +colon at the beginning or end of the path list. If the command name contains a
     3533 +slash (\fB/\fR), the search path is not used. Otherwise, each directory in the
     3534 +list of directories defined by \fBPATH\fR and \fBFPATH\fR is checked in order.
     3535 +If the directory being searched is contained in the value of the \fBFPATH\fR
     3536 +variable and contains a file whose name matches the command being searched,
     3537 +then this file is loaded into the current shell environment as if it were the
     3538 +argument to the . command except that only preset aliases are expanded, and a
     3539 +function of the specified name is executed as described in this manual page.
3334 3540  .sp
3335 3541  .LP
3336      -When an executable is found, the directory where it is found in is searched for
3337      -a file named \fB\&.paths\fR. If this file is found and it contains a line of
3338      -the form \fBBUILTIN_LIB=\fR\fIvalue\fR, the library named by \fIvalue\fR is
3339      -searched for as if it were an option argument to \fBbuiltin -f\fR, and if it
3340      -contains a built-in of the specified name this is executed instead of a command
3341      -by this name. Otherwise, if this file is found and it contains a line of the
3342      -form \fIname\fR\fB=\fR\fIvalue\fR in the first or second line, then the
3343      -environment variable \fIname\fR is modified by prepending the directory
3344      -specified by \fIvalue\fR to the directory list. If \fIvalue\fR is not an
3345      -absolute directory, then it specifies a directory relative to the directory
3346      -that the executable was found. If the environment variable \fIname\fR does not
3347      -already exist it is added to the environment list for the specified command.
     3542 +If this directory is not in \fBFPATH\fR, the shell first determines whether
     3543 +there is a built-in version of a command corresponding to a given pathname and,
     3544 +if so, it is invoked in the current process. If no built-in is found, the shell
     3545 +checks for a file named \fB\&.paths\fR in this directory. If found and there is
     3546 +a line of the form:
3348 3547  .sp
     3548 +.in +2
     3549 +\fBFPATH=\fR\fIpath\fR
     3550 +.in -2
     3551 +.sp
     3552 +where \fIpath\fR is an existing directory, then that directory is searched
     3553 +immediately after the current directory as if it were found in the \fBFPATH\fR
     3554 +variable. If \fIpath\fR does not begin with \fB/\fR, it is checked for relative
     3555 +to the directory being searched.
     3556 +.sp
3349 3557  .LP
     3558 +The \fB\&.paths\fR file is then checked for a line of the form:
     3559 +.sp
     3560 +.in +2
     3561 +\fBPLUGIN_LIB=\fR\fIlibname\fR [ \fB:\fR \fIlibname\fR \fB]\fR ...
     3562 +.in -2
     3563 +.sp
     3564 +Each library named by \fIlibname\fR will be searched for as if it were an
     3565 +option argument to \fBbuiltin -f\fR and, if it contains a built-in of the
     3566 +specified name, this is executed instead of a command by this name.
     3567 +.sp
     3568 +.LP
     3569 +Any built-in loaded from a library found this way will be associated with the
     3570 +directory containing the \fB.paths\fR file so it will only execute if not found
     3571 +in an earlier directory.
     3572 +.sp
     3573 +.LP
     3574 +Finally, the directory will be checked for a file of the given name.
3350 3575  If the file has execute permission but is not an \fBa.out\fR file, it is
3351 3576  assumed to be a file containing shell commands. A separate shell is spawned to
3352 3577  read it. All non-exported variables are removed in this case. If the shell
3353 3578  command file doesn't have read permission, and/or if the \fBsetuid\fR and
3354 3579  \fBsetgid\fR bits are set on the file, then the shell executes an agent whose
3355 3580  job it is to set up the permissions and execute the shell with the shell
3356      -command file passed down as an open file. A parenthesized command is executed
3357      -in a sub-shell without removing non-exported variables.
     3581 +command file passed down as an open file.
     3582 +
     3583 +If the \fB.paths\fR contains a line of the form:
     3584 +.sp
     3585 +.in +2
     3586 +\fBname=\fR\fIvalue\fR
     3587 +.in -2
     3588 +.sp
     3589 +in the
     3590 +first or second line, then the environment variable \fIname\fR is modified by
     3591 +prepending the directory specified by \fIvalue\fR to the directory list. If
     3592 +\fIvalue\fR is not an absolute directory, then it specifies a directory
     3593 +relative to the directory in which the executable was found. If the environment
     3594 +variable \fIname\fR does not already exist it will be added to the environment
     3595 +list for the specified command.
     3596 +
     3597 +A parenthesized command is executed in a sub-shell without removing
     3598 +non-exported variables.
     3599 +
3358 3600  .SS "Command Re-entry"
3359      -.LP
3360 3601  The text of the last \fBHISTSIZE\fR (default 512) commands entered from a
3361 3602  terminal device is saved in a history file. The file \fB$HOME/.sh_history\fR is
3362 3603  used if the \fBHISTFILE\fR variable is not set or if the file it names is not
3363 3604  writable. A shell can access the commands of all interactive shells which use
3364 3605  the same named \fBHISTFILE\fR. The built-in command \fBhist\fR is used to list
3365 3606  or edit a portion of this file. The portion of the file to be edited or listed
3366 3607  can be selected by number or by giving the first character or characters of the
3367 3608  command. A single command or range of commands can be specified. If you do not
3368 3609  specify an editor program as an argument to \fBhist\fR then the value of the
3369 3610  variable \fBHISTEDIT\fR is used. If \fBHISTEDIT\fR is unset, the obsolete
↓ open down ↓ 1 lines elided ↑ open up ↑
3371 3612  \fB/bin/ed\fR is used. The edited commands are printed and executed again upon
3372 3613  leaving the editor unless you quit without writing. The \fB-s\fR option (and in
3373 3614  obsolete versions, the editor name \fB-\fR) is used to skip the editing phase
3374 3615  and to re-execute the command. In this case a substitution parameter of the
3375 3616  form \fIold\fR\fB=\fR\fInew\fRcan be used to modify the command before
3376 3617  execution. For example, with the preset alias \fBr\fR, which is aliased to
3377 3618  \fB\&'hist -s'\fR, typing \fB`r bad=good c'\fR re-executes the most recent
3378 3619  command which starts with the letter \fBc\fR, replacing the first occurrence of
3379 3620  the string bad with the string good.
3380 3621  .SS "Inline Editing Options"
3381      -.LP
3382 3622  Normally, each command line entered from a terminal device is simply typed
3383 3623  followed by a NEWLINE (RETURN or LINE FEED). If either the \fBemacs\fR,
3384 3624  \fBgmacs\fR, or \fBvi\fR option is active, the user can edit the command line.
3385 3625  To be in either of these edit modes set the corresponding option. An editing
3386 3626  option is automatically selected each time the \fBVISUAL\fR or \fBEDITOR\fR
3387 3627  variable is assigned a value ending in either of these option names.
3388 3628  .sp
3389 3629  .LP
3390 3630  The editing features require that the user's terminal accept RETURN as carriage
3391 3631  return without line feed and that a SPACE must overwrite the current character
↓ open down ↓ 34 lines elided ↑ open up ↑
3426 3666  appended if the file is a directory and a space is appended if the file is not
3427 3667  a directory. Otherwise, the longest common prefix for all the matching files
3428 3668  replaces the word. For command name completion, only the portion of the file
3429 3669  names after the last \fB/\fR are used to find the longest command prefix. If
3430 3670  only a single name matches this prefix, then the word is replaced with the
3431 3671  command name followed by a space. When using a \fBTAB\fR for completion that
3432 3672  does not yield a unique match, a subsequent TAB provides a numbered list of
3433 3673  matching alternatives. A specific selection can be made by entering the
3434 3674  selection number followed by a TAB.
3435 3675  .SS "Key Bindings"
3436      -.LP
3437 3676  The \fBKEYBD\fR trap can be used to intercept keys as they are typed and change
3438 3677  the characters that are actually seen by the shell. This trap is executed after
3439 3678  each character (or sequence of characters when the first character is ESC) is
3440 3679  entered while reading from a terminal.
3441 3680  .sp
3442 3681  .LP
3443 3682  The variable \fB\&.sh.edchar\fR contains the character or character sequence
3444 3683  which generated the trap. Changing the value of \fB\&.sh.edchar\fR in the trap
3445 3684  action causes the shell to behave as if the new value were entered from the
3446 3685  keyboard rather than the original value. The variable \fB\&.sh.edcol\fR is set
3447 3686  to the input column number of the cursor at the time of the input. The variable
3448 3687  \fB\&.sh.edmode\fR is set to \fBESC\fR when in \fBvi\fR insert mode and is null
3449 3688  otherwise. By prepending \fB${.sh.editmode}\fR to a value assigned to
3450 3689  \fB\&.sh.edchar\fR it causes the shell to change to control mode if it is not
3451 3690  already in this mode.
3452 3691  .sp
3453 3692  .LP
3454 3693  This trap is not invoked for characters entered as arguments to editing
3455 3694  directives, or while reading input for a character search.
3456 3695  .SS "\fBemacs\fR Editing Mode"
3457      -.LP
3458 3696  This mode is entered by enabling either the \fBemacs\fR or \fBgmacs\fR option.
3459 3697  The only difference between these two modes is the way they handle \fB^T\fR. To
3460 3698  edit, the user moves the cursor to the point needing correction and then
3461 3699  inserts or deletes characters or words as needed. All the editing commands are
3462 3700  control characters or escape sequences. The notation for control characters is
3463 3701  caret (\fB^\fR) followed by the character.
3464 3702  .sp
3465 3703  .LP
3466 3704  For example, \fB^F\fR is the notation for CTRL/F. This is entered by depressing
3467 3705  \fBf\fR while holding down the CTRL (control) key. The SHIFT key is not
↓ open down ↓ 5 lines elided ↑ open up ↑
3473 3711  (\fBASCII 033\fR) followed by \fBf\fR. \fBM-F\fR is the notation for ESC
3474 3712  followed by \fBF\fR.
3475 3713  .sp
3476 3714  .LP
3477 3715  All edit commands operate from any place on the line, not just at the
3478 3716  beginning. The RETURN or the LINE FEED key is not entered after edit commands
3479 3717  except when noted.
3480 3718  .sp
3481 3719  .ne 2
3482 3720  .na
3483      -\fB\fB^F\fR\fR
     3721 +\fB^F\fR
3484 3722  .ad
3485 3723  .RS 13n
3486 3724  Move the cursor forward (right) one character.
3487 3725  .RE
3488 3726  
3489 3727  .sp
3490 3728  .ne 2
3491 3729  .na
3492      -\fB\fBM-[C\fR\fR
     3730 +\fBM-[C\fR
3493 3731  .ad
3494 3732  .RS 13n
3495 3733  Move the cursor forward (right) one character.
3496 3734  .RE
3497 3735  
3498 3736  .sp
3499 3737  .ne 2
3500 3738  .na
3501      -\fB\fBM-f\fR\fR
     3739 +\fBM-f\fR
3502 3740  .ad
3503 3741  .RS 13n
3504 3742  Move the cursor forward one word. The \fBemacs\fR editor's idea of a word is a
3505 3743  string of characters consisting of only letters, digits and underscores.
3506 3744  .RE
3507 3745  
3508 3746  .sp
3509 3747  .ne 2
3510 3748  .na
3511      -\fB\fB^B\fR\fR
     3749 +\fB^B\fR
3512 3750  .ad
3513 3751  .RS 13n
3514 3752  Move the cursor backward (left) one character.
3515 3753  .RE
3516 3754  
3517 3755  .sp
3518 3756  .ne 2
3519 3757  .na
3520      -\fB\fBM-[D\fR\fR
     3758 +\fBM-[D\fR
3521 3759  .ad
3522 3760  .RS 13n
3523 3761  Move the cursor backward (left) one character.
3524 3762  .RE
3525 3763  
3526 3764  .sp
3527 3765  .ne 2
3528 3766  .na
3529      -\fB\fBM-b\fR\fR
     3767 +\fBM-b\fR
3530 3768  .ad
3531 3769  .RS 13n
3532 3770  Move the cursor backward one word.
3533 3771  .RE
3534 3772  
3535 3773  .sp
3536 3774  .ne 2
3537 3775  .na
3538      -\fB\fB^A\fR\fR
     3776 +\fB^A\fR
3539 3777  .ad
3540 3778  .RS 13n
3541 3779  Move the cursor to the beginning of the line.
3542 3780  .RE
3543 3781  
3544 3782  .sp
3545 3783  .ne 2
3546 3784  .na
3547      -\fB\fBM-[H\fR\fR
     3785 +\fBM-[H\fR
3548 3786  .ad
3549 3787  .RS 13n
3550 3788  Move the cursor to the beginning of the line.
3551 3789  .RE
3552 3790  
3553 3791  .sp
3554 3792  .ne 2
3555 3793  .na
3556      -\fB\fB^E\fR\fR
     3794 +\fB^E\fR
3557 3795  .ad
3558 3796  .RS 13n
3559 3797  Move the cursor to the end of the line.
3560 3798  .RE
3561 3799  
3562 3800  .sp
3563 3801  .ne 2
3564 3802  .na
3565      -\fB\fBM-[Y\fR\fR
     3803 +\fBM-[Y\fR
3566 3804  .ad
3567 3805  .RS 13n
3568 3806  Move the cursor to the end of line.
3569 3807  .RE
3570 3808  
3571 3809  .sp
3572 3810  .ne 2
3573 3811  .na
3574      -\fB\fB^]\fR\fIchar\fR\fR
     3812 +\fB^]\fR\fIchar\fR
3575 3813  .ad
3576 3814  .RS 13n
3577 3815  Move the cursor forward to the character \fIchar\fR on the current line.
3578 3816  .RE
3579 3817  
3580 3818  .sp
3581 3819  .ne 2
3582 3820  .na
3583      -\fB\fBM-^]\fR\fIchar\fR\fR
     3821 +\fBM-^]\fR\fIchar\fR
3584 3822  .ad
3585 3823  .RS 13n
3586 3824  Move the cursor backwards to the character \fIchar\fR on the current line.
3587 3825  .RE
3588 3826  
3589 3827  .sp
3590 3828  .ne 2
3591 3829  .na
3592      -\fB\fB^X^X\fR\fR
     3830 +\fB^X^X\fR
3593 3831  .ad
3594 3832  .RS 13n
3595 3833  Interchange the cursor and the mark.
3596 3834  .RE
3597 3835  
3598 3836  .sp
3599 3837  .ne 2
3600 3838  .na
3601      -\fB\fIerase\fR\fR
     3839 +\fB\fIerase\fR
3602 3840  .ad
3603 3841  .RS 13n
3604 3842  Delete the previous character. The user-defined erase character is defined by
3605 3843  the \fBstty\fR(1) command, and is usually \fB^H\fR or \fB#\fR.
3606 3844  .RE
3607 3845  
3608 3846  .sp
3609 3847  .ne 2
3610 3848  .na
3611      -\fB\fIlnext\fR\fR
     3849 +\fB\fIlnext\fR
3612 3850  .ad
3613 3851  .RS 13n
3614 3852  Removes the next character's editing features. The user-defined literal next
3615 3853  character is defined by the \fBstty\fR(1) command, or is \fB^V\fR if not
3616 3854  defined.
3617 3855  .RE
3618 3856  
3619 3857  .sp
3620 3858  .ne 2
3621 3859  .na
3622      -\fB\fB^D\fR\fR
     3860 +\fB^D\fR
3623 3861  .ad
3624 3862  .RS 13n
3625 3863  Delete the current character.
3626 3864  .RE
3627 3865  
3628 3866  .sp
3629 3867  .ne 2
3630 3868  .na
3631      -\fB\fBM-d\fR\fR
     3869 +\fBM-d\fR
3632 3870  .ad
3633 3871  .RS 13n
3634 3872  Delete the current word.
3635 3873  .RE
3636 3874  
3637 3875  .sp
3638 3876  .ne 2
3639 3877  .na
3640      -\fB\fBM-^H\fR\fR
     3878 +\fBM-^H\fR
3641 3879  .ad
3642 3880  .RS 13n
3643 3881  MetaBACKSPACE. Delete the previous word.
3644 3882  .RE
3645 3883  
3646 3884  .sp
3647 3885  .ne 2
3648 3886  .na
3649      -\fB\fBM-h\fR\fR
     3887 +\fBM-h\fR
3650 3888  .ad
3651 3889  .RS 13n
3652 3890  Delete the previous word.
3653 3891  .RE
3654 3892  
3655 3893  .sp
3656 3894  .ne 2
3657 3895  .na
3658      -\fB\fBM-^?\fR\fR
     3896 +\fBM-^?\fR
3659 3897  .ad
3660 3898  .RS 13n
3661 3899  MetaDEL. Delete the previous word. If your interrupt character is \fB^?\fR
3662 3900  (DEL, the default), this command does not work.
3663 3901  .RE
3664 3902  
3665 3903  .sp
3666 3904  .ne 2
3667 3905  .na
3668      -\fB\fB^T\fR\fR
     3906 +\fB^T\fR
3669 3907  .ad
3670 3908  .RS 13n
3671 3909  Transpose the current character with the previous character, and advance the
3672 3910  cursor in \fBemacs\fR mode. Transpose two previous characters in \fBgmacs\fR
3673 3911  mode.
3674 3912  .RE
3675 3913  
3676 3914  .sp
3677 3915  .ne 2
3678 3916  .na
3679      -\fB\fB^C\fR\fR
     3917 +\fB^C\fR
3680 3918  .ad
3681 3919  .RS 13n
3682 3920  Capitalize the current character.
3683 3921  .RE
3684 3922  
3685 3923  .sp
3686 3924  .ne 2
3687 3925  .na
3688      -\fB\fBM-c\fR\fR
     3926 +\fBM-c\fR
3689 3927  .ad
3690 3928  .RS 13n
3691 3929  Capitalize the current word.
3692 3930  .RE
3693 3931  
3694 3932  .sp
3695 3933  .ne 2
3696 3934  .na
3697      -\fB\fBM-l\fR\fR
     3935 +\fBM-l\fR
3698 3936  .ad
3699 3937  .RS 13n
3700 3938  Change the current word to lower case.
3701 3939  .RE
3702 3940  
3703 3941  .sp
3704 3942  .ne 2
3705 3943  .na
3706      -\fB\fB^K\fR\fR
     3944 +\fB^K\fR
3707 3945  .ad
3708 3946  .RS 13n
3709 3947  Delete from the cursor to the end of the line. If preceded by a numerical
3710 3948  parameter whose value is less than the current cursor position, delete from
3711 3949  specified position up to the cursor. If preceded by a numerical parameter whose
3712 3950  value is greater than the current cursor position, then delete from cursor up
3713 3951  to specified cursor position.
3714 3952  .RE
3715 3953  
3716 3954  .sp
3717 3955  .ne 2
3718 3956  .na
3719      -\fB\fB^W\fR\fR
     3957 +\fB^W\fR
3720 3958  .ad
3721 3959  .RS 13n
3722 3960  Kill from the cursor to the mark.
3723 3961  .RE
3724 3962  
3725 3963  .sp
3726 3964  .ne 2
3727 3965  .na
3728      -\fB\fBM-p\fR\fR
     3966 +\fBM-p\fR
3729 3967  .ad
3730 3968  .RS 13n
3731 3969  Push the region from the cursor to the mark on the stack.
3732 3970  .RE
3733 3971  
3734 3972  .sp
3735 3973  .ne 2
3736 3974  .na
3737      -\fB\fIkill\fR\fR
     3975 +\fB\fIkill\fR
3738 3976  .ad
3739 3977  .RS 13n
3740 3978  Kill the entire current line. The user-defined kill character is defined by the
3741 3979  \fBstty\fR(1) command, usually a \fB^G\fR or \fB@\fR. If two kill characters
3742 3980  are entered in succession, all kill characters from then on cause a line feed.
3743 3981  This is useful when using paper terminals.
3744 3982  .RE
3745 3983  
3746 3984  .sp
3747 3985  .ne 2
3748 3986  .na
3749      -\fB\fB^Y\fR\fR
     3987 +\fB^Y\fR
3750 3988  .ad
3751 3989  .RS 13n
3752 3990  Restore the last item removed from line. Yank the item back to the line.
3753 3991  .RE
3754 3992  
3755 3993  .sp
3756 3994  .ne 2
3757 3995  .na
3758      -\fB\fB^L\fR\fR
     3996 +\fB^L\fR
3759 3997  .ad
3760 3998  .RS 13n
3761 3999  Line feed and print the current line.
3762 4000  .RE
3763 4001  
3764 4002  .sp
3765 4003  .ne 2
3766 4004  .na
3767      -\fB\fBM-^L\fR\fR
     4005 +\fBM-^L\fR
3768 4006  .ad
3769 4007  .RS 13n
3770 4008  Clear the screen.
3771 4009  .RE
3772 4010  
3773 4011  .sp
3774 4012  .ne 2
3775 4013  .na
3776      -\fB\fB^@\fR\fR
     4014 +\fB^@\fR
3777 4015  .ad
3778 4016  .RS 13n
3779 4017  Null character. Set mark.
3780 4018  .RE
3781 4019  
3782 4020  .sp
3783 4021  .ne 2
3784 4022  .na
3785      -\fB\fBM-\fR\fIspace\fR\fR
     4023 +\fBM-\fR\fIspace\fR
3786 4024  .ad
3787 4025  .RS 13n
3788 4026  MetaSPACE. Set the mark.
3789 4027  .RE
3790 4028  
3791 4029  .sp
3792 4030  .ne 2
3793 4031  .na
3794      -\fB\fB^J\fR\fR
     4032 +\fB^J\fR
3795 4033  .ad
3796 4034  .RS 13n
3797 4035  New line. Execute the current line.
3798 4036  .RE
3799 4037  
3800 4038  .sp
3801 4039  .ne 2
3802 4040  .na
3803      -\fB\fB^M\fR\fR
     4041 +\fB^M\fR
3804 4042  .ad
3805 4043  .RS 13n
3806 4044  Return. Execute the current line.
3807 4045  .RE
3808 4046  
3809 4047  .sp
3810 4048  .ne 2
3811 4049  .na
3812      -\fB\fBEOF\fR\fR
     4050 +\fBEOF\fR
3813 4051  .ad
3814 4052  .RS 13n
3815 4053  End-of-file character, normally \fB^D\fR, is processed as an \fBend-of-file\fR
3816 4054  only if the current line is null.
3817 4055  .RE
3818 4056  
3819 4057  .sp
3820 4058  .ne 2
3821 4059  .na
3822      -\fB\fB^P\fR\fR
     4060 +\fB^P\fR
3823 4061  .ad
3824 4062  .RS 13n
3825 4063  Fetch the previous command. Each time \fB^P\fR is entered the previous command
3826 4064  back in time is accessed. Moves back one line when it is not on the first line
3827 4065  of a multi-line command.
3828 4066  .RE
3829 4067  
3830 4068  .sp
3831 4069  .ne 2
3832 4070  .na
3833      -\fB\fBM-[A\fR\fR
     4071 +\fBM-[A\fR
3834 4072  .ad
3835 4073  .RS 13n
3836 4074  Equivalent to \fB^P\fR.
3837 4075  .RE
3838 4076  
3839 4077  .sp
3840 4078  .ne 2
3841 4079  .na
3842      -\fB\fBM-<\fR\fR
     4080 +\fBM-<\fR
3843 4081  .ad
3844 4082  .RS 13n
3845 4083  Fetch the least recent (oldest) history line.
3846 4084  .RE
3847 4085  
3848 4086  .sp
3849 4087  .ne 2
3850 4088  .na
3851      -\fB\fBM->\fR\fR
     4089 +\fBM->\fR
3852 4090  .ad
3853 4091  .RS 13n
3854 4092  Fetch the most recent (youngest) history line.
3855 4093  .RE
3856 4094  
3857 4095  .sp
3858 4096  .ne 2
3859 4097  .na
3860      -\fB\fB^N\fR\fR
     4098 +\fB^N\fR
3861 4099  .ad
3862 4100  .RS 13n
3863 4101  Fetch the next command line. Each time \fB^N\fR is entered the next command
3864 4102  line forward in time is accessed.
3865 4103  .RE
3866 4104  
3867 4105  .sp
3868 4106  .ne 2
3869 4107  .na
3870      -\fB\fBM-[B\fR\fR
     4108 +\fBM-[B\fR
3871 4109  .ad
3872 4110  .RS 13n
3873 4111  Equivalent to \fB^N\fR.
3874 4112  .RE
3875 4113  
3876 4114  .sp
3877 4115  .ne 2
3878 4116  .na
3879      -\fB\fB^R\fR\fIstring\fR\fR
     4117 +\fB^R\fR\fIstring\fR
3880 4118  .ad
3881 4119  .RS 13n
3882 4120  Reverse search history for a previous command line containing \fIstring\fR. If
3883 4121  a parameter of zero is specified, the search is forward. \fIstring\fR is
3884 4122  terminated by a RETURN or NEWLINE. If string is preceded by a \fB^\fR, the
3885 4123  matched line must begin with \fIstring\fR. If \fIstring\fR is omitted, then the
3886 4124  next command line containing the most recent \fIstring\fR is accessed. In this
3887 4125  case a parameter of zero reverses the direction of the search.
3888 4126  .RE
3889 4127  
3890 4128  .sp
3891 4129  .ne 2
3892 4130  .na
3893      -\fB\fB^O\fR\fR
     4131 +\fB^O\fR
3894 4132  .ad
3895 4133  .RS 13n
3896 4134  Operate. Execute the current line and fetch the next line relative to current
3897 4135  line from the history file.
3898 4136  .RE
3899 4137  
3900 4138  .sp
3901 4139  .ne 2
3902 4140  .na
3903      -\fB\fBM-\fR\fIdigits\fR\fR
     4141 +\fBM-\fR\fIdigits\fR
3904 4142  .ad
3905 4143  .RS 13n
3906 4144  Escape. Define numeric parameter. The digits are taken as a parameter to the
3907 4145  next command. The commands that accept a parameter are: \fB^F\fR, \fB^B\fR,
3908 4146  \fBERASE\fR, \fB^C\fR, \fB^D\fR, \fB^K\fR, \fB^R\fR, \fB^P\fR, \fB^N\fR,
3909 4147  \fB^]\fR, \fBM-.\fR, \fBM-\fR, \fBM-^]\fR, \fBM-_\fR, \fBM-=\fR, \fBM-b\fR,
3910 4148  \fBM-c\fR, \fBM-d\fR, \fBM-f\fR, \fBM-h\fR, \fBM-l\fR, and \fBM-^H\fR.
3911 4149  .RE
3912 4150  
3913 4151  .sp
3914 4152  .ne 2
3915 4153  .na
3916      -\fB\fBM-\fR\fIletter\fR\fR
     4154 +\fBM-\fR\fIletter\fR
3917 4155  .ad
3918 4156  .RS 13n
3919 4157  Soft-key. Search the alias list for an alias by the name \fIletter\fR. If an
3920 4158  alias of \fIletter\fR is defined, insert its value on the input queue.
3921 4159  \fIletter\fR must not be one of the metafunctions in this section.
3922 4160  .RE
3923 4161  
3924 4162  .sp
3925 4163  .ne 2
3926 4164  .na
3927      -\fB\fBM-[\fR\fIletter\fR\fR
     4165 +\fBM-[\fR\fIletter\fR
3928 4166  .ad
3929 4167  .RS 13n
3930 4168  Soft key. Search the alias list for an alias by the name \fIletter\fR. If an
3931 4169  alias of this name is defined, insert its value on the input queue. This can be
3932 4170  used to program function keys on many terminals.
3933 4171  .RE
3934 4172  
3935 4173  .sp
3936 4174  .ne 2
3937 4175  .na
3938      -\fB\fBM-.\fR\fR
     4176 +\fBM-.\fR
3939 4177  .ad
3940 4178  .RS 13n
3941 4179  The last word of the previous command is inserted on the line. If preceded by a
3942 4180  numeric parameter, the value of this parameter determines which word to insert
3943 4181  rather than the last word.
3944 4182  .RE
3945 4183  
3946 4184  .sp
3947 4185  .ne 2
3948 4186  .na
3949      -\fB\fBM-_\fR\fR
     4187 +\fBM-_\fR
3950 4188  .ad
3951 4189  .RS 13n
3952 4190  Same as \fBM-.\fR.
3953 4191  .RE
3954 4192  
3955 4193  .sp
3956 4194  .ne 2
3957 4195  .na
3958      -\fB\fBM-*\fR\fR
     4196 +\fBM-*\fR
3959 4197  .ad
3960 4198  .RS 13n
3961 4199  Attempt filename generation on the current word. As asterisk is appended if the
3962 4200  word does not match any file or contain any special pattern characters.
3963 4201  .RE
3964 4202  
3965 4203  .sp
3966 4204  .ne 2
3967 4205  .na
3968      -\fB\fBM-\fRESC\fR
     4206 +\fBM-\fRESC\fR
3969 4207  .ad
3970 4208  .RS 13n
3971 4209  Command or file name completion as described in this manual page.
3972 4210  .RE
3973 4211  
3974 4212  .sp
3975 4213  .ne 2
3976 4214  .na
3977      -\fB\fB^I\fRTAB\fR
     4215 +\fB^I\fRTAB\fR
3978 4216  .ad
3979 4217  .RS 13n
3980 4218  Attempts command or file name completion as described in this manual page. If a
3981 4219  partial completion occurs, repeating this behaves as if \fBM-=\fR were entered.
3982 4220  If no match is found or entered after SPACE, a TAB is inserted.
3983 4221  .RE
3984 4222  
3985 4223  .sp
3986 4224  .ne 2
3987 4225  .na
3988      -\fB\fBM-=\fR\fR
     4226 +\fBM-=\fR
3989 4227  .ad
3990 4228  .RS 13n
3991 4229  If not preceded by a numeric parameter, generates the list of matching commands
3992 4230  or file names as described in this manual page. Otherwise, the word under the
3993 4231  cursor is replaced by the item corresponding to the value of the numeric
3994 4232  parameter from the most recently generated command or file list. If the cursor
3995 4233  is not on a word, the word is inserted instead.
3996 4234  .RE
3997 4235  
3998 4236  .sp
3999 4237  .ne 2
4000 4238  .na
4001      -\fB\fB^U\fR\fR
     4239 +\fB^U\fR
4002 4240  .ad
4003 4241  .RS 13n
4004 4242  Multiply parameter of next command by \fB4\fR.
4005 4243  .RE
4006 4244  
4007 4245  .sp
4008 4246  .ne 2
4009 4247  .na
4010      -\fB\fB\e\fR\fR
     4248 +\fB\e\fR
4011 4249  .ad
4012 4250  .RS 13n
4013 4251  Escape the next character. Editing characters, the user's erase, kill and
4014 4252  interrupt (normally \fB^?\fR) characters can be entered in a command line or in
4015 4253  a search string if preceded by a \fB\e\fR\&. The \fB\e\fR removes the next
4016 4254  character's editing features, if any.
4017 4255  .RE
4018 4256  
4019 4257  .sp
4020 4258  .ne 2
4021 4259  .na
4022      -\fB\fBM-^V\fR\fR
     4260 +\fBM-^V\fR
4023 4261  .ad
4024 4262  .RS 13n
4025 4263  Display the version of the shell.
4026 4264  .RE
4027 4265  
4028 4266  .sp
4029 4267  .ne 2
4030 4268  .na
4031      -\fB\fBM-#\fR\fR
     4269 +\fBM-#\fR
4032 4270  .ad
4033 4271  .RS 13n
4034 4272  If the line does not begin with a \fB#\fR, a \fB#\fR is inserted at the
4035 4273  beginning of the line and after each NEWLINE, and the line is entered. This
4036 4274  causes a comment to be inserted in the history file. If the line begins with a
4037 4275  \fB#\fR, the \fB#\fR is deleted and one \fB#\fR after each NEWLINE is also
4038 4276  deleted.
4039 4277  .RE
4040 4278  
4041 4279  .SS "\fBvi\fR Editing Mode"
4042      -.LP
4043 4280  There are two typing modes. Initially, when you enter a command you are in the
4044 4281  input mode. To edit, the user enters control mode by typing ESC (033) and moves
4045 4282  the cursor to the point needing correction and then inserts or deletes
4046 4283  characters or words as needed. Most control commands accept an optional repeat
4047 4284  \fIcount\fR prior to the command.
4048 4285  .sp
4049 4286  .LP
4050 4287  When in vi mode on most systems, canonical processing is initially enabled and
4051 4288  the command is echoed again if the speed is 1200 baud or greater and it
4052 4289  contains any control characters or less than one second has elapsed since the
4053 4290  prompt was printed. The ESC character terminates canonical processing for the
4054 4291  remainder of the command and the user can then modify the command line. This
4055 4292  scheme has the advantages of canonical processing with the type-ahead echoing
4056 4293  of raw mode.
4057 4294  .sp
4058 4295  .LP
4059 4296  If the option \fBviraw\fR is also set, the terminal is always have canonical
4060 4297  processing disabled. This mode is implicit for systems that do not support two
4061 4298  alternate end of line delimiters, and might be helpful for certain terminals.
4062 4299  .SS "Input Edit Commands"
4063      -.LP
4064 4300  By default the editor is in input mode.
4065 4301  .sp
4066 4302  .LP
4067 4303  The following input edit commands are supported:
4068 4304  .sp
4069 4305  .ne 2
4070 4306  .na
4071 4307  \fBERASE\fR
4072 4308  .ad
4073 4309  .RS 10n
4074 4310  User defined erase character as defined by the \fBstty\fR command, usually
4075 4311  \fB^H\fR or \fB#\fR. Delete previous character.
4076 4312  .RE
4077 4313  
4078 4314  .sp
4079 4315  .ne 2
4080 4316  .na
4081      -\fB\fB^W\fR\fR
     4317 +\fB^W\fR
4082 4318  .ad
4083 4319  .RS 10n
4084 4320  Delete the previous blank separated word. On some systems the \fBviraw\fR
4085 4321  option might be required for this to work.
4086 4322  .RE
4087 4323  
4088 4324  .sp
4089 4325  .ne 2
4090 4326  .na
4091 4327  \fBEOF\fR
4092 4328  .ad
4093 4329  .RS 10n
4094 4330  As the first character of the line causes the shell to terminate unless the
4095 4331  \fBignoreeof\fR option is set. Otherwise this character is ignored.
4096 4332  .RE
4097 4333  
4098 4334  .sp
4099 4335  .ne 2
4100 4336  .na
4101      -\fB\fIlnext\fR\fR
     4337 +\fB\fIlnext\fR
4102 4338  .ad
4103 4339  .RS 10n
4104 4340  User defined literal next character as defined by the \fBstty\fR(1) or \fB^V\fR
4105 4341  if not defined. Removes the next character's editing features, if any. On some
4106 4342  systems the \fBviraw\fR option might be required for this to work.
4107 4343  .RE
4108 4344  
4109 4345  .sp
4110 4346  .ne 2
4111 4347  .na
4112      -\fB\fB\e\fR\fR
     4348 +\fB\e\fR
4113 4349  .ad
4114 4350  .RS 10n
4115 4351  Escape the next ERASE or KILL character.
4116 4352  .RE
4117 4353  
4118 4354  .sp
4119 4355  .ne 2
4120 4356  .na
4121      -\fB\fB^I\fR TAB\fR
     4357 +\fB^I\fR TAB\fR
4122 4358  .ad
4123 4359  .RS 10n
4124 4360  Attempts command or file name completion as described in this manual page and
4125 4361  returns to input mode. If a partial completion occurs, repeating this behaves
4126 4362  as if \fB=\fR were entered from control mode. If no match is found or entered
4127 4363  after SPACE, a TAB is inserted.
4128 4364  .RE
4129 4365  
4130 4366  .SS "Motion Edit Commands"
4131      -.LP
4132 4367  The motion edit commands move the cursor.
4133 4368  .sp
4134 4369  .LP
4135 4370  The following motion edit commands are supported:
4136 4371  .sp
4137 4372  .ne 2
4138 4373  .na
4139      -\fB\fB[\fR\fIcount\fR\fB]l\fR\fR
     4374 +\fB[\fR\fIcount\fR\fB]l\fR
4140 4375  .ad
4141 4376  .RS 13n
4142 4377  Move the cursor forward (right) one character.
4143 4378  .RE
4144 4379  
4145 4380  .sp
4146 4381  .ne 2
4147 4382  .na
4148      -\fB\fB[\fR\fIcount\fR\fB][C\fR\fR
     4383 +\fB[\fR\fIcount\fR\fB][C\fR
4149 4384  .ad
4150 4385  .RS 13n
4151 4386  Move the cursor forward (right) one character.
4152 4387  .RE
4153 4388  
4154 4389  .sp
4155 4390  .ne 2
4156 4391  .na
4157      -\fB\fB[\fR\fIcount\fR\fB]w\fR\fR
     4392 +\fB[\fR\fIcount\fR\fB]w\fR
4158 4393  .ad
4159 4394  .RS 13n
4160 4395  Move the cursor forward one alphanumeric word.
4161 4396  .RE
4162 4397  
4163 4398  .sp
4164 4399  .ne 2
4165 4400  .na
4166      -\fB\fB[\fR\fIcount\fR\fB]W\fR\fR
     4401 +\fB[\fR\fIcount\fR\fB]W\fR
4167 4402  .ad
4168 4403  .RS 13n
4169 4404  Move the cursor to the beginning of the next word that follows a blank.
4170 4405  .RE
4171 4406  
4172 4407  .sp
4173 4408  .ne 2
4174 4409  .na
4175      -\fB\fB[\fR\fIcount\fR\fB]e\fR\fR
     4410 +\fB[\fR\fIcount\fR\fB]e\fR
4176 4411  .ad
4177 4412  .RS 13n
4178 4413  Move the cursor to the end of the word.
4179 4414  .RE
4180 4415  
4181 4416  .sp
4182 4417  .ne 2
4183 4418  .na
4184      -\fB\fB[\fR\fIcount\fR\fB]E\fR\fR
     4419 +\fB[\fR\fIcount\fR\fB]E\fR
4185 4420  .ad
4186 4421  .RS 13n
4187 4422  Move the cursor to the end of the current blank delimited word.
4188 4423  .RE
4189 4424  
4190 4425  .sp
4191 4426  .ne 2
4192 4427  .na
4193      -\fB\fB[\fR\fIcount\fR\fB]h\fR\fR
     4428 +\fB[\fR\fIcount\fR\fB]h\fR
4194 4429  .ad
4195 4430  .RS 13n
4196 4431  Move the cursor backward (left) one character.
4197 4432  .RE
4198 4433  
4199 4434  .sp
4200 4435  .ne 2
4201 4436  .na
4202      -\fB\fB[\fR\fIcount\fR\fB][D\fR\fR
     4437 +\fB[\fR\fIcount\fR\fB][D\fR
4203 4438  .ad
4204 4439  .RS 13n
4205 4440  Move the cursor backward (left) one character.
4206 4441  .RE
4207 4442  
4208 4443  .sp
4209 4444  .ne 2
4210 4445  .na
4211      -\fB\fB[\fR\fIcount\fR\fB]b\fR\fR
     4446 +\fB[\fR\fIcount\fR\fB]b\fR
4212 4447  .ad
4213 4448  .RS 13n
4214 4449  Move the cursor backward one word.
4215 4450  .RE
4216 4451  
4217 4452  .sp
4218 4453  .ne 2
4219 4454  .na
4220      -\fB\fB[\fR\fIcount\fR\fB]B\fR\fR
     4455 +\fB[\fR\fIcount\fR\fB]B\fR
4221 4456  .ad
4222 4457  .RS 13n
4223 4458  Move the cursor to the preceding blank separated word.
4224 4459  .RE
4225 4460  
4226 4461  .sp
4227 4462  .ne 2
4228 4463  .na
4229      -\fB\fB[\fR\fIcount\fR\fB]|\fR\fR
     4464 +\fB[\fR\fIcount\fR\fB]|\fR
4230 4465  .ad
4231 4466  .RS 13n
4232 4467  Move the cursor to column \fIcount\fR.
4233 4468  .RE
4234 4469  
4235 4470  .sp
4236 4471  .ne 2
4237 4472  .na
4238      -\fB\fB[\fR\fIcount\fR\fB]f\fR\fIc\fR\fR
     4473 +\fB[\fR\fIcount\fR\fB]f\fR\fIc\fR
4239 4474  .ad
4240 4475  .RS 13n
4241 4476  Find the next character \fIc\fR in the current line.
4242 4477  .RE
4243 4478  
4244 4479  .sp
4245 4480  .ne 2
4246 4481  .na
4247      -\fB\fB[\fR\fIcount\fR\fB]F\fR\fIc\fR\fR
     4482 +\fB[\fR\fIcount\fR\fB]F\fR\fIc\fR
4248 4483  .ad
4249 4484  .RS 13n
4250 4485  Find the previous character \fIc\fR in the current line.
4251 4486  .RE
4252 4487  
4253 4488  .sp
4254 4489  .ne 2
4255 4490  .na
4256      -\fB\fB[\fR\fIcount\fR\fB]t\fR\fIC\fR\fR
     4491 +\fB[\fR\fIcount\fR\fB]t\fR\fIC\fR
4257 4492  .ad
4258 4493  .RS 13n
4259 4494  Equivalent to \fBf\fR followed by \fBh\fR.
4260 4495  .RE
4261 4496  
4262 4497  .sp
4263 4498  .ne 2
4264 4499  .na
4265      -\fB\fB[\fR\fIcount\fR\fB]T\fR\fIc\fR\fR
     4500 +\fB[\fR\fIcount\fR\fB]T\fR\fIc\fR
4266 4501  .ad
4267 4502  .RS 13n
4268 4503  Equivalent to \fBF\fR followed by \fBl\fR.
4269 4504  .RE
4270 4505  
4271 4506  .sp
4272 4507  .ne 2
4273 4508  .na
4274      -\fB\fB[\fR\fIcount\fR\fB];\fR\fR
     4509 +\fB[\fR\fIcount\fR\fB];\fR
4275 4510  .ad
4276 4511  .RS 13n
4277 4512  Repeat \fIcount\fR times the last single character find command: \fBf\fR,
4278 4513  \fBF\fR, \fBt,\fR or \fBT\fR.
4279 4514  .RE
4280 4515  
4281 4516  .sp
4282 4517  .ne 2
4283 4518  .na
4284      -\fB\fB[\fR\fIcount\fR\fB],\fR\fR
     4519 +\fB[\fR\fIcount\fR\fB],\fR
4285 4520  .ad
4286 4521  .RS 13n
4287 4522  Reverse the last single character find command \fIcount\fR times.
4288 4523  .RE
4289 4524  
4290 4525  .sp
4291 4526  .ne 2
4292 4527  .na
4293      -\fB\fB0\fR\fR
     4528 +\fB0\fR
4294 4529  .ad
4295 4530  .RS 13n
4296 4531  Move the cursor to the start of line.
4297 4532  .RE
4298 4533  
4299 4534  .sp
4300 4535  .ne 2
4301 4536  .na
4302      -\fB\fB^\fR\fR
     4537 +\fB^\fR
4303 4538  .ad
4304 4539  .RS 13n
4305 4540  Move the cursor to start of line.
4306 4541  .RE
4307 4542  
4308 4543  .sp
4309 4544  .ne 2
4310 4545  .na
4311      -\fB\fB[H\fR\fR
     4546 +\fB[H\fR
4312 4547  .ad
4313 4548  .RS 13n
4314 4549  Move the cursor to the first non-blank character in the line.
4315 4550  .RE
4316 4551  
4317 4552  .sp
4318 4553  .ne 2
4319 4554  .na
4320      -\fB\fB$\fR\fR
     4555 +\fB$\fR
4321 4556  .ad
4322 4557  .RS 13n
4323 4558  Move the cursor to the end of the line.
4324 4559  .RE
4325 4560  
4326 4561  .sp
4327 4562  .ne 2
4328 4563  .na
4329      -\fB\fB[Y\fR\fR
     4564 +\fB[Y\fR
4330 4565  .ad
4331 4566  .RS 13n
4332 4567  Move the cursor to the end of the line.
4333 4568  .RE
4334 4569  
4335 4570  .sp
4336 4571  .ne 2
4337 4572  .na
4338      -\fB\fB%\fR\fR
     4573 +\fB%\fR
4339 4574  .ad
4340 4575  .RS 13n
4341 4576  Moves to balancing \fB(\fR, \fB)\fR, \fB{\fR, \fB}\fR, \fB[\fR, or \fB]\fR. If
4342 4577  cursor is not on one of the characters described in this section, the remainder
4343 4578  of the line is searched for the first occurrence of one of the characters
4344 4579  first.
4345 4580  .RE
4346 4581  
4347 4582  .SS "Search Edit Commands"
4348      -.LP
4349 4583  The search edit commands access your command history.
4350 4584  .sp
4351 4585  .LP
4352 4586  The following search edit commands are supported:
4353 4587  .sp
4354 4588  .ne 2
4355 4589  .na
4356      -\fB\fB[\fR\fIcount\fR\fB]k\fR\fR
     4590 +\fB[\fR\fIcount\fR\fB]k\fR
4357 4591  .ad
4358 4592  .RS 13n
4359 4593  Fetch the previous command. Each time \fBk\fR is entered, the previous command
4360 4594  back in time is accessed.
4361 4595  .RE
4362 4596  
4363 4597  .sp
4364 4598  .ne 2
4365 4599  .na
4366      -\fB\fB[\fR\fIcount\fR\fB]-\fR\fR
     4600 +\fB[\fR\fIcount\fR\fB]-\fR
4367 4601  .ad
4368 4602  .RS 13n
4369 4603  Fetch the previous command. Each time \fBk\fR is entered, the previous command
4370 4604  back in time is accessed.
4371 4605  .sp
4372 4606  Equivalent to \fBk\fR.
4373 4607  .RE
4374 4608  
4375 4609  .sp
4376 4610  .ne 2
4377 4611  .na
4378      -\fB\fB[\fR\fIcount\fR\fB][A\fR\fR
     4612 +\fB[\fR\fIcount\fR\fB][A\fR
4379 4613  .ad
4380 4614  .RS 13n
4381 4615  Fetch the previous command. Each time \fBk\fR is entered, the previous command
4382 4616  back in time is accessed.
4383 4617  .sp
4384 4618  Equivalent to \fBk\fR.
4385 4619  .RE
4386 4620  
4387 4621  .sp
4388 4622  .ne 2
4389 4623  .na
4390      -\fB\fB[\fR\fIcount\fR\fB]j\fR\fR
     4624 +\fB[\fR\fIcount\fR\fB]j\fR
4391 4625  .ad
4392 4626  .RS 13n
4393 4627  Fetch the next command. Each time \fBj\fR is entered, the next command forward
4394 4628  in time is accessed.
4395 4629  .RE
4396 4630  
4397 4631  .sp
4398 4632  .ne 2
4399 4633  .na
4400      -\fB\fB[\fR\fIcount\fR\fB]+\fR\fR
     4634 +\fB[\fR\fIcount\fR\fB]+\fR
4401 4635  .ad
4402 4636  .RS 13n
4403 4637  Fetch the next command. Each time \fBj\fR is entered, the next command forward
4404 4638  in time is accessed.
4405 4639  .sp
4406 4640  Equivalent to \fBj\fR.
4407 4641  .RE
4408 4642  
4409 4643  .sp
4410 4644  .ne 2
4411 4645  .na
4412      -\fB\fB[\fR\fIcount\fR\fB][B\fR\fR
     4646 +\fB[\fR\fIcount\fR\fB][B\fR
4413 4647  .ad
4414 4648  .RS 13n
4415 4649  Fetch the next command. Each time \fBj\fR is entered, the next command forward
4416 4650  in time is accessed.
4417 4651  .sp
4418 4652  Equivalent to \fBj\fR.
4419 4653  .RE
4420 4654  
4421 4655  .sp
4422 4656  .ne 2
4423 4657  .na
4424      -\fB\fB[\fR\fIcount\fR\fB]G\fR\fR
     4658 +\fB[\fR\fIcount\fR\fB]G\fR
4425 4659  .ad
4426 4660  .RS 13n
4427 4661  Fetch command number \fIcount\fR. The default is the least recent history
4428 4662  command.
4429 4663  .RE
4430 4664  
4431 4665  .sp
4432 4666  .ne 2
4433 4667  .na
4434      -\fB\fB/\fR\fIstring\fR\fR
     4668 +\fB/\fR\fIstring\fR
4435 4669  .ad
4436 4670  .RS 13n
4437 4671  Search backward through history for a previous command containing \fIstring\fR.
4438 4672  \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a
4439 4673  \fB^\fR, the matched line must begin with \fIstring\fR. If \fIstring\fR is
4440 4674  null, the previous string is used.
4441 4675  .RE
4442 4676  
4443 4677  .sp
4444 4678  .ne 2
4445 4679  .na
4446      -\fB\fB?\fR\fIstring\fR\fR
     4680 +\fB?\fR\fIstring\fR
4447 4681  .ad
4448 4682  .RS 13n
4449 4683  Search forward through history for a previous command containing \fIstring\fR.
4450 4684  \fIstring\fR is terminated by a RETURN or NEWLINE. If string is preceded by a
4451 4685  \fB^\fR, the matched line must begin with \fIstring\fR. If \fIstring\fR is
4452 4686  null, the previous string is used.
4453 4687  .sp
4454 4688  Same as \fI/\fR except that search is in the forward direction.
4455 4689  .RE
4456 4690  
4457 4691  .sp
4458 4692  .ne 2
4459 4693  .na
4460      -\fB\fBn\fR\fR
     4694 +\fBn\fR
4461 4695  .ad
4462 4696  .RS 13n
4463 4697  Search in the backwards direction for the next match of the last pattern to
4464 4698  \fI/\fR or \fI?\fR commands.
4465 4699  .RE
4466 4700  
4467 4701  .sp
4468 4702  .ne 2
4469 4703  .na
4470      -\fB\fBN\fR\fR
     4704 +\fBN\fR
4471 4705  .ad
4472 4706  .RS 13n
4473 4707  Search in the forward direction for next match of the last pattern to \fI/\fR
4474 4708  or \fI?\fR.
4475 4709  .RE
4476 4710  
4477 4711  .SS "Text Modification Edit Commands"
4478      -.LP
4479 4712  The following commands modify the line:
4480 4713  .sp
4481 4714  .ne 2
4482 4715  .na
4483      -\fB\fBa\fR\fR
     4716 +\fBa\fR
4484 4717  .ad
4485 4718  .RS 19n
4486 4719  Enter input mode and enter text after the current character.
4487 4720  .RE
4488 4721  
4489 4722  .sp
4490 4723  .ne 2
4491 4724  .na
4492      -\fB\fBA\fR\fR
     4725 +\fBA\fR
4493 4726  .ad
4494 4727  .RS 19n
4495 4728  Append text to the end of the line. Equivalent to \fB$a\fR.
4496 4729  .RE
4497 4730  
4498 4731  .sp
4499 4732  .ne 2
4500 4733  .na
4501      -\fB\fB[\fR\fIcount\fR\fB]c\fR\fImotion\fR\fR
     4734 +\fB[\fR\fIcount\fR\fB]c\fR\fImotion\fR
4502 4735  .ad
4503 4736  .br
4504 4737  .na
4505      -\fB\fBc[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
     4738 +\fBc[\fR\fIcount\fR\fB]\fR\fImotion\fR
4506 4739  .ad
4507 4740  .RS 19n
4508 4741  Delete current character through the character that \fImotion\fR would move the
4509 4742  cursor to and enter input mode. If \fImotion\fR is \fBc\fR, the entire line is
4510 4743  deleted and input mode entered.
4511 4744  .RE
4512 4745  
4513 4746  .sp
4514 4747  .ne 2
4515 4748  .na
4516      -\fB\fBC\fR\fR
     4749 +\fBC\fR
4517 4750  .ad
4518 4751  .RS 19n
4519 4752  Delete the current character through the end of line and enter input mode.
4520 4753  Equivalent to \fBc$\fR.
4521 4754  .RE
4522 4755  
4523 4756  .sp
4524 4757  .ne 2
4525 4758  .na
4526      -\fB\fBS\fR\fR
     4759 +\fBS\fR
4527 4760  .ad
4528 4761  .RS 19n
4529 4762  Equivalent to \fBcc\fR.
4530 4763  .RE
4531 4764  
4532 4765  .sp
4533 4766  .ne 2
4534 4767  .na
4535      -\fB\fB[\fR\fIcount\fR\fB]s\fR\fR
     4768 +\fB[\fR\fIcount\fR\fB]s\fR
4536 4769  .ad
4537 4770  .RS 19n
4538 4771  Replace characters under the cursor in input mode.
4539 4772  .RE
4540 4773  
4541 4774  .sp
4542 4775  .ne 2
4543 4776  .na
4544      -\fB\fBD[\fR\fIcount\fR\fB]d\fR\fImotion\fR\fR
     4777 +\fBD[\fR\fIcount\fR\fB]d\fR\fImotion\fR
4545 4778  .ad
4546 4779  .RS 19n
4547 4780  Delete the current character through the end of line. Equivalent to d$.
4548 4781  .RE
4549 4782  
4550 4783  .sp
4551 4784  .ne 2
4552 4785  .na
4553      -\fB\fBd[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
     4786 +\fBd[\fR\fIcount\fR\fB]\fR\fImotion\fR
4554 4787  .ad
4555 4788  .RS 19n
4556 4789  Delete current character through the character that \fImotion\fR would move to.
4557 4790  If \fImotion\fR is d , the entire line is deleted.
4558 4791  .RE
4559 4792  
4560 4793  .sp
4561 4794  .ne 2
4562 4795  .na
4563      -\fB\fBi\fR\fR
     4796 +\fBi\fR
4564 4797  .ad
4565 4798  .RS 19n
4566 4799  Enter input mode and insert text before the current character.
4567 4800  .RE
4568 4801  
4569 4802  .sp
4570 4803  .ne 2
4571 4804  .na
4572      -\fB\fBI\fR\fR
     4805 +\fBI\fR
4573 4806  .ad
4574 4807  .RS 19n
4575 4808  Insert text before the beginning of the line. Equivalent to \fB0i\fR.
4576 4809  .RE
4577 4810  
4578 4811  .sp
4579 4812  .ne 2
4580 4813  .na
4581      -\fB\fB[\fR\fIcount\fR\fB]P\fR\fR
     4814 +\fB[\fR\fIcount\fR\fB]P\fR
4582 4815  .ad
4583 4816  .RS 19n
4584 4817  Place the previous text modification before the cursor.
4585 4818  .RE
4586 4819  
4587 4820  .sp
4588 4821  .ne 2
4589 4822  .na
4590      -\fB\fB[\fR\fIcount\fR\fB]p\fR\fR
     4823 +\fB[\fR\fIcount\fR\fB]p\fR
4591 4824  .ad
4592 4825  .RS 19n
4593 4826  Place the previous text modification after the cursor.
4594 4827  .RE
4595 4828  
4596 4829  .sp
4597 4830  .ne 2
4598 4831  .na
4599      -\fB\fBR\fR\fR
     4832 +\fBR\fR
4600 4833  .ad
4601 4834  .RS 19n
4602 4835  Enter input mode and replace characters on the screen with characters you type
4603 4836  overlay fashion.
4604 4837  .RE
4605 4838  
4606 4839  .sp
4607 4840  .ne 2
4608 4841  .na
4609      -\fB\fB[\fR\fIcount\fR\fB]r\fR\fIc\fR\fR
     4842 +\fB[\fR\fIcount\fR\fB]r\fR\fIc\fR
4610 4843  .ad
4611 4844  .RS 19n
4612 4845  Replace the \fIcount\fR characters starting at the current cursor position with
4613 4846  \fIc\fR, and advance the cursor.
4614 4847  .RE
4615 4848  
4616 4849  .sp
4617 4850  .ne 2
4618 4851  .na
4619      -\fB\fB[\fR\fIcount\fR\fB]x\fR\fR
     4852 +\fB[\fR\fIcount\fR\fB]x\fR
4620 4853  .ad
4621 4854  .RS 19n
4622 4855  Delete current character.
4623 4856  .RE
4624 4857  
4625 4858  .sp
4626 4859  .ne 2
4627 4860  .na
4628      -\fB\fB[\fIcount\fR]X\fR\fR
     4861 +\fB[\fIcount\fR]X\fR
4629 4862  .ad
4630 4863  .RS 19n
4631 4864  Delete preceding character.
4632 4865  .RE
4633 4866  
4634 4867  .sp
4635 4868  .ne 2
4636 4869  .na
4637      -\fB\fB[\fIcount\fR].\fR\fR
     4870 +\fB[\fIcount\fR].\fR
4638 4871  .ad
4639 4872  .RS 19n
4640 4873  Repeat the previous text modification command.
4641 4874  .RE
4642 4875  
4643 4876  .sp
4644 4877  .ne 2
4645 4878  .na
4646      -\fB\fB[\fIcount\fR]~\fR\fR
     4879 +\fB[\fIcount\fR]~\fR
4647 4880  .ad
4648 4881  .RS 19n
4649 4882  Invert the case of the \fIcount\fR characters starting at the current cursor
4650 4883  position and advance the cursor.
4651 4884  .RE
4652 4885  
4653 4886  .sp
4654 4887  .ne 2
4655 4888  .na
4656      -\fB\fB[\fIcount\fR]_\fR\fR
     4889 +\fB[\fIcount\fR]_\fR
4657 4890  .ad
4658 4891  .RS 19n
4659 4892  Causes the \fIcount\fR word of the previous command to be appended and input
4660 4893  mode entered. The last word is used if \fIcount\fR is omitted.
4661 4894  .RE
4662 4895  
4663 4896  .sp
4664 4897  .ne 2
4665 4898  .na
4666      -\fB\fB*\fR\fR
     4899 +\fB*\fR
4667 4900  .ad
4668 4901  .RS 19n
4669 4902  Causes an \fB*\fR to be appended to the current word and file name generation
4670 4903  attempted. If no match is found, it rings the bell. Otherwise, the word is
4671 4904  replaced by the matching pattern and input mode is entered.
4672 4905  .RE
4673 4906  
4674 4907  .sp
4675 4908  .ne 2
4676 4909  .na
4677      -\fB\fB\e\fR\fR
     4910 +\fB\e\fR
4678 4911  .ad
4679 4912  .RS 19n
4680 4913  Command or file name completion as described in this manual page.
4681 4914  .RE
4682 4915  
4683 4916  .SS "Other Edit Commands"
4684      -.LP
4685 4917  The following miscellaneous edit commands are supported:
4686 4918  .sp
4687 4919  .ne 2
4688 4920  .na
4689      -\fB\fB[\fR\fIcount\fR\fB]y\fR\fImotion\fR\fR
     4921 +\fB[\fR\fIcount\fR\fB]y\fR\fImotion\fR
4690 4922  .ad
4691 4923  .br
4692 4924  .na
4693      -\fB\fBy[\fR\fIcount\fR\fB]\fR\fImotion\fR\fR
     4925 +\fBy[\fR\fIcount\fR\fB]\fR\fImotion\fR
4694 4926  .ad
4695 4927  .RS 18n
4696 4928  Yank the current character through the character to which \fImotion\fR would
4697 4929  move the cursor. Put the yanked characters in the delete buffer. The text and
4698 4930  cursor position are unchanged.
4699 4931  .RE
4700 4932  
4701 4933  .sp
4702 4934  .ne 2
4703 4935  .na
4704      -\fB\fByy\fR\fR
     4936 +\fByy\fR
4705 4937  .ad
4706 4938  .RS 18n
4707 4939  Yank the current line.
4708 4940  .RE
4709 4941  
4710 4942  .sp
4711 4943  .ne 2
4712 4944  .na
4713      -\fB\fBY\fR\fR
     4945 +\fBY\fR
4714 4946  .ad
4715 4947  .RS 18n
4716 4948  Yank the current line from the current cursor location to the end of the line.
4717 4949  Equivalent to \fBy$\fR.
4718 4950  .RE
4719 4951  
4720 4952  .sp
4721 4953  .ne 2
4722 4954  .na
4723      -\fB\fBu\fR\fR
     4955 +\fBu\fR
4724 4956  .ad
4725 4957  .RS 18n
4726 4958  Undo the last text modifying command.
4727 4959  .RE
4728 4960  
4729 4961  .sp
4730 4962  .ne 2
4731 4963  .na
4732      -\fB\fBU\fR\fR
     4964 +\fBU\fR
4733 4965  .ad
4734 4966  .RS 18n
4735 4967  Undo all the text modifying commands performed on current line.
4736 4968  .RE
4737 4969  
4738 4970  .sp
4739 4971  .ne 2
4740 4972  .na
4741      -\fB\fB[\fR\fIcount\fR\fB]V\fR\fR
     4973 +\fB[\fR\fIcount\fR\fB]V\fR
4742 4974  .ad
4743 4975  .RS 18n
4744 4976  Return the command :
4745 4977  .sp
4746 4978  .in +2
4747 4979  .nf
4748 4980  hist -e ${VISUAL:-${EDITOR:-vi}} \fIcount\fR
4749 4981  .fi
4750 4982  .in -2
4751 4983  .sp
4752 4984  
4753 4985  in the input buffer. If \fIcount\fR is omitted, the current line is used.
4754 4986  .RE
4755 4987  
4756 4988  .sp
4757 4989  .ne 2
4758 4990  .na
4759      -\fB\fB^L\fR\fR
     4991 +\fB^L\fR
4760 4992  .ad
4761 4993  .RS 18n
4762 4994  Line feed and print the current line. This command only works in control mode.
4763 4995  .RE
4764 4996  
4765 4997  .sp
4766 4998  .ne 2
4767 4999  .na
4768      -\fB\fB^J\fR\fR
     5000 +\fB^J\fR
4769 5001  .ad
4770 5002  .RS 18n
4771 5003  New line. Execute the current line, regardless of mode.
4772 5004  .RE
4773 5005  
4774 5006  .sp
4775 5007  .ne 2
4776 5008  .na
4777      -\fB\fB^M\fR\fR
     5009 +\fB^M\fR
4778 5010  .ad
4779 5011  .RS 18n
4780 5012  Return. Execute the current line, regardless of mode.
4781 5013  .RE
4782 5014  
4783 5015  .sp
4784 5016  .ne 2
4785 5017  .na
4786      -\fB\fB#\fR\fR
     5018 +\fB#\fR
4787 5019  .ad
4788 5020  .RS 18n
4789 5021  If the first character of the command is a \fB#\fR , delete this \fB#\fR and
4790 5022  each \fB#\fR that follows a NEWLINE.
4791 5023  .sp
4792 5024  Otherwise, send the line after inserting a \fB#\fR in front of each line in the
4793 5025  command.
4794 5026  .sp
4795 5027  This is command is useful for causing the current line to be inserted in the
4796 5028  history as a comment and un-commenting previously commented commands in the
4797 5029  history file.
4798 5030  .RE
4799 5031  
4800 5032  .sp
4801 5033  .ne 2
4802 5034  .na
4803      -\fB\fB[\fR\fIcount\fR\fB]=\fR\fR
     5035 +\fB[\fR\fIcount\fR\fB]=\fR
4804 5036  .ad
4805 5037  .RS 18n
4806 5038  If \fIcount\fR is not specified, generate the list of matching commands or file
4807 5039  names as described in this manual page.
4808 5040  .sp
4809 5041  Otherwise, replace the word at the current cursor location with the \fIcount\fR
4810 5042  item from the most recently generated command or file list. If the cursor is
4811 5043  not on a word, it is inserted after the current cursor location.
4812 5044  .RE
4813 5045  
4814 5046  .sp
4815 5047  .ne 2
4816 5048  .na
4817      -\fB\fB@\fR\fIletter\fR\fR
     5049 +\fB@\fR\fIletter\fR
4818 5050  .ad
4819 5051  .RS 18n
4820 5052  Search your alias list for an alias by the name \fIletter\fR. If an alias of
4821 5053  this name is defined, insert its value on the input queue for processing.
4822 5054  .RE
4823 5055  
4824 5056  .sp
4825 5057  .ne 2
4826 5058  .na
4827      -\fB\fB^V\fR\fR
     5059 +\fB^V\fR
4828 5060  .ad
4829 5061  .RS 18n
4830 5062  Display version of the shell.
4831 5063  .RE
4832 5064  
4833 5065  .SS "Built-in Commands"
4834      -.LP
4835 5066  The following simple-commands are executed in the shell process. Input and
4836 5067  output redirection is permitted. Unless otherwise indicated, the output is
4837 5068  written on file descriptor \fB1\fR and the exit status, when there is no syntax
4838 5069  error, is \fB0\fR. Except for \fB:\fR, \fBtrue\fR, \fBfalse\fR, \fBecho\fR,
4839 5070  \fBnewgrp\fR, and \fBlogin\fR, all built-in commands accept \fB--\fR to
4840 5071  indicate the end of options. They also interpret the option \fB--man\fR as a
4841 5072  request to display the manual page onto standard error and \fB-?\fR as a help
4842 5073  request which prints a usage message on standard error.
4843 5074  .sp
4844 5075  .LP
↓ open down ↓ 24 lines elided ↑ open up ↑
4869 5100  .TP
4870 5101  5.
4871 5102  Words following a command preceded by \fB++\fR that are in the format of a
4872 5103  variable assignment are expanded with the same rules as a variable assignment.
4873 5104  This means that tilde substitution is performed after the \fB=\fR sign and
4874 5105  field splitting and file name generation are not performed.
4875 5106  .RE
4876 5107  .sp
4877 5108  .ne 2
4878 5109  .na
4879      -\fB\fB+ : [\fR\fIarg ...\fR\fB]\fR\fR
     5110 +\fB+ : [\fR\fIarg ...\fR\fB]\fR
4880 5111  .ad
4881 5112  .sp .6
4882 5113  .RS 4n
4883 5114  The command only expands parameters.
4884 5115  .RE
4885 5116  
4886 5117  .sp
4887 5118  .ne 2
4888 5119  .na
4889      -\fB\fB+ .\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
     5120 +\fB+ .\fR \fIname\fR \fB[\fR\fIarg ...\fR\fB]\fR
4890 5121  .ad
4891 5122  .sp .6
4892 5123  .RS 4n
4893 5124  If \fIname\fR is a function defined with the \fBfunction\fR \fBname\fR reserved
4894 5125  word syntax, the function is executed in the current environment (as if it had
4895 5126  been defined with the \fIname()\fR syntax.) Otherwise if \fIname\fR refers to a
4896 5127  file, the file is read in its entirety and the commands are executed in the
4897 5128  current shell environment. The search path specified by PATH is used to find
4898 5129  the directory containing the file. If any arguments \fIarg\fR are specified,
4899 5130  they become the positional parameters while processing the . command and the
4900 5131  original positional parameters are restored upon completion. Otherwise the
4901 5132  positional parameters are unchanged. The exit status is the exit status of the
4902 5133  last command executed.
4903 5134  .RE
4904 5135  
4905 5136  .sp
4906 5137  .ne 2
4907 5138  .na
4908      -\fB\fB++ alias [\fR\fB-ptx\fR\fB] [\fR\fIname\fR\fB[
4909      -=\fR\fIvalue\fR\fB]] ...\fR\fR
     5139 +\fB++ alias [\fR\fB-ptx\fR\fB] [\fR\fIname\fR\fB[
     5140 +=\fR\fIvalue\fR\fB]] ...\fR
4910 5141  .ad
4911 5142  .sp .6
4912 5143  .RS 4n
4913 5144  \fBalias\fR with no arguments prints the list of aliases in the form
4914 5145  \fIname\fR\fB=\fR\fIvalue\fR on standard output. The \fB-p\fR option causes the
4915 5146  word alias to be inserted before each one. When one or more arguments are
4916 5147  specified, an \fIalias\fR is defined for each \fIname\fR whose \fIvalue\fR is
4917 5148  specified. A trailing space in \fIvalue\fR causes the next word to be checked
4918 5149  for alias substitution. The obsolete \fB-t\fR option is used to set and list
4919 5150  tracked aliases. The value of a tracked alias is the full pathname
↓ open down ↓ 2 lines elided ↑ open up ↑
4922 5153  \fB-t\fR option, for each \fIname\fR in the argument list for which no
4923 5154  \fIvalue\fR is specified, the name and value of the alias is printed. The
4924 5155  obsolete -x option has no effect. The exit status is \fBnon-zero\fR if a
4925 5156  \fIname\fR is specified, but no value, and no alias has been defined for the
4926 5157  \fIname\fR.
4927 5158  .RE
4928 5159  
4929 5160  .sp
4930 5161  .ne 2
4931 5162  .na
4932      -\fB\fBbg [\fR \fIjob\fR\fB\&...]\fR\fR
     5163 +\fBbg [\fR \fIjob\fR\fB\&...]\fR
4933 5164  .ad
4934 5165  .sp .6
4935 5166  .RS 4n
4936 5167  This command is only on systems that support job control. Puts each specified
4937 5168  \fIjob\fR into the background. The current job is put in the background if
4938 5169  \fIjob\fR is not specified. See the \fBJobs\fR section of this manual page for
4939 5170  a description of the format of \fIjob\fR.
4940 5171  .RE
4941 5172  
4942 5173  .sp
4943 5174  .ne 2
4944 5175  .na
4945      -\fB\fB+ break [\fR\fIn\fR\fB]\fR\fR
     5176 +\fB+ break [\fR\fIn\fR\fB]\fR
4946 5177  .ad
4947 5178  .sp .6
4948 5179  .RS 4n
4949 5180  Exit from the enclosing \fBfor\fR, \fBwhile\fR, \fBuntil\fR, or \fBselect\fR
4950 5181  loop, if any. If \fIn\fR is specified, then break \fIn\fR levels.
4951 5182  .RE
4952 5183  
4953 5184  .sp
4954 5185  .ne 2
4955 5186  .na
4956      -\fB\fBbuiltin [\fR\fB-ds\fR \fB] [\fR\fB-f\fR \fIfile\fR\fB]
4957      -[\fR\fIname ...\fR\fB]\fR\fR
     5187 +\fBbuiltin [\fR\fB-ds\fR \fB] [\fR\fB-f\fR \fIfile\fR\fB]
     5188 +[\fR\fIname ...\fR\fB]\fR
4958 5189  .ad
4959 5190  .sp .6
4960 5191  .RS 4n
4961 5192  If \fIname\fR is not specified, and no \fB-f\fR option is specified, the
4962 5193  built-ins are printed on standard output. The \fB-s\fR option prints only the
4963 5194  special built-ins. Otherwise, each \fIname\fR represents the pathname whose
4964 5195  basename is the name of the built-in. The entry point function name is
4965      -determined by prepending \fIb\fR to the built-in name. The ISO C/C++ prototype
     5196 +determined by prepending \fIb_\fR to the built-in name. A built-in specified by
     5197 +a pathname will only be executed when that pathname would be found during the
     5198 +path search. Built-ins found in libraries loaded via the \fB.paths\fR file will
     5199 +be associate with the pathname of the directory containing the \fB.paths\fR
     5200 +file.
     5201 +.sp
     5202 +The ISO C/C++ prototype
4966 5203  is \fBb\fR\fImycommand(int argc, char *argv[], void *context)\fR for the
4967 5204  built-in command \fImycommand\fR where \fIargv\fR is an array of \fIargc\fR
4968 5205  elements and \fIcontext\fR is an optional pointer to a \fBShell_t\fR structure
4969 5206  as described in \fB<ast/shell.h>\fR Special built-ins cannot be bound to a
4970 5207  pathname or deleted. The \fB-d\fR option deletes each of the specified
4971 5208  built-ins. On systems that support dynamic loading, the \fB-f\fR option names a
4972 5209  shared library containing the code for built-ins. The shared library prefix
4973 5210  and/or suffix, which depend on the system, can be omitted. Once a library is
4974 5211  loaded, its symbols become available for subsequent invocations of
4975 5212  \fBbuiltin\fR. Multiple libraries can be specified with separate invocations of
4976 5213  the \fBbuiltin\fR command. Libraries are searched in the reverse order in which
4977 5214  they are specified. When a library is loaded, it looks for a function in the
4978 5215  library whose name is \fBlib_init()\fR and invokes this function with an
4979 5216  argument of \fB0\fR.
4980 5217  .RE
4981 5218  
4982 5219  .sp
4983 5220  .ne 2
4984 5221  .na
4985      -\fB\fBcd\fR \fB[\fR\fB-LP\fR\fB] [\fR\fIarg\fR\fB]\fR\fR
     5222 +\fBcd\fR \fB[\fR\fB-LP\fR\fB] [\fR\fIarg\fR\fB]\fR
4986 5223  .ad
4987 5224  .br
4988 5225  .na
4989      -\fB\fBcd\fR \fB[\fR\fB-LP\fR\fB]\fR \fIold\fR \fInew\fR\fR
     5226 +\fBcd\fR \fB[\fR\fB-LP\fR\fB]\fR \fIold\fR \fInew\fR
4990 5227  .ad
4991 5228  .sp .6
4992 5229  .RS 4n
4993 5230  This command has two forms.
4994 5231  .sp
4995 5232  In the first form it changes the current directory to \fIarg\fR. If \fIarg\fR
4996 5233  is a \fB-\fR, the directory is changed to the previous directory. The shell
4997 5234  variable \fBHOME\fR is the default \fIarg\fR. The variable \fBPWD\fR is set to
4998 5235  the current directory. The shell variable \fBCDPATH\fR defines the search path
4999 5236  for the directory containing \fIarg\fR. Alternative directory names are
↓ open down ↓ 10 lines elided ↑ open up ↑
5010 5247  finding the directory name. This is equivalent to the \fB-L\fR option. The
5011 5248  \fB-P\fR option causes symbolic links to be resolved when determining the
5012 5249  directory. The last instance of \fB-L\fR or \fB-P\fR on the command line
5013 5250  determines which method is used. The \fBcd\fR command cannot be executed by
5014 5251  \fBrksh93\fR.
5015 5252  .RE
5016 5253  
5017 5254  .sp
5018 5255  .ne 2
5019 5256  .na
5020      -\fB\fBcommand\fR \fB[\fR\fB-pvVx\fR\fB]\fR \fIname\fR
5021      -\fB[\fR\fIarg ...\fR\fB]\fR\fR
     5257 +\fBcommand\fR \fB[\fR\fB-pvVx\fR\fB]\fR \fIname\fR
     5258 +\fB[\fR\fIarg ...\fR\fB]\fR
5022 5259  .ad
5023 5260  .sp .6
5024 5261  .RS 4n
5025 5262  Without the \fB-v\fR or \fB-V\fR options, executes \fIname\fR with the
5026 5263  arguments specified by \fIarg\fR.
5027 5264  .sp
5028 5265  The \fB-p\fR option causes a default path to be searched rather than the one
5029 5266  defined by the value of \fBPATH\fR. Functions are not searched when finding
5030 5267  \fIname\fR. In addition, if \fIname\fR refers to a special built-in, none of
5031 5268  the special properties associated with the leading daggers are honored. For
↓ open down ↓ 9 lines elided ↑ open up ↑
5041 5278  status.
5042 5279  .sp
5043 5280  With the \fB-v\fR option, \fBcommand\fR is equivalent to the built-in
5044 5281  \fBwhence\fR command described in this section. The \fB-V\fR option causes
5045 5282  \fBcommand\fR to act like \fBwhence -v\fR.
5046 5283  .RE
5047 5284  
5048 5285  .sp
5049 5286  .ne 2
5050 5287  .na
5051      -\fB\fB+continue\fR \fB[\fR\fIn\fR\fB]\fR\fR
     5288 +\fB+continue\fR \fB[\fR\fIn\fR\fB]\fR
5052 5289  .ad
5053 5290  .sp .6
5054 5291  .RS 4n
5055 5292  Resumes the next iteration of the enclosing \fBfor\fR, \fBwhile\fR,
5056 5293  \fBuntil\fR, or \fBselect\fR loop. If \fIn\fR is specified, then resume at the
5057 5294  \fIn\fRth enclosing loop.
5058 5295  .RE
5059 5296  
5060 5297  .sp
5061 5298  .ne 2
5062 5299  .na
5063      -\fB\fBdisown\fR \fB[\fR\fIjob...\fR\fB]\fR\fR
     5300 +\fBdisown\fR \fB[\fR\fIjob...\fR\fB]\fR
5064 5301  .ad
5065 5302  .sp .6
5066 5303  .RS 4n
5067 5304  Causes the shell not to send a \fBHUP\fR signal to each specified \fIjob\fR, or
5068 5305  all active jobs if \fIjob\fR is omitted, when a login shell terminates.
5069 5306  .RE
5070 5307  
5071 5308  .sp
5072 5309  .ne 2
5073 5310  .na
5074      -\fB\fBecho\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
     5311 +\fBecho\fR \fB[\fR\fIarg ...\fR\fB]\fR
5075 5312  .ad
5076 5313  .sp .6
5077 5314  .RS 4n
5078 5315  When the first \fIarg\fR does not begin with a \fB-\fR, and none of the
5079 5316  arguments contain a backslash (\fB\e\fR), prints each of its arguments
5080 5317  separated by a SPACE and terminated by a NEWLINE. Otherwise, the behavior of
5081 5318  \fBecho\fR is system dependent and \fBprint\fR or \fBprintf\fR described in
5082 5319  this section should be used. See \fBecho\fR(1) for usage and description.
5083 5320  .RE
5084 5321  
5085 5322  .sp
5086 5323  .ne 2
5087 5324  .na
5088      -\fB\fB+eval\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
     5325 +\fB++enum [ -i ]\fR \fItype\fR\fB[\fR=(\fIvalue\fR ...) \fB]\fR
5089 5326  .ad
5090 5327  .sp .6
5091 5328  .RS 4n
     5329 +Creates a declaration command named type that is an integer type that allows
     5330 +one of the specified values as enumeration names. If \fI=(value ...)\fR is
     5331 +omitted, then type must be an indexed array variable with at least two elements
     5332 +and the values are taken from this array variable.  If \fB-i\fR is specified
     5333 +the values are case insensitive.
     5334 +.RE
     5335 +
     5336 +.sp
     5337 +.ne 2
     5338 +.na
     5339 +\fB+eval\fR \fB[\fR\fIarg ...\fR\fB]\fR
     5340 +.ad
     5341 +.sp .6
     5342 +.RS 4n
5092 5343  The arguments are read as input to the shell and the resulting commands are
5093 5344  executed.
5094 5345  .RE
5095 5346  
5096 5347  .sp
5097 5348  .ne 2
5098 5349  .na
5099      -\fB\fB+exec\fR [\fB-c\fR] [\fB-a\fR \fIname ...\fR]
5100      -\fB[\fR\fIarg ...\fR\fB]\fR\fR
     5350 +\fB+exec\fR [\fB-c\fR] [\fB-a\fR \fIname ...\fR]
     5351 +\fB[\fR\fIarg ...\fR\fB]\fR
5101 5352  .ad
5102 5353  .sp .6
5103 5354  .RS 4n
5104 5355  If \fIarg\fR is specified, the command specified by the arguments is executed
5105 5356  in place of this shell without creating a new process. The \fB-c\fR option
5106 5357  causes the environment to be cleared before applying variable assignments
5107 5358  associated with the exec invocation. The \fB-a\fR option causes \fIname\fR
5108 5359  rather than the first \fIarg\fR, to become \fBargv[0]\fR for the new process.
5109 5360  Input and output arguments can appear and affect the current process. If
5110 5361  \fIarg\fR is not specified, the effect of this command is to modify file
5111 5362  descriptors as prescribed by the input/output redirection list. In this case,
5112 5363  any file descriptor numbers greater than \fB2\fR that are opened with this
5113 5364  mechanism are closed when invoking another program.
5114 5365  .RE
5115 5366  
5116 5367  .sp
5117 5368  .ne 2
5118 5369  .na
5119      -\fB\fB+exit\fR \fB[\fR\fIn\fR\fB]\fR\fR
     5370 +\fB+exit\fR \fB[\fR\fIn\fR\fB]\fR
5120 5371  .ad
5121 5372  .sp .6
5122 5373  .RS 4n
5123 5374  Causes the shell to exit with the exit status specified by \fIn\fR. The value
5124 5375  is the least significant 8 bits of the specified status. If \fIn\fR is omitted,
5125 5376  then the exit status is that of the last command executed. An end-of-file also
5126 5377  causes the shell to exit except for a shell which has the \fBignoreeof\fR
5127 5378  option turned on. See \fBset\fR.
5128 5379  .RE
5129 5380  
5130 5381  .sp
5131 5382  .ne 2
5132 5383  .na
5133      -\fB\fB++export\fR \fB[\fR\fB-p\fR\fB]\fR
5134      -\fB[\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR
     5384 +\fB++export\fR \fB[\fR\fB-p\fR\fB]\fR
     5385 +\fB[\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR
5135 5386  .ad
5136 5387  .sp .6
5137 5388  .RS 4n
5138 5389  If \fIname\fR is not specified, the names and values of each variable with the
5139 5390  export attribute are printed with the values quoted in a manner that allows
5140      -them to be re-entered. The \fB-p\fR option causes the word export to be
5141      -inserted before each one. Otherwise, the specified \fIname\fRs are marked for
5142      -automatic export to the environment of subsequently-executed commands.
     5391 +them to be re-entered. The \fBexport\fR command is the same as \fBtypeset -x\fR
     5392 +except that if you use \fBexport\fR within a function, no local variable is
     5393 +created. The \fB-p\fR option causes the word export to be inserted before each
     5394 +one. Otherwise, the specified \fIname\fRs are marked for automatic export to
     5395 +the environment of subsequently-executed commands.
5143 5396  .RE
5144 5397  
5145 5398  .sp
5146 5399  .ne 2
5147 5400  .na
5148      -\fB\fBfalse\fR\fR
     5401 +\fBfalse\fR
5149 5402  .ad
5150 5403  .sp .6
5151 5404  .RS 4n
5152 5405  Does nothing, and exits \fB1\fR. Used with \fBuntil\fR for infinite loops.
5153 5406  .RE
5154 5407  
5155 5408  .sp
5156 5409  .ne 2
5157 5410  .na
5158      -\fB\fBfg\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR
     5411 +\fBfg\fR \fB[\fR\fIjob ...\fR\fB]\fR
5159 5412  .ad
5160 5413  .sp .6
5161 5414  .RS 4n
5162 5415  This command is only on systems that support job control. Each \fIjob\fR
5163 5416  specified is brought to the foreground and waited for in the specified order.
5164 5417  Otherwise, the current job is brought into the foreground. See \fBJobs\fR for a
5165 5418  description of the format of \fIjob\fR.
5166 5419  .RE
5167 5420  
5168 5421  .sp
5169 5422  .ne 2
5170 5423  .na
5171      -\fB\fBgetconf\fR \fB[\fR\fIname\fR \fB[\fR\fIpathname\fR\fB]]\fR\fR
     5424 +\fBgetconf\fR \fB[\fR\fIname\fR \fB[\fR\fIpathname\fR\fB]]\fR
5172 5425  .ad
5173 5426  .sp .6
5174 5427  .RS 4n
5175 5428  Prints the current value of the configuration parameter specified by
5176 5429  \fIname\fR. The configuration parameters are defined by the IEEE POSIX 1003.1
5177 5430  and IEEE POSIX 1003.2 standards. See \fBpathconf\fR(2) and \fBsysconf\fR(3C).
5178 5431  .sp
5179 5432  The \fIpathname\fR argument is required for parameters whose value depends on
5180 5433  the location in the file system. If no arguments are specified, \fBgetconf\fR
5181 5434  prints the names and values of the current configuration parameters. The
5182 5435  pathname \fB/\fR is used for each of the parameters that requires
5183 5436  \fIpathname\fR.
5184 5437  .RE
5185 5438  
5186 5439  .sp
5187 5440  .ne 2
5188 5441  .na
5189      -\fB\fBgetopts\fR \fB[\fR \fB-a\fR \fIname\fR\fB]\fR \fIoptstring\fR \fIvname\fR
5190      -\fB[\fR\fIarg ...\fR\fB]\fR\fR
     5442 +\fBgetopts\fR \fB[\fR \fB-a\fR \fIname\fR\fB]\fR \fIoptstring\fR \fIvname\fR
     5443 +\fB[\fR\fIarg ...\fR\fB]\fR
5191 5444  .ad
5192 5445  .sp .6
5193 5446  .RS 4n
5194 5447  Checks \fIarg\fR for legal options. If \fIarg\fR is omitted, the positional
5195 5448  parameters are used. An option argument begins with a \fB+\fR or a \fB-\fR. An
5196 5449  option that does not begin with \fB+\fR or \fB-\fR or the argument \fB--\fR
5197 5450  ends the options. Options beginning with \fB+\fR are only recognized when
5198 5451  \fIoptstring\fR begins with a \fB+\fR. \fIoptstring\fR contains the letters
5199 5452  that \fBgetopts\fR recognizes. If a letter is followed by a \fB:\fR, that
5200 5453  option is expected to have an argument. The options can be separated from the
↓ open down ↓ 9 lines elided ↑ open up ↑
5210 5463  to: when a required option argument is missing. Otherwise, \fBgetopts\fR prints
5211 5464  an error message. The exit status is \fBnon-zero\fR when there are no more
5212 5465  options. There is no way to specify any of the options \fB:\fR, \fB+\fR,
5213 5466  \fB-\fR, \fB?\fR, \fB[\fR, and \fB]\fR. The option \fB#\fR can only be
5214 5467  specified as the first option.
5215 5468  .RE
5216 5469  
5217 5470  .sp
5218 5471  .ne 2
5219 5472  .na
5220      -\fB\fBhist\fR \fB[\fR \fB-e\fR \fIename\fR\fB]\fR\fB[\fR\fB-nlr\fR\fB]\fR
5221      -\fB[\fR \fIfirst\fR\fB[\fR\fIlast\fR \fB] ]\fR\fR
     5473 +\fBhist\fR \fB[\fR \fB-e\fR \fIename\fR\fB]\fR\fB[\fR\fB-nlr\fR\fB]\fR
     5474 +\fB[\fR \fIfirst\fR\fB[\fR\fIlast\fR \fB] ]\fR
5222 5475  .ad
5223 5476  .br
5224 5477  .na
5225 5478  \fB\fR
5226 5479  .ad
5227 5480  .br
5228 5481  .na
5229      -\fB\fBhist\fR \fB-s\fR \fB[\fR \fIold\fR\fB=\fR\fInew\fR \fB] [\fR
5230      -\fIcommand\fR\fB]\fR\fR
     5482 +\fBhist\fR \fB-s\fR \fB[\fR \fIold\fR\fB=\fR\fInew\fR \fB] [\fR
     5483 +\fIcommand\fR\fB]\fR
5231 5484  .ad
5232 5485  .sp .6
5233 5486  .RS 4n
5234 5487  In the first form, a range of commands from \fIfirst\fR to \fIlast\fR is
5235 5488  selected from the last \fBHISTSIZE\fR commands that were typed at the terminal.
5236 5489  The arguments \fIfirst\fR and \fIlast\fR can be specified as a number or as a
5237 5490  string. A string is used to locate the most recent command starting with the
5238 5491  specified string. A negative number is used as an offset to the current command
5239 5492  number. If the -l option is selected, the commands are listed on standard
5240 5493  output. Otherwise, the editor program \fIename\fR is invoked on a file
↓ open down ↓ 6 lines elided ↑ open up ↑
5247 5500  for listing. The option \fB-r\fR reverses the order of the commands and the
5248 5501  option \fB-n\fR suppresses command numbers when listing. In the second form,
5249 5502  \fIcommand\fR is interpreted as \fIfirst\fR described in this section and
5250 5503  defaults to the last command executed. The resulting command is executed after
5251 5504  the optional substitution \fIold\fR\fB=\fR\fInew\fR is performed.
5252 5505  .RE
5253 5506  
5254 5507  .sp
5255 5508  .ne 2
5256 5509  .na
5257      -\fB\fBjobs\fR \fB-lnp\fR \fB[\fR\fIjob ...\fR\fB]\fR\fR
     5510 +\fBjobs\fR \fB-lnp\fR \fB[\fR\fIjob ...\fR\fB]\fR
5258 5511  .ad
5259 5512  .sp .6
5260 5513  .RS 4n
5261 5514  Lists information about each specified job, or all active jobs if \fIjob\fR is
5262 5515  omitted. The \fB-l\fR option lists process ids in addition to the normal
5263 5516  information. The \fB-n\fR option only displays jobs that have stopped or exited
5264 5517  since last notified. The \fB-p\fR option causes only the process group to be
5265 5518  listed. See \fBJobs\fR for a description of the format of \fIjob\fR.
5266 5519  .RE
5267 5520  
5268 5521  .sp
5269 5522  .ne 2
5270 5523  .na
5271      -\fB\fBkill\fR \fB[\fR\fB-s\fR \fIsigname\fR\fB]\fR \fIjob ...\fR\fR
     5524 +\fBkill\fR \fB[\fR\fB-s\fR \fIsigname\fR\fB]\fR \fIjob ...\fR
5272 5525  .ad
5273 5526  .br
5274 5527  .na
5275      -\fB\fBkill\fR \fB[\fR\fB-n\fR \fIsignum\fR\fB]\fR \fIjob ...\fR\fR
     5528 +\fBkill\fR \fB[\fR\fB-n\fR \fIsignum\fR\fB]\fR \fIjob ...\fR
5276 5529  .ad
5277 5530  .br
5278 5531  .na
5279      -\fB\fBkill\fR \fB-l\fR \fB[\fR\fIsig ...\fR\fB]\fR\fR
     5532 +\fBkill\fR \fB-Ll\fR \fB[\fR\fIsig ...\fR\fB]\fR
5280 5533  .ad
5281 5534  .sp .6
5282 5535  .RS 4n
5283 5536  Sends either the \fBTERM\fR (terminate) signal or the specified signal to the
5284 5537  specified jobs or processes. Signals are either specified by number with the
5285 5538  \fB-n\fR option or by name with the \fB-s\fR option (as specified in
5286 5539  \fB<signal.h\fR>, stripped of the prefix `\fBSIG\fR with the exception that
5287 5540  \fBSIGCLD\fR is named \fBCHLD\fR). For backward compatibility, the \fBn\fR and
5288 5541  \fBs\fR can be omitted and the number or name placed immediately after the
5289 5542  \fB-\fR. If the signal being sent is \fBTERM\fR (terminate) or \fBHUP\fR (hang
5290 5543  up), then the job or process is sent a \fBCONT\fR (continue) signal if it is
5291 5544  stopped. The argument \fIjob\fR can be the process id of a process that is not
5292 5545  a member of one of the active jobs. See \fBJobs\fR for a description of the
5293      -format of \fIjob\fR. In the third form, \fBkill -l\fR, if \fIsig\fR is not
5294      -specified, the signal names are listed. Otherwise, for each \fIsig\fR that is a
5295      -name, the corresponding signal number is listed. For each \fIsig\fR that is a
5296      -number, the signal name corresponding to the least significant 8 bits of
5297      -\fIsig\fR is listed.
     5546 +format of \fIjob\fR. In the third form, \fBkill -l\fR or \fBkill -L\fR, if
     5547 +\fIsig\fR is not specified, the signal names are listed. The \fB-l\fR option
     5548 +lists only the signal names whereas \fB-L\fR lists each signal name and
     5549 +corresponding number. Otherwise, for each \fIsig\fR that is a name, the
     5550 +corresponding signal number is listed. For each \fIsig\fR that is a number, the
     5551 +signal name corresponding to the least significant 8 bits of \fIsig\fR is
     5552 +listed.
5298 5553  .RE
5299 5554  
5300 5555  .sp
5301 5556  .ne 2
5302 5557  .na
5303      -\fB\fBlet\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
     5558 +\fBlet\fR \fB[\fR\fIarg ...\fR\fB]\fR
5304 5559  .ad
5305 5560  .sp .6
5306 5561  .RS 4n
5307      -Each \fIarg\fR is a separate arithmetic expression to be evaluated. See the
5308      -\fBArithmetic Evaluation\fR section of this manual page for a description of
5309      -arithmetic expression evaluation. The exit status is \fB0\fR if the value of
5310      -the last expression is \fBnon-zero\fR, and \fB1\fR otherwise.
     5562 +Each \fIarg\fR is a separate arithmetic expression to be evaluated.
     5563 +\fBlet\fR only recognizes octal constants starting with \fB0\fR when the
     5564 +\fBset\fR option \fBletoctal\fR is on. See the \fBArithmetic Evaluation\fR
     5565 +section of this manual page for a description of arithmetic expression
     5566 +evaluation. The exit status is \fB0\fR if the value of the last expression is
     5567 +\fBnon-zero\fR, and \fB1\fR otherwise.
5311 5568  .RE
5312 5569  
5313 5570  .sp
5314 5571  .ne 2
5315 5572  .na
5316      -\fB\fB+newgrp\fR \fB[\fR\fIarg ...\fR\fB]\fR\fR
     5573 +\fB+newgrp\fR \fB[\fR\fIarg ...\fR\fB]\fR
5317 5574  .ad
5318 5575  .sp .6
5319 5576  .RS 4n
5320 5577  Equivalent to \fBexec\fR \fB/bin/newgrp\fR \fIarg ...\fR
5321 5578  .RE
5322 5579  
5323 5580  .sp
5324 5581  .ne 2
5325 5582  .na
5326      -\fB\fBprint\fR [\fB-Renprs\fR] \fB[\fR \fB-u\fR \fIunit\fR\fB] [\fR \fB-f\fR
5327      -\fIformat\fR \fB] [\fR \fIarg ...\fR\fB]\fR\fR
     5583 +\fBprint\fR [\fB-CRenprsv\fR] \fB[\fR \fB-u\fR \fIunit\fR\fB] [\fR \fB-f\fR
     5584 +\fIformat\fR \fB] [\fR \fIarg ...\fR\fB]\fR
5328 5585  .ad
5329 5586  .sp .6
5330 5587  .RS 4n
5331 5588  With no options or with option \fB-\fR or \fB--\fR, each \fIarg\fR is printed
5332 5589  on standard output. The \fB-f\fR option causes the arguments to be printed as
5333 5590  described by \fBprintf\fR. In this case, any \fBe\fR, \fBn\fR, \fBr\fR, or
5334 5591  \fBR\fR options are ignored. Otherwise, unless the \fB-R\fR or \fB-r,\fR are
5335 5592  specified, the following escape conventions are applied:
5336 5593  .sp
5337 5594  .ne 2
5338 5595  .na
5339      -\fB\fB\ea\fR\fR
     5596 +\fB\ea\fR
5340 5597  .ad
5341 5598  .RS 8n
5342 5599  Alert character (\fBASCII\fR 07)
5343 5600  .RE
5344 5601  
5345 5602  .sp
5346 5603  .ne 2
5347 5604  .na
5348      -\fB\fB\eb\fR\fR
     5605 +\fB\eb\fR
5349 5606  .ad
5350 5607  .RS 8n
5351 5608  Backspace character (\fBASCII\fR 010)
5352 5609  .RE
5353 5610  
5354 5611  .sp
5355 5612  .ne 2
5356 5613  .na
5357      -\fB\fB\ec\fR\fR
     5614 +\fB\ec\fR
5358 5615  .ad
5359 5616  .RS 8n
5360 5617  Causes print to end without processing more arguments and not adding a NEWLINE
5361 5618  .RE
5362 5619  
5363 5620  .sp
5364 5621  .ne 2
5365 5622  .na
5366      -\fB\fB\ef\fR\fR
     5623 +\fB\ef\fR
5367 5624  .ad
5368 5625  .RS 8n
5369 5626  Form-feed character (\fBASCII\fR 014)
5370 5627  .RE
5371 5628  
5372 5629  .sp
5373 5630  .ne 2
5374 5631  .na
5375      -\fB\fB\en\fR\fR
     5632 +\fB\en\fR
5376 5633  .ad
5377 5634  .RS 8n
5378 5635  NEWLINE character (\fBASCII\fR 012)
5379 5636  .RE
5380 5637  
5381 5638  .sp
5382 5639  .ne 2
5383 5640  .na
5384      -\fB\fB\er\fR\fR
     5641 +\fB\er\fR
5385 5642  .ad
5386 5643  .RS 8n
5387 5644  RETURN character (\fBASCII\fR 015)
5388 5645  .RE
5389 5646  
5390 5647  .sp
5391 5648  .ne 2
5392 5649  .na
5393      -\fB\fB\et\fR\fR
     5650 +\fB\et\fR
5394 5651  .ad
5395 5652  .RS 8n
5396 5653  TAB character (\fBASCII\fR 011)
5397 5654  .RE
5398 5655  
5399 5656  .sp
5400 5657  .ne 2
5401 5658  .na
5402      -\fB\fB\ev\fR\fR
     5659 +\fB\ev\fR
5403 5660  .ad
5404 5661  .RS 8n
5405 5662  Vertical TAB character (\fBASCII\fR 013)
5406 5663  .RE
5407 5664  
5408 5665  .sp
5409 5666  .ne 2
5410 5667  .na
5411      -\fB\fB\eE\fR\fR
     5668 +\fB\eE\fR
5412 5669  .ad
5413 5670  .RS 8n
5414 5671  Escape character (\fBASCII\fR 033)
5415 5672  .RE
5416 5673  
5417 5674  .sp
5418 5675  .ne 2
5419 5676  .na
5420      -\fB\fB\e\e\fR\fR
     5677 +\fB\e\e\fR
5421 5678  .ad
5422 5679  .RS 8n
5423 5680  Backslash character \fB\e\fR
5424 5681  .RE
5425 5682  
5426 5683  .sp
5427 5684  .ne 2
5428 5685  .na
5429      -\fB\fB\e0\fR\fIx\fR\fR
     5686 +\fB\e0\fR\fIx\fR
5430 5687  .ad
5431 5688  .RS 8n
5432 5689  Character defined by the 1, 2, or 3-digit octal string specified by \fIx\fR
5433 5690  .RE
5434 5691  
5435 5692  The \fB-R\fR option prints all subsequent arguments and options other than
5436 5693  \fB-n\fR. The \fB-e\fR causes the escape conventions to be applied This is the
5437 5694  default behavior. It reverses the effect of an earlier \fB-r\fR. The \fB-p\fR
5438 5695  option causes the arguments to be written onto the pipe of the process spawned
5439      -with \fB|&\fR instead of standard output. The \fB-s\fR option causes the
5440      -arguments to be written onto the history file instead of standard output. The
5441      -\fB-u\fR option can be used to specify a one digit file descriptor unit number
5442      -\fIunit\fR on which the output is placed. The default is \fB1\fR. If the option
5443      -\fB-n\fR is used, no NEWLINE is added to the output.
     5696 +with \fB|&\fR instead of standard output. The \fB-v\fR option treats each
     5697 +\fIarg\fR as a variable name and writes the value in the \fBprintf %B\fR
     5698 +format. The \fB-C\fR option treats each \fIarg\fR as a variable name and
     5699 +writes the values in the \fBprintf %#B\fR format.
     5700 +The \fB-s\fR option causes the arguments to be written onto the history file
     5701 +instead of standard output. The \fB-u\fR option can be used to specify a one
     5702 +digit file descriptor unit number \fIunit\fR on which the output is placed. The
     5703 +default is \fB1\fR. If the option \fB-n\fR is used, no NEWLINE is added to the
     5704 +output.
5444 5705  .RE
5445 5706  
5446 5707  .sp
5447 5708  .ne 2
5448 5709  .na
5449      -\fB\fBprintf\fR \fIformat\fR\fB[\fR\fIarg ...\fR\fB]\fR\fR
     5710 +\fBprintf\fR \fIformat\fR\fB [\fR\fIarg ...\fR\fB]\fR
5450 5711  .ad
5451 5712  .sp .6
5452 5713  .RS 4n
5453 5714  The arguments \fIarg\fR are printed on standard output in accordance with the
5454 5715  \fBANSI-C\fR formatting rules associated with the format string \fIformat\fR.
5455 5716  If the number of arguments exceeds the number of format specifications, the
5456 5717  format string is reused to format remaining arguments. The following extensions
5457      -can also be used: A \fB%b\fR format can be used instead of \fB%s\fR to cause
     5718 +can also be used:
     5719 +
     5720 +.sp
     5721 +.ne 2
     5722 +.na
     5723 +\fB%b\fR
     5724 +.ad
     5725 +.sp .6
     5726 +.RS 4n
     5727 +A \fB%b\fR format can be used instead of \fB%s\fR to cause
5458 5728  escape sequences in the corresponding \fIarg\fR to be expanded as described in
5459      -\fBprint\fR. A \fB%B\fR option causes each of the arguments to be treated as
     5729 +\fBprint\fR.
     5730 +.RE
     5731 +
     5732 +.sp
     5733 +.ne 2
     5734 +.na
     5735 +\fB%B\fR
     5736 +.ad
     5737 +.sp .6
     5738 +.RS 4n
     5739 +A \fB%B\fR option causes each of the arguments to be treated as
5460 5740  variable names and the binary value of the variables is printed. This is most
5461      -useful for variables with an attribute of b. A \fB%H\fR format can be used
     5741 +useful for variables with an attribute of b.
     5742 +.RE
     5743 +
     5744 +.sp
     5745 +.ne 2
     5746 +.na
     5747 +\fB%H\fR
     5748 +.ad
     5749 +.sp .6
     5750 +.RS 4n
     5751 +A \fB%H\fR format can be used
5462 5752  instead of \fB%s\fR to cause characters in \fIarg\fR that are special in
5463      -\fBHTML\fR and \fBXML\fR to be output as their entity name. A \fB%P\fR format
5464      -can be used instead of \fB%s\fR to cause \fIarg\fR to be interpreted as an
5465      -extended regular expression and be printed as a shell pattern. A \fB%R\fR
     5753 +\fBHTML\fR and \fBXML\fR to be output as their entity name. The alternate
     5754 +flag \fB#\fR formats the output for use as a URI.
     5755 +.RE
     5756 +
     5757 +.sp
     5758 +.ne 2
     5759 +.na
     5760 +\fB%P\fR
     5761 +.ad
     5762 +.sp .6
     5763 +.RS 4n
     5764 +A \fB%P\fR format can be used instead of \fB%s\fR to cause \fIarg\fR to be
     5765 +interpreted as an extended regular expression and be printed as a shell
     5766 +pattern.
     5767 +.RE
     5768 +
     5769 +
     5770 +.sp
     5771 +.ne 2
     5772 +.na
     5773 +\fB%R\fR
     5774 +.ad
     5775 +.sp .6
     5776 +.RS 4n
     5777 +A \fB%R\fR
5466 5778  format can be used instead of \fB%s\fR to cause \fIarg\fR to be interpreted as
5467      -a shell pattern and to be printed as an extended regular expression. A \fB%q\fR
5468      -format can be used instead of \fB%\fRs to cause the resulting string to be
5469      -quoted in a manner than can be input again to the shell. A
5470      -\fB%(\fR\fIdate-format\fR\fB)T\fR format can be use to treat an argument as a
     5779 +a shell pattern and to be printed as an extended regular expression.
     5780 +.RE
     5781 +
     5782 +.sp
     5783 +.ne 2
     5784 +.na
     5785 +\fB%q\fR
     5786 +.ad
     5787 +.sp .6
     5788 +.RS 4n
     5789 +A \fB%q\fR format can be used instead of \fB%\fRs to cause the resulting string
     5790 +to be quoted in a manner than can be input again to the shell. When \fBq\fR is
     5791 +preceded by the alternative format specifier, \fB#\fR, the string is quoted in
     5792 +manner suitable as a field in a \fB.csv\fR format file.
     5793 +.RE
     5794 +
     5795 +.sp
     5796 +.ne 2
     5797 +.na
     5798 +\fB%(\fIdate-format\fR\fB)\fR
     5799 +.ad
     5800 +.sp .6
     5801 +.RS 4n
     5802 +A \fB%(\fR\fIdate-format\fR\fB)T\fR format can be use to treat an argument as a
5471 5803  date/time string and to format the date/time according to the \fIdate-format\fR
5472      -as defined for the \fBdate\fR(1) command. A \fB%Z\fR format outputs a byte
5473      -whose value is 0. The precision field of the %d format can be followed by a .
5474      -and the output base. In this case, the \fB#\fR flag character causes
5475      -\fBbase\fR\fI#\fR to be prepended. The \fB#\fR flag when used with the \fBd\fR
5476      -specifier without an output base, causes the output to be displayed in
5477      -thousands units with one of the suffixes \fBk\fR \fBM\fR \fBG\fR \fBT\fR
5478      -\fBP\fR \fBE\fR to indicate the unit. The \fB#\fR flag when used with the i
5479      -specifier causes the output to be displayed in \fB1024\fR with one of the
5480      -suffixes \fBKi\fR \fBMi\fR \fBGi\fR \fBTi\fR \fBPi\fR \fBEi\fR to indicate the
5481      -unit. The \fB=\fR flag has been added to center the output within the specified
5482      -field width.
     5804 +as defined for the \fBdate\fR(1) command.
5483 5805  .RE
5484 5806  
     5807 +
5485 5808  .sp
5486 5809  .ne 2
5487 5810  .na
5488      -\fB\fBpwd\fR [\fB-LP\fR]\fR
     5811 +\fB%Z\fR
5489 5812  .ad
5490 5813  .sp .6
5491 5814  .RS 4n
     5815 +A \fB%Z\fR format outputs a byte whose value is 0.
     5816 +.RE
     5817 +
     5818 +.sp
     5819 +.ne 2
     5820 +.na
     5821 +\fB%d\fR
     5822 +.ad
     5823 +.sp .6
     5824 +.RS 4n
     5825 +The precision field of the %d format can be followed by a . and the output
     5826 +base. In this case, the \fB#\fR flag character causes \fBbase\fR\fI#\fR to be
     5827 +prepended.
     5828 +.RE
     5829 +
     5830 +.sp
     5831 +.ne 2
     5832 +.na
     5833 +\fB#\fR
     5834 +.ad
     5835 +.sp .6
     5836 +.RS 4n
     5837 +The \fB#\fR flag, when used with the \fB%d\fR format without an output base,
     5838 +displays the output in powers of 1000 indicated by one of the following
     5839 +suffixes: \fBk M G T P E\fR, and when used with the \fB%i\fR format displays
     5840 +the output in powers of 1024 indicated by one of the following suffixes:
     5841 +\fBKi Mi Gi Ti Pi Ei\fR.
     5842 +
     5843 +.RE
     5844 +
     5845 +.sp
     5846 +.ne 2
     5847 +.na
     5848 +\fB=\fR
     5849 +.ad
     5850 +.sp .6
     5851 +.RS 4n
     5852 +The \fB=\fR flag centers the output within the specified field width.
     5853 +.RE
     5854 +
     5855 +.sp
     5856 +.ne 2
     5857 +.na
     5858 +\fBL\fR
     5859 +.ad
     5860 +.sp .6
     5861 +.RS 4n
     5862 +The \fBL\fR flag, when used with the \fB%c\fR or \fB%s\fR
     5863 +formats, treats precision as character width instead of byte count.
     5864 +.RE
     5865 +
     5866 +.sp
     5867 +.ne 2
     5868 +.na
     5869 +\fB,\fR
     5870 +.ad
     5871 +.sp .6
     5872 +.RS 4n
     5873 +The \fB,\fR flag, when used with the \fB%d\fR or \fB%f\fR
     5874 +formats, separates groups of digits with the grouping delimiter
     5875 +(, in groups of 3 in the C locale).
     5876 +.RE
     5877 +
     5878 +
     5879 +.RE
     5880 +
     5881 +.sp
     5882 +.ne 2
     5883 +.na
     5884 +\fBpwd\fR [\fB-LP\fR]\fR
     5885 +.ad
     5886 +.sp .6
     5887 +.RS 4n
5492 5888  Outputs the value of the current working directory. The \fB-L\fR option is the
5493 5889  default. It prints the logical name of the current directory. If the \fB-P\fR
5494 5890  option is specified, all symbolic links are resolved from the name. The last
5495 5891  instance of \fB-L\fR or \fB-P\fR on the command line determines which method is
5496 5892  used.
5497 5893  .RE
5498 5894  
5499 5895  .sp
5500 5896  .ne 2
5501 5897  .na
5502      -\fB\fBread\fR \fB[\fR\fB-Aprs\fR\fB] [\fR\fB-d\fR \fIdelim\fR\fB] [\fR \fB-n\fR
     5898 +\fBread\fR \fB[\fR\fB-ACSprsv\fR\fB] [\fR\fB-d\fR \fIdelim\fR\fB] [\fR \fB-n\fR
5503 5899  \fIn\fR\fB] [[\fR \fB-N\fR \fIn\fR\fB] [[\fR\fB-t\fR \fItimeout\fR\fB]
5504 5900  [\fR\fB-u\fR \fIunit\fR\fB] [\fR\fIvname\fR\fB?\fR\fIprompt\fR\fB] [\fR
5505      -\fIvname ...\fR \fB]\fR\fR
     5901 +\fIvname ...\fR \fB]\fR
5506 5902  .ad
5507 5903  .sp .6
5508 5904  .RS 4n
5509 5905  The shell input mechanism. One line is read and is broken up into fields using
5510 5906  the characters in IFS as separators. The escape character, \fB\e\fR, is used to
5511 5907  remove any special meaning for the next character and for line continuation.
5512 5908  The \fB-d\fR option causes the read to continue to the first character of
5513 5909  \fIdelim\fR rather than \fBNEWLINE\fR. The \fB-n\fR option causes at most
5514 5910  \fIn\fR bytes to read rather a full line but returns when reading from a slow
5515 5911  device as soon as any characters have been read. The \fB-N\fR option causes
5516 5912  exactly \fIn\fR to be read unless an end-of-file has been encountered or the
5517 5913  read times out because of the \fB-t\fR option. In raw mode, \fB-r\fR, the
5518 5914  \fB\e\fR character is not treated specially. The first field is assigned to the
5519 5915  first \fIvname\fR, the second field to the second \fIvname\fR, etc., with
5520 5916  leftover fields assigned to the last \fIvname\fR. When \fIvname\fR has the
5521 5917  binary attribute and \fB-n\fR or \fB-N\fR is specified, the bytes that are read
5522 5918  are stored directly into the variable. If the -v is specified, then the value
5523 5919  of the first \fIvname\fR is used as a default value when reading from a
5524 5920  terminal device. The \fB-A\fR option causes the variable \fIvname\fR to be
5525 5921  unset and each field that is read to be stored in successive elements of the
5526      -indexed array \fIvname\fR. The \fB-p\fR option causes the input line to be
     5922 +indexed array \fIvname\fR. The \fB-C\fR option causes the variable vname to be
     5923 +read as a compound variable. Blanks will be ignored when finding the beginning
     5924 +open parenthesis. The \fB-S\fR option causes the line to be treated like a
     5925 +record in a .csv format file so that double quotes can be used to allow the
     5926 +delimiter character and the new-line character to appear within a field.
     5927 +The \fB-p\fR option causes the input line to be
5527 5928  taken from the input pipe of a process spawned by the shell using \fB|&\fR. If
5528 5929  the \fB-s\fR option is present, the input is saved as a command in the history
5529 5930  file. The option \fB-u\fR can be used to specify a one digit file descriptor
5530 5931  unit \fIunit\fR to read from. The file descriptor can be opened with the
5531 5932  \fBexec\fR special built-in command. The default value of unit \fIn\fR is
5532 5933  \fB0\fR. The option \fB-t\fR is used to specify a time out in seconds when
5533 5934  reading from a terminal or pipe. If \fIvname\fR is omitted, then REPLY is used
5534 5935  as the default \fIvname\fR. An end-of-file with the \fB-p\fR option causes
5535 5936  cleanup for this process so that another can be spawned. If the first argument
5536 5937  contains a \fB?\fR, the remainder of this word is used as a prompt on standard
5537 5938  error when the shell is interactive. The exit status is \fB0\fR unless an
5538 5939  end-of-file is encountered or read has timed out.
5539 5940  .RE
5540 5941  
5541 5942  .sp
5542 5943  .ne 2
5543 5944  .na
5544      -\fB\fB++readonly\fR \fB[\fR\fB-p\fR\fB] [\fR
5545      -\fIvname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR\fR
     5945 +\fB++readonly\fR \fB[\fR\fB-p\fR\fB] [\fR
     5946 +\fIvname\fR\fB[=\fR\fIvalue\fR\fB]] ...\fR
5546 5947  .ad
5547 5948  .sp .6
5548 5949  .RS 4n
5549 5950  If \fIvname\fR is not specified, the names and values of each variable with the
5550 5951  read-only attribute is printed with the values quoted in a manner that allows
5551 5952  them to be input again. The \fB-p\fR option causes the word \fBreadonly\fR to
5552 5953  be inserted before each one. Otherwise, the specified \fIvname\fRs are marked
5553 5954  \fBreadonly\fR and these names cannot be changed by subsequent assignment.
5554 5955  .RE
5555 5956  
5556 5957  .sp
5557 5958  .ne 2
5558 5959  .na
5559      -\fB\fB+return\fR \fB[\fR\fIn\fR\fB]\fR\fR
     5960 +\fB+return\fR \fB[\fR\fIn\fR\fB]\fR
5560 5961  .ad
5561 5962  .sp .6
5562 5963  .RS 4n
5563 5964  Causes a shell function or script to return to the invoking script with the
5564 5965  exit status specified by \fIn\fR. The value is the least significant 8 bits of
5565 5966  the specified status. If \fBn\fR is omitted, then the return status is that of
5566 5967  the last command executed. If return is invoked while not in a function or a
5567 5968  script, then it behaves the same as exit.
5568 5969  .RE
5569 5970  
5570 5971  .sp
5571 5972  .ne 2
5572 5973  .na
5573      -\fB\fB+set [ \(+-BCGabefhkmnoprstuvx] [\(+-o [\fR \fIoption\fR \fB] ] ... [
5574      -\(+-A\fR \fIvname\fR\fB]\fR \fB[\fR\fIarg...\fR\fB]\fR\fR
     5974 +\fB+set [ \(+-BCGabefhkmnoprstuvx] [\(+-o [\fR \fIoption\fR \fB] ] ... [
     5975 +\(+-A\fR \fIvname\fR\fB]\fR \fB[\fR\fIarg...\fR\fB]\fR
5575 5976  .ad
5576 5977  .sp .6
5577 5978  .RS 4n
5578 5979  The \fBset\fR command supports the following options:
5579 5980  .sp
5580 5981  .ne 2
5581 5982  .na
5582      -\fB\fB-a\fR\fR
     5983 +\fB-a\fR
5583 5984  .ad
5584 5985  .sp .6
5585 5986  .RS 4n
5586 5987  All subsequent variables that are defined are automatically exported.
5587 5988  .RE
5588 5989  
5589 5990  .sp
5590 5991  .ne 2
5591 5992  .na
5592      -\fB\fB-A\fR\fR
     5993 +\fB-A\fR
5593 5994  .ad
5594 5995  .sp .6
5595 5996  .RS 4n
5596 5997  Array assignment. Unset the variable \fIvname\fR and assign values sequentially
5597 5998  from the \fIarg\fR list. If \fB+A\fR is used, the variable \fIvname\fR is not
5598 5999  unset first.
5599 6000  .RE
5600 6001  
5601 6002  .sp
5602 6003  .ne 2
5603 6004  .na
5604      -\fB\fB-b\fR\fR
     6005 +\fB-b\fR
5605 6006  .ad
5606 6007  .sp .6
5607 6008  .RS 4n
5608 6009  Prints job completion messages as soon as a background job changes state rather
5609 6010  than waiting for the next prompt.
5610 6011  .RE
5611 6012  
5612 6013  .sp
5613 6014  .ne 2
5614 6015  .na
5615      -\fB\fB-B\fR\fR
     6016 +\fB-B\fR
5616 6017  .ad
5617 6018  .sp .6
5618 6019  .RS 4n
5619 6020  Enable brace pattern field generation. This is the default behavior.
5620 6021  .RE
5621 6022  
5622 6023  .sp
5623 6024  .ne 2
5624 6025  .na
5625      -\fB\fB-C\fR\fR
     6026 +\fB-C\fR
5626 6027  .ad
5627 6028  .sp .6
5628 6029  .RS 4n
5629 6030  Prevents redirection (\fB>\fR) from truncating existing files. Files that are
5630 6031  created are opened with the \fBO_EXCL\fR mode. Requires \fB>|\fR to truncate a
5631 6032  file when turned on.
5632 6033  .RE
5633 6034  
5634 6035  .sp
5635 6036  .ne 2
5636 6037  .na
5637      -\fB\fB-e\fR\fR
     6038 +\fB-e\fR
5638 6039  .ad
5639 6040  .sp .6
5640 6041  .RS 4n
5641      -If a command has a \fBnon-zero\fR exit status, execute the \fBERR\fR trap, if
5642      -set, and exit. This mode is disabled while reading profiles.
     6042 +Unless contained in a \fB||\fR or \fB&&\fR command, or the command following an
     6043 +\fBif\fR, \fBwhile\fR or \fBuntil\fR command or in the pipeline following
     6044 +\fB!\fR, if a command has a non-zero exit status, execute the \fBERR\fR trap,
     6045 +if set, and exit. This mode is disabled while reading profiles.
5643 6046  .RE
5644 6047  
5645 6048  .sp
5646 6049  .ne 2
5647 6050  .na
5648      -\fB\fB-f\fR\fR
     6051 +\fB-f\fR
5649 6052  .ad
5650 6053  .sp .6
5651 6054  .RS 4n
5652 6055  Disables file name generation.
5653 6056  .RE
5654 6057  
5655 6058  .sp
5656 6059  .ne 2
5657 6060  .na
5658      -\fB\fB-G\fR\fR
     6061 +\fB-G\fR
5659 6062  .ad
5660 6063  .sp .6
5661 6064  .RS 4n
5662 6065  Causes the pattern \fB**\fR by itself to match files and zero or more
5663 6066  directories and subdirectories when used for file name generation. If followed
5664 6067  by a \fB/\fR only directories and subdirectories are matched.
5665 6068  .RE
5666 6069  
5667 6070  .sp
5668 6071  .ne 2
5669 6072  .na
5670      -\fB\fB-h\fR\fR
     6073 +\fB-h\fR
5671 6074  .ad
5672 6075  .sp .6
5673 6076  .RS 4n
5674 6077  Each command becomes a tracked alias when first encountered.
5675 6078  .RE
5676 6079  
5677 6080  .sp
5678 6081  .ne 2
5679 6082  .na
5680      -\fB\fB-k\fR\fR
     6083 +\fB-k\fR
5681 6084  .ad
5682 6085  .sp .6
5683 6086  .RS 4n
5684 6087  Obsolete. All variable assignment arguments are placed in the environment for a
5685 6088  command, not just those that precede the command name.
5686 6089  .RE
5687 6090  
5688 6091  .sp
5689 6092  .ne 2
5690 6093  .na
5691      -\fB\fB-m\fR\fR
     6094 +\fB-m\fR
5692 6095  .ad
5693 6096  .sp .6
5694 6097  .RS 4n
5695 6098  Background jobs run in a separate process group and a line prints upon
5696 6099  completion. The exit status of background jobs is reported in a completion
5697 6100  message. On systems with job control, this option is turned on automatically
5698 6101  for interactive shells.
5699 6102  .RE
5700 6103  
5701 6104  .sp
5702 6105  .ne 2
5703 6106  .na
5704      -\fB\fB-n\fR\fR
     6107 +\fB-n\fR
5705 6108  .ad
5706 6109  .sp .6
5707 6110  .RS 4n
5708 6111  Read commands and check them for syntax errors, but do not execute them.
5709 6112  Ignored for interactive shells.
5710 6113  .RE
5711 6114  
5712 6115  .sp
5713 6116  .ne 2
5714 6117  .na
5715      -\fB\fB-o\fR\fR
     6118 +\fB-o\fR
5716 6119  .ad
5717 6120  .sp .6
5718 6121  .RS 4n
5719 6122  If no option name is supplied, the list of options and their current settings
5720 6123  are written to standard output. When invoked with a \fB+\fR, the options are
5721 6124  written in a format that can be input again to the shell to restore the
5722 6125  settings. This option can be repeated to enable or disable multiple options.
5723 6126  .sp
5724 6127  The following argument can be one of the following option names:
5725 6128  .sp
5726 6129  .ne 2
5727 6130  .na
5728      -\fB\fBallexport\fR\fR
     6131 +\fBallexport\fR
5729 6132  .ad
5730 6133  .sp .6
5731 6134  .RS 4n
5732 6135  Same as \fB-a\fR.
5733 6136  .RE
5734 6137  
5735 6138  .sp
5736 6139  .ne 2
5737 6140  .na
5738      -\fB\fBbgnice\fR\fR
     6141 +\fBbgnice\fR
5739 6142  .ad
5740 6143  .sp .6
5741 6144  .RS 4n
5742 6145  All background jobs are run at a lower priority. This is the default mode.
5743 6146  .RE
5744 6147  
5745 6148  .sp
5746 6149  .ne 2
5747 6150  .na
5748      -\fB\fBbraceexpand\fR\fR
     6151 +\fBbraceexpand\fR
5749 6152  .ad
5750 6153  .sp .6
5751 6154  .RS 4n
5752 6155  Same as \fB-\fRB.
5753 6156  .RE
5754 6157  
5755 6158  .sp
5756 6159  .ne 2
5757 6160  .na
5758      -\fB\fBemacs\fR\fR
     6161 +\fBemacs\fR
5759 6162  .ad
5760 6163  .sp .6
5761 6164  .RS 4n
5762 6165  Puts you in an \fBemacs\fR style inline editor for command entry.
5763 6166  .RE
5764 6167  
5765 6168  .sp
5766 6169  .ne 2
5767 6170  .na
5768      -\fB\fBerrexit\fR\fR
     6171 +\fBerrexit\fR
5769 6172  .ad
5770 6173  .sp .6
5771 6174  .RS 4n
5772 6175  Same as \fB-e\fR.
5773 6176  .RE
5774 6177  
5775 6178  .sp
5776 6179  .ne 2
5777 6180  .na
5778      -\fB\fBglobstar\fR\fR
     6181 +\fBglobstar\fR
5779 6182  .ad
5780 6183  .sp .6
5781 6184  .RS 4n
5782 6185  Same as \fB-G\fR.
5783 6186  .RE
5784 6187  
5785 6188  .sp
5786 6189  .ne 2
5787 6190  .na
5788      -\fB\fBgmacs\fR\fR
     6191 +\fBgmacs\fR
5789 6192  .ad
5790 6193  .sp .6
5791 6194  .RS 4n
5792 6195  Puts you in a \fBgmacs\fR style inline editor for command entry.
5793 6196  .RE
5794 6197  
5795 6198  .sp
5796 6199  .ne 2
5797 6200  .na
5798      -\fB\fBignoreeof\fR\fR
     6201 +\fBignoreeof\fR
5799 6202  .ad
5800 6203  .sp .6
5801 6204  .RS 4n
5802 6205  The shell does not exit on end-of-file. The command \fBexit\fR must be used.
5803 6206  .RE
5804 6207  
5805 6208  .sp
5806 6209  .ne 2
5807 6210  .na
5808      -\fB\fBkeyword\fR\fR
     6211 +\fBkeyword\fR
5809 6212  .ad
5810 6213  .sp .6
5811 6214  .RS 4n
5812 6215  Same as \fB-k\fR.
5813 6216  .RE
5814 6217  
5815 6218  .sp
5816 6219  .ne 2
5817 6220  .na
5818      -\fB\fBmarkdirs\fR\fR
     6221 +\fBletoctal\fR
5819 6222  .ad
5820 6223  .sp .6
5821 6224  .RS 4n
     6225 +The \fBlet\fR command allows octal constants starting with \fB0\fR.
     6226 +.RE
     6227 +
     6228 +.sp
     6229 +.ne 2
     6230 +.na
     6231 +\fBmarkdirs\fR
     6232 +.ad
     6233 +.sp .6
     6234 +.RS 4n
5822 6235  All directory names resulting from file name generation have a trailing /
5823 6236  appended.
5824 6237  .RE
5825 6238  
5826 6239  .sp
5827 6240  .ne 2
5828 6241  .na
5829      -\fB\fBmonitor\fR\fR
     6242 +\fBmonitor\fR
5830 6243  .ad
5831 6244  .sp .6
5832 6245  .RS 4n
5833 6246  Same as \fB-m\fR.
5834 6247  .RE
5835 6248  
5836 6249  .sp
5837 6250  .ne 2
5838 6251  .na
5839      -\fB\fBmultiline\fR\fR
     6252 +\fBmultiline\fR
5840 6253  .ad
5841 6254  .sp .6
5842 6255  .RS 4n
5843 6256  The built-in editors use multiple lines on the screen for lines that are longer
5844 6257  than the width of the screen. This might not work for all terminals.
5845 6258  .RE
5846 6259  
5847 6260  .sp
5848 6261  .ne 2
5849 6262  .na
5850      -\fB\fBnoclobber\fR\fR
     6263 +\fBnoclobber\fR
5851 6264  .ad
5852 6265  .sp .6
5853 6266  .RS 4n
5854 6267  Same as \fB-C\fR.
5855 6268  .RE
5856 6269  
5857 6270  .sp
5858 6271  .ne 2
5859 6272  .na
5860      -\fB\fBnoexec\fR\fR
     6273 +\fBnoexec\fR
5861 6274  .ad
5862 6275  .sp .6
5863 6276  .RS 4n
5864 6277  Same as \fB-n\fR.
5865 6278  .RE
5866 6279  
5867 6280  .sp
5868 6281  .ne 2
5869 6282  .na
5870      -\fB\fBnoglob\fR\fR
     6283 +\fBnoglob\fR
5871 6284  .ad
5872 6285  .sp .6
5873 6286  .RS 4n
5874 6287  Same as \fB-f\fR.
5875 6288  .RE
5876 6289  
5877 6290  .sp
5878 6291  .ne 2
5879 6292  .na
5880      -\fB\fBnolog\fR\fR
     6293 +\fBnolog\fR
5881 6294  .ad
5882 6295  .sp .6
5883 6296  .RS 4n
5884 6297  Do not save function definitions in the history file.
5885 6298  .RE
5886 6299  
5887 6300  .sp
5888 6301  .ne 2
5889 6302  .na
5890      -\fB\fBnotify\fR\fR
     6303 +\fBnotify\fR
5891 6304  .ad
5892 6305  .sp .6
5893 6306  .RS 4n
5894 6307  Same as \fB-b\fR.
5895 6308  .RE
5896 6309  
5897 6310  .sp
5898 6311  .ne 2
5899 6312  .na
5900      -\fB\fBnounset\fR\fR
     6313 +\fBnounset\fR
5901 6314  .ad
5902 6315  .sp .6
5903 6316  .RS 4n
5904 6317  Same as \fB-u\fR.
5905 6318  .RE
5906 6319  
5907 6320  .sp
5908 6321  .ne 2
5909 6322  .na
5910      -\fB\fBpipefail\fR\fR
     6323 +\fBpipefail\fR
5911 6324  .ad
5912 6325  .sp .6
5913 6326  .RS 4n
5914 6327  A pipeline does not complete until all components of the pipeline have
5915 6328  completed, and the return value is the value of the last \fBnon-zero\fR command
5916 6329  to fail or zero if no command has failed.
5917 6330  .RE
5918 6331  
5919 6332  .sp
5920 6333  .ne 2
5921 6334  .na
5922      -\fB\fBprivileged\fR\fR
     6335 +\fBprivileged\fR
5923 6336  .ad
5924 6337  .sp .6
5925 6338  .RS 4n
5926 6339  Same as \fB-p\fR.
5927 6340  .RE
5928 6341  
5929 6342  .sp
5930 6343  .ne 2
5931 6344  .na
5932      -\fB\fBshowme\fR\fR
     6345 +\fBshowme\fR
5933 6346  .ad
5934 6347  .sp .6
5935 6348  .RS 4n
5936 6349  When enabled, simple commands or pipelines preceded by a a semicolon (\fB;\fR)
5937 6350  is displayed as if the \fBxtrace\fR option were enabled but is not executed.
5938 6351  Otherwise, the leading \fB;\fR is ignored.
5939 6352  .RE
5940 6353  
5941 6354  .sp
5942 6355  .ne 2
5943 6356  .na
5944      -\fB\fBtrackall\fR\fR
     6357 +\fBtrackall\fR
5945 6358  .ad
5946 6359  .sp .6
5947 6360  .RS 4n
5948 6361  Same as \fB-h\fR.
5949 6362  .RE
5950 6363  
5951 6364  .sp
5952 6365  .ne 2
5953 6366  .na
5954      -\fB\fBverbose\fR\fR
     6367 +\fBverbose\fR
5955 6368  .ad
5956 6369  .sp .6
5957 6370  .RS 4n
5958 6371  Same as \fB-v\fR.
5959 6372  .RE
5960 6373  
5961 6374  .sp
5962 6375  .ne 2
5963 6376  .na
5964      -\fB\fBvi\fR\fR
     6377 +\fBvi\fR
5965 6378  .ad
5966 6379  .sp .6
5967 6380  .RS 4n
5968 6381  Puts you in insert mode of a \fBvi\fR style inline editor until you hit the
5969 6382  escape character 033. This puts you in control mode. A return sends the line.
5970 6383  .RE
5971 6384  
5972 6385  .sp
5973 6386  .ne 2
5974 6387  .na
5975      -\fB\fBviraw\fR\fR
     6388 +\fBviraw\fR
5976 6389  .ad
5977 6390  .sp .6
5978 6391  .RS 4n
5979 6392  Each character is processed as it is typed in \fBvi\fR mode.
5980 6393  .RE
5981 6394  
5982 6395  .sp
5983 6396  .ne 2
5984 6397  .na
5985      -\fB\fBxtrace\fR\fR
     6398 +\fBxtrace\fR
5986 6399  .ad
5987 6400  .sp .6
5988 6401  .RS 4n
5989 6402  Same as \fB-x\fR.
5990 6403  .sp
5991 6404  If no option name is supplied, the current options settings are printed.
5992 6405  .RE
5993 6406  
5994 6407  .RE
5995 6408  
5996 6409  .sp
5997 6410  .ne 2
5998 6411  .na
5999      -\fB\fB-p\fR\fR
     6412 +\fB-p\fR
6000 6413  .ad
6001 6414  .sp .6
6002 6415  .RS 4n
6003 6416  Disables processing of the \fB$HOME/.profile\fR file and uses the file
6004 6417  \fB/etc/suid_profile\fR instead of the \fBENV\fR file. This mode is on whenever
6005 6418  the effective \fBuid\fR (\fBgid\fR) is not equal to the real \fBuid\fR
6006 6419  (\fBgid\fR). Turning this off causes the effective \fBuid\fR and \fBgid\fR to
6007 6420  be set to the real \fBuid\fR and \fBgid\fR.
6008 6421  .RE
6009 6422  
6010 6423  .sp
6011 6424  .ne 2
6012 6425  .na
6013      -\fB\fB-r\fR\fR
     6426 +\fB-r\fR
6014 6427  .ad
6015 6428  .sp .6
6016 6429  .RS 4n
6017 6430  Enables the restricted shell. This option cannot be unset once set.
6018 6431  .RE
6019 6432  
6020 6433  .sp
6021 6434  .ne 2
6022 6435  .na
6023      -\fB\fB-s\fR\fR
     6436 +\fB-s\fR
6024 6437  .ad
6025 6438  .sp .6
6026 6439  .RS 4n
6027 6440  Sort the positional parameters lexicographically.
6028 6441  .RE
6029 6442  
6030 6443  .sp
6031 6444  .ne 2
6032 6445  .na
6033      -\fB\fB-t\fR\fR
     6446 +\fB-t\fR
6034 6447  .ad
6035 6448  .sp .6
6036 6449  .RS 4n
6037 6450  Obsolete. Exit after reading and executing one command.
6038 6451  .RE
6039 6452  
6040 6453  .sp
6041 6454  .ne 2
6042 6455  .na
6043      -\fB\fB-u\fR\fR
     6456 +\fB-u\fR
6044 6457  .ad
6045 6458  .sp .6
6046 6459  .RS 4n
6047 6460  Treat \fBunset\fR parameters as an error when substituting.
6048 6461  .RE
6049 6462  
6050 6463  .sp
6051 6464  .ne 2
6052 6465  .na
6053      -\fB\fB-v\fR\fR
     6466 +\fB-v\fR
6054 6467  .ad
6055 6468  .sp .6
6056 6469  .RS 4n
6057 6470  Print shell input lines as they are read.
6058 6471  .RE
6059 6472  
6060 6473  .sp
6061 6474  .ne 2
6062 6475  .na
6063      -\fB\fB-x\fR\fR
     6476 +\fB-x\fR
6064 6477  .ad
6065 6478  .sp .6
6066 6479  .RS 4n
6067 6480  Print commands and their arguments as they are executed.
6068 6481  .RE
6069 6482  
6070 6483  .sp
6071 6484  .ne 2
6072 6485  .na
6073      -\fB\fB--\fR\fR
     6486 +\fB--\fR
6074 6487  .ad
6075 6488  .sp .6
6076 6489  .RS 4n
6077 6490  Do not change any of the options. This is useful in setting \fB$1\fR to a value
6078 6491  beginning with \fB-\fR. If no arguments follow this option then the positional
6079 6492  parameters are unset.
6080 6493  .RE
6081 6494  
6082 6495  As an obsolete feature, if the first \fIarg\fR is - then the \fB-x\fR and
6083 6496  \fB-v\fR options are turned off and the next \fIarg\fR is treated as the first
↓ open down ↓ 1 lines elided ↑ open up ↑
6085 6498  off. These options can also be used upon invocation of the shell. The current
6086 6499  set of options can be found in \fB$-\fR. Unless \fB-A\fR is specified, the
6087 6500  remaining arguments are positional parameters and are assigned, in order, to
6088 6501  \fB$1 $2 \&....\fR If no arguments are specified, then the names and values of
6089 6502  all variables are printed on the standard output.
6090 6503  .RE
6091 6504  
6092 6505  .sp
6093 6506  .ne 2
6094 6507  .na
6095      -\fB\fB+shift\fR \fB[\fR\fIn\fR\fB]\fR\fR
     6508 +\fB+shift\fR \fB[\fR\fIn\fR\fB]\fR
6096 6509  .ad
6097 6510  .sp .6
6098 6511  .RS 4n
6099 6512  The positional parameters from \fB$\fR\fIn\fR\fB+1 ...\fR are renamed
6100 6513  \fB$1 ...\fR, the default \fIn\fR is \fB1\fR. The parameter \fIn\fR can be any
6101 6514  arithmetic expression that evaluates to a non-negative number less than or
6102 6515  equal to \fB$#\fR.
6103 6516  .RE
6104 6517  
6105 6518  .sp
6106 6519  .ne 2
6107 6520  .na
6108      -\fB\fBsleep\fR \fIseconds\fR\fR
     6521 +\fBsleep\fR \fIseconds\fR
6109 6522  .ad
6110 6523  .sp .6
6111 6524  .RS 4n
6112 6525  Suspends execution for the number of decimal seconds or fractions of a second
6113 6526  specified by \fIseconds\fR.
6114 6527  .RE
6115 6528  
6116 6529  .sp
6117 6530  .ne 2
6118 6531  .na
6119      -\fB\fB+trap\fR \fB-p\fR \fB[\fR\fIaction\fR\fB]\fR
6120      -\fB[\fR\fIsig\fR\fB] ...\fR\fR
     6532 +\fB+trap\fR \fB-p\fR \fB[\fR\fIaction\fR\fB]\fR
     6533 +\fB[\fR\fIsig\fR\fB] ...\fR
6121 6534  .ad
6122 6535  .sp .6
6123 6536  .RS 4n
6124 6537  The \fB-p\fR option causes the trap action associated with each trap as
6125 6538  specified by the arguments to be printed with appropriate quoting. Otherwise,
6126 6539  \fIaction\fR is processed as if it were an argument to \fBeval\fR when the
6127 6540  shell receives signal(s) \fIsig\fR. Each \fIsig\fR can be specified as a number
6128 6541  or as the name of the signal. Trap commands are executed in order of signal
6129 6542  number. Any attempt to set a trap on a signal that was ignored on entry to the
6130 6543  current shell is ineffective. If \fIaction\fR is omitted and the first
↓ open down ↓ 10 lines elided ↑ open up ↑
6141 6554  or \fBEXIT\fR for a trap set outside any function then the command \fIaction\fR
6142 6555  is executed on exit from the shell. If \fIsig\fR is \fBKEYBD\fR, then
6143 6556  \fIaction\fR is executed whenever a key is read while in \fBemacs\fR,
6144 6557  \fBgmacs\fR, or \fBvi\fR mode. The \fBtrap\fR command with no arguments prints
6145 6558  a list of commands associated with each signal number.
6146 6559  .RE
6147 6560  
6148 6561  .sp
6149 6562  .ne 2
6150 6563  .na
6151      -\fB\fBtrue\fR\fR
     6564 +\fBtrue\fR
6152 6565  .ad
6153 6566  .sp .6
6154 6567  .RS 4n
6155 6568  Does nothing, and exits \fB0\fR. Used with while for infinite loops.
6156 6569  .RE
6157 6570  
6158 6571  .sp
6159 6572  .ne 2
6160 6573  .na
6161      -\fB\fB++typeset [\(+-AHflabnprtux ] [ \(+-EFLRZi[\fR\fIn\fR\fB] ] [\fR
6162      -\fIvname\fR\fB[=\fR\fIvalue\fR \fB] ]\fR\fR
     6574 +\fB++typeset [\(+-ACHSfblmnprtux ] [ \(+-EFLRXZi[\fR\fIn\fR\fB] ]
     6575 +[ \(+-M \fB[ \fImapname\fR \fB] ]
     6576 +[ -T [ \fR\fItname\fR\fB=(\fR\fIassign_list\fR\fB) ] ]
     6577 +[ -h \fR\fIstr\fR\fB ]
     6578 +[ -a [\fR\fItype\fR\fB] ]
     6579 +[ \fR\fIvname\fR\fB[=\fR\fIvalue\fR \fB] ]\fR
6163 6580  .ad
6164 6581  .sp .6
6165 6582  .RS 4n
6166 6583  Sets attributes and values for shell variables and functions. When invoked
6167 6584  inside a function defined with the \fBfunction\fR \fIname\fR syntax, a new
6168 6585  instance of the variable \fIvname\fR is created, and the variable's value and
6169 6586  type are restored when the function completes.
6170 6587  .sp
6171 6588  Using \fB+\fR rather than \fB-\fR causes these options to be turned off. If no
6172 6589  \fIvname\fR arguments are specified, a list of \fIvname\fRs (and optionally the
↓ open down ↓ 2 lines elided ↑ open up ↑
6175 6592  followed by the option letters to be printed before each name rather than the
6176 6593  names of the options. If any option other than \fB-p\fR is specified, only
6177 6594  those variables which have all of the specified options are printed. Otherwise,
6178 6595  the \fIvname\fRs and \fIattributes\fR of all variables that have attributes are
6179 6596  printed.
6180 6597  .sp
6181 6598  The following list of attributes can be specified:
6182 6599  .sp
6183 6600  .ne 2
6184 6601  .na
6185      -\fB\fB-a\fR\fR
     6602 +\fB-a\fR
6186 6603  .ad
6187 6604  .RS 6n
6188 6605  Declares \fIvname\fR to be an indexed array. This is optional unless except for
6189 6606  compound variable assignments.
6190 6607  .RE
6191 6608  
6192 6609  .sp
6193 6610  .ne 2
6194 6611  .na
6195      -\fB\fB-A\fR\fR
     6612 +\fB-A\fR
6196 6613  .ad
6197 6614  .RS 6n
6198 6615  Declares \fIvname\fR to be an associative array. Sub-scripts are strings rather
6199 6616  than arithmetic expressions.
6200 6617  .RE
6201 6618  
6202 6619  .sp
6203 6620  .ne 2
6204 6621  .na
6205      -\fB\fB-b\fR\fR
     6622 +\fB-b\fR
6206 6623  .ad
6207 6624  .RS 6n
6208 6625  The variable can hold any number of bytes of data. The data can be text or
6209 6626  binary. The value is represented by the \fBbase64\fR encoding of the data. If
6210 6627  \fB-Z\fR is also specified, the size in bytes of the data in the buffer is
6211 6628  determined by the size associated with the \fB-Z\fR. If the \fBbase64\fR string
6212 6629  assigned results in more data, it is truncated. Otherwise, it is filled with
6213 6630  bytes whose value is zero. The \fBprintf\fR format \fB%B\fR can be used to
6214 6631  output the actual data in this buffer instead of the \fBbase64\fR encoding of
6215 6632  the data.
6216 6633  .RE
6217 6634  
6218 6635  .sp
6219 6636  .ne 2
6220 6637  .na
6221      -\fB\fB-E\fR\fR
     6638 +\fB-C\fR
6222 6639  .ad
6223 6640  .RS 6n
     6641 +Causes each \fIvname\fR to be a compound variable. If \fIvalue\fR names
     6642 +a compound variable it is copied into \fIvname\fR. Otherwise, it unsets each
     6643 +vname.
     6644 +.RE
     6645 +
     6646 +.sp
     6647 +.ne 2
     6648 +.na
     6649 +\fB-E\fR
     6650 +.ad
     6651 +.RS 6n
6224 6652  Declares \fIvname\fR to be a double precision floating point number. If \fIn\fR
6225 6653  is \fBnon-zero\fR, it defines the number of significant figures that are used
6226 6654  when expanding \fIvname\fR. Otherwise, ten significant figures is used.
6227 6655  .RE
6228 6656  
6229 6657  .sp
6230 6658  .ne 2
6231 6659  .na
6232      -\fB\fB-f\fR\fR
     6660 +\fB-f\fR
6233 6661  .ad
6234 6662  .RS 6n
6235 6663  The names refer to function names rather than variable names. No assignments
6236 6664  can be made and the only other valid options are \fB-t\fR, \fB-u\fR, and
6237 6665  \fB-x.\fR The \fB-t\fR option turns on execution tracing for this function. The
6238 6666  \fB-u\fR option causes this function to be marked undefined. The \fBFPATH\fR
6239 6667  variable is searched to find the function definition when the function is
6240 6668  referenced. If no options other than \fB-f\fR is specified, then the function
6241 6669  definition is displayed on standard output. If \fB+f\fR is specified, then a
6242 6670  line containing the function name followed by a shell comment containing the
6243 6671  line number and path name of the file where this function was defined, if any,
6244 6672  is displayed.
     6673 +The names refer to function names rather than variable names.
     6674 +No assignments can be made and the only other valid options are
     6675 +\fB-S, -t, -u\fR and \fB-x\fR.
     6676 +The \fB-S\fR can be used with discipline functions defined in a type to
     6677 +indicate that the function is static. For a static function, the same method
     6678 +will be used by all instances of that type no matter which instance references
     6679 +it. In addition, it can only use value of variables from the original type
     6680 +definition. These discipline functions cannot be redefined in any type
     6681 +instance.
     6682 +The \fB-t\fR option turns on execution tracing for this function.
     6683 +The \fB-u\fR option causes this function to be marked undefined.
     6684 +The \fBFPATH\fR variable will be searched to find the function definition
     6685 +when the function is referenced.
     6686 +If no options other than \fB-f\fR is specified, then the function definition
     6687 +will be displayed on standard output. If \fB+f\fR is specified, then a line
     6688 +containing the function name followed by a shell comment containing the line
     6689 +number and path name of the file where this function was defined, if any, is
     6690 +displayed. The exit status can be used to determine whether the function is
     6691 +defined so that \fBtypeset -f .sh.math.\fR \fIname\fR will return 0 when math
     6692 +function \fIname\fR is defined and non-zero otherwise.
6245 6693  .sp
6246 6694  The \fB-i\fR attribute cannot be specified with \fB-f\fR.
6247 6695  .RE
6248 6696  
6249 6697  .sp
6250 6698  .ne 2
6251 6699  .na
6252      -\fB\fB-F\fR\fR
     6700 +\fB-F\fR
6253 6701  .ad
6254 6702  .RS 6n
6255 6703  Declares \fIvname\fR to be a double precision floating point number. If \fIn\fR
6256 6704  is \fBnon-zero\fR, it defines the number of places after the decimal point that
6257 6705  are used when expanding \fIvname\fR. Otherwise ten places after the decimal
6258 6706  point is used.
6259 6707  .RE
6260 6708  
6261 6709  .sp
6262 6710  .ne 2
6263 6711  .na
6264      -\fB\fB-H\fR\fR
     6712 +\fB-h\fR
6265 6713  .ad
6266 6714  .RS 6n
     6715 +Used within type definitions to add information when generating information
     6716 +about the sub-variable on the man page. It is ignored when used outside of a
     6717 +type definition. When used with \fB-f\fR the information is associated with the
     6718 +corresponding discipline function.
     6719 +.RE
     6720 +
     6721 +.sp
     6722 +.ne 2
     6723 +.na
     6724 +\fB-H\fR
     6725 +.ad
     6726 +.RS 6n
6267 6727  This option provides UNIX to hostname file mapping on non-UNIX machines.
6268 6728  .RE
6269 6729  
6270 6730  .sp
6271 6731  .ne 2
6272 6732  .na
6273      -\fB\fB-i\fR\fR
     6733 +\fB-i\fR
6274 6734  .ad
6275 6735  .RS 6n
6276 6736  Declares \fIvname\fR to be represented internally as integer. The right hand
6277 6737  side of an assignment is evaluated as an arithmetic expression when assigning
6278 6738  to an integer. If \fIn\fR is \fBnon-zero\fR, it defines the output arithmetic
6279 6739  base, otherwise the output base is ten.
6280 6740  .sp
6281 6741  The \fB-i\fR attribute cannot be specified along with \fB-R\fR, \fB-L\fR,
6282 6742  \fB-Z\fR, or \fB-f\fR.
6283 6743  .RE
6284 6744  
6285 6745  .sp
6286 6746  .ne 2
6287 6747  .na
6288      -\fB\fB-l\fR\fR
     6748 +\fB-l\fR
6289 6749  .ad
6290 6750  .RS 6n
6291      -All uppercase characters are converted to lowercase. The uppercase option,
6292      -\fB-u\fR, is turned off.
     6751 +Used with \fB-i, -E\fR or \fB-F\fR to indicate long integer, or long float.
     6752 +Otherwise, all upper-case characters are converted to lower-case.
     6753 +The upper-case option, \fB-u\fR, is turned off.
     6754 +Equivalent to \fB-M tolower\fR.
6293 6755  .RE
6294 6756  
6295 6757  .sp
6296 6758  .ne 2
6297 6759  .na
6298      -\fB\fB-L\fR\fR
     6760 +\fB-L\fR
6299 6761  .ad
6300 6762  .RS 6n
6301 6763  Left justify and remove leading blanks from \fIvalue\fR. If \fIn\fR is
6302 6764  \fBnon-zero\fR, it defines the width of the field, otherwise it is determined
6303 6765  by the width of the value of first assignment. When the variable is assigned
6304 6766  to, it is filled on the right with blanks or truncated, if necessary, to fit
6305 6767  into the field. The \fB-R\fR option is turned off.
6306 6768  .sp
6307 6769  The \fB-i\fR attribute cannot be specified with \fB-L\fR.
6308 6770  .RE
6309 6771  
6310 6772  .sp
6311 6773  .ne 2
6312 6774  .na
6313      -\fB\fB-n\fR\fR
     6775 +\fB-m\fR
6314 6776  .ad
6315 6777  .RS 6n
     6778 +moves or renames the variable. The value is the name of a variable whose value
     6779 +will be moved to \fIvname\fR. The original variable will be unset. Cannot be
     6780 +used with any other options.
     6781 +.RE
     6782 +
     6783 +.sp
     6784 +.ne 2
     6785 +.na
     6786 +\fB-M\fR
     6787 +.ad
     6788 +.RS 6n
     6789 +Use the character mapping \fImapping\fR such as \fBtolower\fR
     6790 +and \fBtoupper\fR when assigning a value to each of the specified operands.
     6791 +When \fImapping\fR is specified and there are not operands, all variables
     6792 +that use this mapping are written to standard output.
     6793 +When \fImapping\fR is omitted and there are no operands, all mapped
     6794 +variables are written to standard output.
     6795 +.RE
     6796 +
     6797 +.sp
     6798 +.ne 2
     6799 +.na
     6800 +\fB-n\fR
     6801 +.ad
     6802 +.RS 6n
6316 6803  Declares \fIvname\fR to be a reference to the variable whose name is defined by
6317 6804  the value of variable \fIvname\fR. This is usually used to reference a variable
6318 6805  inside a function whose name has been passed as an argument.
6319 6806  .RE
6320 6807  
6321 6808  .sp
6322 6809  .ne 2
6323 6810  .na
6324      -\fB\fB-R\fR\fR
     6811 +\fB-p\fR
6325 6812  .ad
6326 6813  .RS 6n
     6814 +The name, attributes and values for the given \fIvname\fR
     6815 +are written on standard output in a form that can be used as shell input.
     6816 +If \fB+p\fR is specified, then the values are not displayed.
     6817 +.RE
     6818 +
     6819 +.sp
     6820 +.ne 2
     6821 +.na
     6822 +\fB-R\fR
     6823 +.ad
     6824 +.RS 6n
6327 6825  Right justify and fill with leading blanks. If \fIn\fR is \fBnon-zero\fR, it
6328 6826  defines the width of the field, otherwise it is determined by the width of the
6329 6827  value of first assignment. The field is left filled with blanks or truncated
6330 6828  from the end if the variable is reassigned. The \fB-L\fR option is turned off.
6331 6829  .sp
6332 6830  The \fB-i\fR attribute cannot be specified with \fB-R\fR.
6333 6831  .RE
6334 6832  
6335 6833  .sp
6336 6834  .ne 2
6337 6835  .na
6338      -\fB\fB-r\fR\fR
     6836 +\fB-r\fR
6339 6837  .ad
6340 6838  .RS 6n
6341 6839  The specified \fIvname\fRs are marked read-only and these names cannot be
6342 6840  changed by subsequent assignment.
6343 6841  .RE
6344 6842  
6345 6843  .sp
6346 6844  .ne 2
6347 6845  .na
6348      -\fB\fB-t\fR\fR
     6846 +\fB-S\fR
6349 6847  .ad
6350 6848  .RS 6n
     6849 +When used within the \fIassign_list\fR of a type definition, it causes the
     6850 +specified sub-variable to be shared by all instances of the type. When used
     6851 +inside a function defined with the \fBfunction\fR reserved word, the specified
     6852 +variables will have \fIfunction static\fR scope. Otherwise, the variable is
     6853 +unset prior to processing the assignment list.
     6854 +.RE
     6855 +
     6856 +.sp
     6857 +.ne 2
     6858 +.na
     6859 +\fB-t\fR
     6860 +.ad
     6861 +.RS 6n
6351 6862  Tags the variables. Tags are user definable and have no special meaning to the
6352 6863  shell.
6353 6864  .RE
6354 6865  
6355 6866  .sp
6356 6867  .ne 2
6357 6868  .na
6358      -\fB\fB-u\fR\fR
     6869 +\fB-T\fR
6359 6870  .ad
6360 6871  .RS 6n
6361      -All lowercase characters are converted to uppercase. The lowercase option,
6362      -\fB-l\fR, is turned off.
     6872 +If followed by \fItname\fR, it creates a type named by \fItname\fR using the
     6873 +compound assignment \fIassign_list\fR to \fItname\fR. Otherwise, it writes all
     6874 +the type definitions to standard output.
6363 6875  .RE
6364 6876  
6365 6877  .sp
6366 6878  .ne 2
6367 6879  .na
6368      -\fB\fB-x\fR\fR
     6880 +\fB-u\fR
6369 6881  .ad
6370 6882  .RS 6n
     6883 +When given along with \fB-i\fR specifies unsigned integer.
     6884 +Otherwise, all lower-case characters are converted to upper-case.
     6885 +The lower-case option, \fB-l\fR, is turned off.
     6886 +Equivalent to \fB-M toupper\fR.
     6887 +.RE
     6888 +
     6889 +.sp
     6890 +.ne 2
     6891 +.na
     6892 +\fB-x\fR
     6893 +.ad
     6894 +.RS 6n
6371 6895  The specified \fIvname\fRs are marked for automatic export to the environment
6372      -of subsequently-executed commands. Variables whose names contain a . cannot be
6373      -exported.
     6896 +of subsequently-executed commands. Variables whose names contain a \fB.\fR
     6897 +cannot be exported.
6374 6898  .RE
6375 6899  
6376 6900  .sp
6377 6901  .ne 2
6378 6902  .na
6379      -\fB\fB-Z\fR\fR
     6903 +\fB-X\fR
6380 6904  .ad
6381 6905  .RS 6n
     6906 +Declares \fIvname\fR to be a double precision floating point number
     6907 +and expands using the \fB%a\fR format of ISO-C99.
     6908 +If \fIn\fR is non-zero, it defines the number of hex digits after
     6909 +the radix point that is used when expanding \fIvname\fR.
     6910 +The default is 10.
     6911 +.RE
     6912 +
     6913 +.sp
     6914 +.ne 2
     6915 +.na
     6916 +\fB-Z\fR
     6917 +.ad
     6918 +.RS 6n
6382 6919  Right justify and fill with leading zeros if the first non-blank character is a
6383 6920  digit and the \fB-L\fR option has not been set. Remove leading zeros if the
6384 6921  \fB-L\fR option is also set. If \fIn\fR is \fBnon-zero\fR, it defines the width
6385 6922  of the field, otherwise it is determined by the width of the value of first
6386 6923  assignment.
6387 6924  .sp
6388 6925  The \fB-i\fR attribute cannot be specified with \fB-Z\fR.
6389 6926  .RE
6390 6927  
6391 6928  .RE
6392 6929  
6393 6930  .sp
6394 6931  .ne 2
6395 6932  .na
6396      -\fB\fBulimit [\fR\fB-HSacdfmnpstv\fR\fB] [\fR \fIlimit\fR\fB]\fR\fR
     6933 +\fBulimit [\fR\fB-HSacdfmnpstv\fR\fB] [\fR \fIlimit\fR\fB]\fR
6397 6934  .ad
6398 6935  .sp .6
6399 6936  .RS 4n
6400 6937  Set or display a resource limit. Many systems do not support one or more of
6401 6938  these limits. The limit for a specified resource is set when \fIlimit\fR is
6402 6939  specified. The value of \fIlimit\fR can be a number in the unit specified with
6403 6940  each resource, or the value unlimited. When more than one resource is
6404 6941  specified, then the limit name and unit is printed before the value.
6405 6942  .sp
6406 6943  If no option is specified, \fB-f\fR is assumed.
6407 6944  .sp
6408 6945  The following are the available resource limits:
6409 6946  .sp
6410 6947  .ne 2
6411 6948  .na
6412      -\fB\fB-a\fR\fR
     6949 +\fB-a\fR
6413 6950  .ad
6414 6951  .RS 6n
6415 6952  Lists all of the current resource limits.
6416 6953  .RE
6417 6954  
6418 6955  .sp
6419 6956  .ne 2
6420 6957  .na
6421      -\fB\fB-c\fR\fR
     6958 +\fB-c\fR
6422 6959  .ad
6423 6960  .RS 6n
6424 6961  The number of 512-byte blocks on the size of core dumps.
6425 6962  .RE
6426 6963  
6427 6964  .sp
6428 6965  .ne 2
6429 6966  .na
6430      -\fB\fB-d\fR\fR
     6967 +\fB-d\fR
6431 6968  .ad
6432 6969  .RS 6n
6433 6970  The number of Kbytes on the size of the data area.
6434 6971  .RE
6435 6972  
6436 6973  .sp
6437 6974  .ne 2
6438 6975  .na
6439      -\fB\fB-f\fR\fR
     6976 +\fB-f\fR
6440 6977  .ad
6441 6978  .RS 6n
6442 6979  The number of 512-byte blocks on files that can be written by the current
6443 6980  process or by child processes (files of any size can be read).
6444 6981  .RE
6445 6982  
6446 6983  .sp
6447 6984  .ne 2
6448 6985  .na
6449      -\fB\fB-H\fR\fR
     6986 +\fB-H\fR
6450 6987  .ad
6451 6988  .RS 6n
6452 6989  Specifies a hard limit for the specified resource.
6453 6990  .sp
6454 6991  A hard limit cannot be increased once it is set.
6455 6992  .sp
6456 6993  If neither the \fB-H\fR nor \fB-S\fR option is specified, the limit applies to
6457 6994  both. The current resource limit is printed when \fIlimit\fR is omitted. In
6458 6995  this case, the soft limit is printed unless \fB-H\fR is specified.
6459 6996  .RE
6460 6997  
6461 6998  .sp
6462 6999  .ne 2
6463 7000  .na
6464      -\fB\fB-m\fR\fR
     7001 +\fB-m\fR
6465 7002  .ad
6466 7003  .RS 6n
6467 7004  The number of Kbytes on the size of physical memory.
6468 7005  .RE
6469 7006  
6470 7007  .sp
6471 7008  .ne 2
6472 7009  .na
6473      -\fB\fB-n\fR\fR
     7010 +\fB-n\fR
6474 7011  .ad
6475 7012  .RS 6n
6476 7013  The number of file descriptors plus 1.
6477 7014  .RE
6478 7015  
6479 7016  .sp
6480 7017  .ne 2
6481 7018  .na
6482      -\fB\fB-p\fR\fR
     7019 +\fB-p\fR
6483 7020  .ad
6484 7021  .RS 6n
6485 7022  The number of 512-byte blocks for pipe buffering.
6486 7023  .RE
6487 7024  
6488 7025  .sp
6489 7026  .ne 2
6490 7027  .na
6491      -\fB\fB-s\fR\fR
     7028 +\fB-s\fR
6492 7029  .ad
6493 7030  .RS 6n
6494 7031  The number of Kbytes on the size of the stack area.
6495 7032  .RE
6496 7033  
6497 7034  .sp
6498 7035  .ne 2
6499 7036  .na
6500      -\fB\fB-S\fR\fR
     7037 +\fB-S\fR
6501 7038  .ad
6502 7039  .RS 6n
6503 7040  Specifies a soft limit for the specified resource.
6504 7041  .sp
6505 7042  A soft limit can be increased up to the value of the hard limit.
6506 7043  .sp
6507 7044  If neither the \fB-H\fR nor \fB-S\fR option is specified, the limit applies to
6508 7045  both. The current resource limit is printed when \fIlimit\fR is omitted. In
6509 7046  this case, the soft limit is printed unless \fB-H\fR is specified.
6510 7047  .RE
6511 7048  
6512 7049  .sp
6513 7050  .ne 2
6514 7051  .na
6515      -\fB\fB-t\fR\fR
     7052 +\fB-t\fR
6516 7053  .ad
6517 7054  .RS 6n
6518 7055  The number of CPU seconds to be used by each process.
6519 7056  .RE
6520 7057  
6521 7058  .sp
6522 7059  .ne 2
6523 7060  .na
6524      -\fB\fB-v\fR\fR
     7061 +\fB-v\fR
6525 7062  .ad
6526 7063  .RS 6n
6527 7064  The number of Kbytes for virtual memory.
6528 7065  .RE
6529 7066  
6530 7067  .RE
6531 7068  
6532 7069  .sp
6533 7070  .ne 2
6534 7071  .na
6535      -\fB\fBumask\fR \fB[\fR\fB-S\fR\fB]\fR\fB[\fR\fImask\fR\fB]\fR\fR
     7072 +\fBumask\fR \fB[\fR\fB-S\fR\fB]\fR\fB[\fR\fImask\fR\fB]\fR
6536 7073  .ad
6537 7074  .sp .6
6538 7075  .RS 4n
6539 7076  The user file-creation mask is set to \fImask\fR. \fImask\fR can either be an
6540 7077  octal number or a symbolic value as described in \fBchmod\fR(1).
6541 7078  .sp
6542 7079  If a symbolic value is specified, the new \fBumask\fR value is the complement
6543 7080  of the result of applying \fImask\fR to the complement of the previous
6544 7081  \fBumask\fR value. If \fImask\fR is omitted, the current value of the mask is
6545 7082  printed. The \fB-S\fR option causes the mode to be printed as a symbolic value.
6546 7083  Otherwise, the mask is printed in octal.
6547 7084  .sp
6548 7085  See \fBumask\fR(2)
6549 7086  .RE
6550 7087  
6551 7088  .sp
6552 7089  .ne 2
6553 7090  .na
6554      -\fB\fB+unalias\fR \fB[\fR\fB-a\fR\fB]\fR \fIname\fR\fR
     7091 +\fB+unalias\fR \fB[\fR\fB-a\fR\fB]\fR \fIname\fR
6555 7092  .ad
6556 7093  .sp .6
6557 7094  .RS 4n
6558 7095  The aliases specified by the list of \fIname\fRs are removed from the alias
6559 7096  list. The \fB-a\fR option causes all the aliases to be unset.
6560 7097  .RE
6561 7098  
6562 7099  .sp
6563 7100  .ne 2
6564 7101  .na
6565      -\fB\fB+unset\fR \fB[\fR\fB-fnv\fR\fB]\fR \fIvname\fR\fR
     7102 +\fB+unset\fR \fB[\fR\fB-fnv\fR\fB]\fR \fIvname\fR
6566 7103  .ad
6567 7104  .sp .6
6568 7105  .RS 4n
6569 7106  The variables specified by the list of \fIvname\fRs are unassigned, i.e., their
6570 7107  values and attributes are erased. Read-only variables cannot be unset. If the
6571 7108  \fB-f\fR option is set, then the names refer to function names. If the \fB-v\fR
6572 7109  option is set, then the names refer to variable names. The \fB-f\fR option
6573 7110  overrides \fB-v\fR. If \fB-n\fR is set and \fIname\fR is a name reference, then
6574 7111  \fIname\fR is unset rather than the variable that it references. The default is
6575 7112  equivalent to \fB-v\fR. Unsetting \fBLINENO\fR, \fBMAILCHECK\fR, \fBOPTARG\fR,
6576 7113  \fBOPTIND\fR, \fBRANDOM\fR, \fBSECONDS\fR, \fBTMOUT\fR, and \fB_\fR removes
6577 7114  their special meaning even if they are subsequently assigned to.
6578 7115  .RE
6579 7116  
6580 7117  .sp
6581 7118  .ne 2
6582 7119  .na
6583      -\fB\fBwait\fR \fB[\fR\fIjob\fR\fB]\fR\fR
     7120 +\fBwait\fR \fB[\fR\fIjob\fR\fB]\fR
6584 7121  .ad
6585 7122  .sp .6
6586 7123  .RS 4n
6587 7124  Wait for the specified job and report its termination status. If \fIjob\fR is
6588 7125  not specified, then all currently active child processes are waited for. The
6589 7126  exit status from this command is that of the last process waited for if
6590 7127  \fIjob\fR is specified; otherwise it is zero. See \fBJobs\fR for a description
6591 7128  of the format of \fIjob\fR.
6592 7129  .RE
6593 7130  
6594 7131  .sp
6595 7132  .ne 2
6596 7133  .na
6597      -\fB\fBwhence\fR \fB[\fR\fB-afpv\fR\fB]\fR \fIname ...\fR\fR
     7134 +\fBwhence\fR \fB[\fR\fB-afpv\fR\fB]\fR \fIname ...\fR
6598 7135  .ad
6599 7136  .sp .6
6600 7137  .RS 4n
6601 7138  For each \fIname\fR, indicate how it would be interpreted if used as a command
6602 7139  name. The \fB-v\fR option produces a more verbose report. The \fB-f\fR option
6603 7140  skips the search for functions. The \fB-p\fR option does a path search for
6604 7141  \fIname\fR even if name is an alias, a function, or a reserved word. The
6605 7142  \fB-a\fR option is similar to the -v option but causes all interpretations of
6606 7143  the specified name to be reported.
6607 7144  .RE
6608 7145  
6609 7146  .SS "Invocation"
6610      -.LP
6611 7147  If the shell is invoked by \fBexec\fR(2), and the first character of argument
6612 7148  zero (\fB$0\fR) is \fB-\fR, then the shell is assumed to be a login shell and
6613 7149  commands are read from \fB/etc/profile\fR and then from either .\fBprofile\fR
6614 7150  in the current directory or \fB$HOME/.profile\fR, if either file exists. Next,
6615 7151  for interactive shells, commands are read first from \fB/etc/ksh.kshrc\fR, and
6616 7152  then from the file named by performing parameter expansion, command
6617 7153  substitution, and arithmetic substitution on the value of the environment
6618 7154  variable \fBENV\fR if the file exists. If the \fB-s\fR option is not present
6619 7155  and \fIarg\fR and a file by the name of \fIarg\fR exists, then it reads and
6620 7156  executes this script. Otherwise, if the first \fIarg\fR does not contain a
↓ open down ↓ 2 lines elided ↑ open up ↑
6623 7159  permission and any \fBsetuid\fR and \fBsetgid\fR settings are ignored. If the
6624 7160  script is not found on the path, \fIarg\fR is processed as if it named a
6625 7161  built-in command or function.
6626 7162  .sp
6627 7163  .LP
6628 7164  Commands are then read as described, and the following options are interpreted
6629 7165  by the shell when it is invoked:
6630 7166  .sp
6631 7167  .ne 2
6632 7168  .na
6633      -\fB\fB-c\fR\fR
     7169 +\fB-c\fR
6634 7170  .ad
6635 7171  .RS 15n
6636 7172  If the \fB-c\fR option is present, then commands are read from the first
6637 7173  \fIarg\fR. Any remaining arguments become positional parameters starting at
6638 7174  \fB0\fR.
6639 7175  .RE
6640 7176  
6641 7177  .sp
6642 7178  .ne 2
6643 7179  .na
6644      -\fB\fB-D\fR\fR
     7180 +\fB-D\fR
6645 7181  .ad
6646 7182  .RS 15n
6647 7183  A list of all double quoted strings that are preceded by a \fB$\fR is printed
6648 7184  on standard output and the shell exits. This set of strings is subject to
6649 7185  language translation when the locale is not C or POSIX. No commands are
6650 7186  executed.
6651 7187  .RE
6652 7188  
6653 7189  .sp
6654 7190  .ne 2
6655 7191  .na
6656      -\fB\fB-i\fR\fR
     7192 +\fB-E\fR
6657 7193  .ad
6658 7194  .RS 15n
     7195 +Reads the file named by the \fBENV\fR variable or by \fB$HOME/.kshrc\fR if
     7196 +not defined after the profiles.
     7197 +.RE
     7198 +
     7199 +.sp
     7200 +.ne 2
     7201 +.na
     7202 +\fB-i\fR
     7203 +.ad
     7204 +.RS 15n
6659 7205  If the \fB-i\fR option is present or if the shell input and output are attached
6660 7206  to a terminal (as told by \fBtcgetattr\fR(3C), this shell is interactive. In
6661 7207  this case \fBTERM\fR is ignored (so that \fBkill 0\fR does not kill an
6662 7208  interactive shell) and \fBINTR\fR is caught and ignored (so that wait is
6663 7209  interruptible). In all cases, \fBQUIT\fR is ignored by the shell.
6664 7210  .RE
6665 7211  
6666 7212  .sp
6667 7213  .ne 2
6668 7214  .na
6669      -\fB\fB-R\fR \fIfilename\fR\fR
     7215 +\fB-P\fR
6670 7216  .ad
6671 7217  .RS 15n
     7218 +If \fB-P\fR or \fB-o\fR profile is present, the shell is a profile shell
     7219 +(see \fBpfexec\fR(1)).
     7220 +.RE
     7221 +
     7222 +.sp
     7223 +.ne 2
     7224 +.na
     7225 +\fB-R\fR \fIfilename\fR
     7226 +.ad
     7227 +.RS 15n
6672 7228  The \fB-R\fR \fIfilename\fR option is used to generate a cross reference
6673 7229  database that can be used by a separate utility to find definitions and
6674 7230  references for variables and commands.
6675 7231  .RE
6676 7232  
6677 7233  .sp
6678 7234  .ne 2
6679 7235  .na
6680      -\fB\fB-r\fR\fR
     7236 +\fB-r\fR
6681 7237  .ad
6682 7238  .RS 15n
6683 7239  If the \fB-r\fR option is present, the shell is a restricted shell.
6684 7240  .RE
6685 7241  
6686 7242  .sp
6687 7243  .ne 2
6688 7244  .na
6689      -\fB\fB-s\fR\fR
     7245 +\fB-s\fR
6690 7246  .ad
6691 7247  .RS 15n
6692 7248  If the \fB-s\fR option is present or if no arguments remain, then commands are
6693 7249  read from the standard input. Shell output, except for the output of the
6694 7250  \fBSpecial Commands\fR listed, is written to file descriptor 2.
6695 7251  .RE
6696 7252  
6697 7253  .sp
6698 7254  .LP
6699 7255  The remaining options and arguments are described under the \fBset\fR command.
6700 7256  An optional \fB-\fR as the first argument is ignored.
6701 7257  .SS "\fBrksh93\fR Only"
6702      -.LP
6703 7258  \fBrksh93\fR is used to set up login names and execution environments whose
6704 7259  capabilities are more controlled than those of the standard shell.
6705 7260  .sp
6706 7261  .LP
6707 7262  The actions of \fBrksh93\fR are identical to those of \fBksh93\fR, except that
6708 7263  the following are disallowed:
6709 7264  .RS +4
6710 7265  .TP
6711 7266  .ie t \(bu
6712 7267  .el o
↓ open down ↓ 46 lines elided ↑ open up ↑
6759 7314  invokes \fBksh93\fR to execute it. Thus, it is possible to provide to the
6760 7315  end-user shell procedures that have access to the full power of the standard
6761 7316  shell, while imposing a limited menu of commands. This scheme assumes that the
6762 7317  end-user does not have write and execute permissions in the same directory. The
6763 7318  net effect of these rules is that the writer of the .\fBprofile\fR has complete
6764 7319  control over user actions, by performing guaranteed setup actions and leaving
6765 7320  the user in an appropriate directory (probably not the login directory). The
6766 7321  system administrator often sets up a directory of commands, for example,
6767 7322  \fB/usr/rbin\fR, that can be safely invoked by \fBrksh\fR.
6768 7323  .SH USAGE
6769      -.LP
6770 7324  See \fBlargefile\fR(5) for the description of the behavior of \fBksh93\fR and
6771 7325  \fBrksh93\fR when encountering files greater than or equal to 2 Gbyte ( 2^31
6772 7326  bytes).
6773 7327  .SH EXIT STATUS
6774      -.LP
6775 7328  The following exit values are returned:
6776 7329  .sp
6777 7330  .ne 2
6778 7331  .na
6779      -\fB\fBnon-zero\fR\fR
     7332 +\fBnon-zero\fR
6780 7333  .ad
6781 7334  .sp .6
6782 7335  .RS 4n
6783 7336  Returns \fBnon-zero\fR when errors, such as syntax errors, are detected by the
6784 7337  shell.
6785 7338  .sp
6786 7339  If the shell is being used non-interactively, then execution of the shell file
6787 7340  is abandoned unless the error occurs inside a sub-shell in which case the
6788 7341  sub-shell is abandoned.
6789 7342  .RE
6790 7343  
6791 7344  .sp
6792 7345  .ne 2
6793 7346  .na
6794      -\fB\fIexit status of last command executed\fR\fR
     7347 +\fB\fIexit status of last command executed\fR
6795 7348  .ad
6796 7349  .sp .6
6797 7350  .RS 4n
6798 7351  Returns the exit status of the last command executed.
6799 7352  .sp
6800 7353  Run time errors detected by the shell are reported by printing the command or
6801 7354  function name and the error condition. If the line number that the error
6802 7355  occurred on is greater than one, then the line number is also printed in square
6803 7356  brackets (\fB[]\fR) after the command or function name.
6804 7357  .sp
6805 7358  See the \fBksh93 exit\fR command for additional details.
6806 7359  .RE
6807 7360  
6808 7361  .SH FILES
6809 7362  .ne 2
6810 7363  .na
6811      -\fB\fB/etc/profile\fR\fR
     7364 +\fB/etc/profile\fR
6812 7365  .ad
6813 7366  .sp .6
6814 7367  .RS 4n
6815 7368  The system initialization file, executed for login shells.
6816 7369  .RE
6817 7370  
6818 7371  .sp
6819 7372  .ne 2
6820 7373  .na
6821      -\fB\fB/etc/ksh.kshrc\fR\fR
     7374 +\fB/etc/ksh.kshrc\fR
6822 7375  .ad
6823 7376  .sp .6
6824 7377  .RS 4n
6825 7378  The system wide startup file, executed for interactive shells.
6826 7379  .RE
6827 7380  
6828 7381  .sp
6829 7382  .ne 2
6830 7383  .na
6831      -\fB\fB$HOME/.profile\fR\fR
     7384 +\fB$HOME/.profile\fR
6832 7385  .ad
6833 7386  .sp .6
6834 7387  .RS 4n
6835 7388  The personal initialization file, executed for login shells after
6836 7389  \fB/etc/profile\fR.
6837 7390  .RE
6838 7391  
6839 7392  .sp
6840 7393  .ne 2
6841 7394  .na
6842      -\fB\fB$HOME/.kshrc\fR\fR
     7395 +\fB$HOME/.kshrc\fR
6843 7396  .ad
6844 7397  .sp .6
6845 7398  .RS 4n
6846 7399  Default personal initialization file, executed after \fB/etc/ksh.kshrc\fR, for
6847 7400  interactive shells when \fBENV\fR is not set.
6848 7401  .RE
6849 7402  
6850 7403  .sp
6851 7404  .ne 2
6852 7405  .na
6853      -\fB\fB/etc/suid-profile\fR\fR
     7406 +\fB/etc/suid-profile\fR
6854 7407  .ad
6855 7408  .sp .6
6856 7409  .RS 4n
6857 7410  Alternative initialization file, executed instead of the personal
6858 7411  initialization file when the real and effective user or group id do not match.
6859 7412  .RE
6860 7413  
6861 7414  .sp
6862 7415  .ne 2
6863 7416  .na
6864      -\fB\fB/dev/null\fR\fR
     7417 +\fB/dev/null\fR
6865 7418  .ad
6866 7419  .sp .6
6867 7420  .RS 4n
6868 7421  NULL device.
6869 7422  .RE
6870 7423  
6871 7424  .SH AUTHORS
6872      -.LP
6873 7425  David Korn, \fBdgk@research.att.com\fR
6874 7426  .SH ATTRIBUTES
6875      -.LP
6876 7427  See \fBattributes\fR(5) for descriptions of the following attributes:
6877 7428  .sp
6878 7429  
6879 7430  .sp
6880 7431  .TS
6881 7432  box;
6882 7433  c | c
6883 7434  l | l .
6884 7435  ATTRIBUTE TYPE  ATTRIBUTE VALUE
6885 7436  _
6886 7437  Interface Stability     See below.
6887 7438  .TE
6888 7439  
6889 7440  .sp
6890 7441  .LP
6891 7442  The scripting interface is Uncommitted. The environment variables,
6892 7443  \fB\&.paths\fR feature, and editing modes are Volatile.
6893 7444  .SH SEE ALSO
6894      -.LP
6895 7445  \fBcat\fR(1), \fBcd\fR(1), \fBchmod\fR(1), \fBcut\fR(1), \fBdate\fR(1),
6896 7446  \fBegrep\fR(1), \fBecho\fR(1), \fBegrep\fR(1), \fBenv\fR(1), \fBfgrep\fR(1),
6897      -\fBgrep\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpaste\fR(1),
     7447 +\fBgrep\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpaste\fR(1), \fBpfexec\fR(1),
6898 7448  \fBprintf\fR(1), \fBstty\fR(1), \fBtest\fR(1), \fBumask\fR(1), \fBvi\fR(1),
6899 7449  \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBioctl\fR(2), \fBlseek\fR(2),
6900 7450  \fBpathconf\fR(2), \fBpipe\fR(2), \fBsysconf\fR(3C), \fBulimit\fR(2),
6901 7451  \fBumask\fR(2), \fBrand\fR(3C), \fBtcgetattr\fR(3C), \fBwait\fR(3C),
6902 7452  \fBa.out\fR(4), \fBprofile\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
6903 7453  \fBlargefile\fR(5), \fBstandards\fR(5)
6904 7454  .sp
6905 7455  .LP
6906 7456  Bolsky, Morris I. and Korn, David G., \fIThe New KornShell Command and
6907 7457  Programming Language\fR, Prentice Hall, 1995.
6908 7458  .sp
6909 7459  .LP
6910 7460  \fIPOSIX-Part 2: Shell and Utilities, IEEE Std 1003.2-1992, ISO/IEC 9945-2\fR,
6911 7461  IEEE, 1993.
6912 7462  .SH NOTES
6913      -.LP
6914 7463  \fBksh93\fR scripts should choose shell function names outside the namespace
6915 7464  used by reserved keywords of the ISO C99, C++ and JAVA languages to avoid
6916 7465  collisions with future enhancements to \fBksh93\fR.
6917 7466  .sp
6918 7467  .LP
6919 7468  If a command is executed, and then a command with the same name is installed in
6920 7469  a directory in the search path before the directory where the original command
6921 7470  was found, the shell continues to \fBexec\fR the original command. Use the
6922 7471  \fB-t\fR option of the alias command to correct this situation.
6923 7472  .sp
↓ open down ↓ 29 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX