{
    "mode": "info",
    "parameter": "ksh",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/ksh/json",
    "generated": "2026-08-05T07:43:46Z",
    "synopsis": "ksh [ +-abcefhiklmnprstuvxBCDEGH ] [ +-o option ] ... [ - ] [ arg ... ]\nrksh [ +-abcefhiklmnpstuvxBCDEGH ] [ +-o option ] ... [ - ] [ arg ... ]",
    "sections": {
        "NAME": {
            "content": "ksh,  rksh  -  KornShell, a standard/restricted command and programming\nlanguage\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ksh [ +-abcefhiklmnprstuvxBCDEGH ] [ +-o option ] ... [ - ] [ arg ... ]\nrksh [ +-abcefhiklmnpstuvxBCDEGH ] [ +-o option ] ... [ - ] [ arg ... ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Ksh is a command and programming language that executes  commands  read\nfrom a terminal or a file.  Rksh is a restricted version of the command\ninterpreter ksh; it is used to set up login names and  execution  envi-\nronments whose capabilities are more controlled than those of the stan-\ndard shell.  See Invocation below for the meaning of arguments  to  the\nshell.\n\nDefinitions.\nA metacharacter is one of the following characters:\n\n;   &   (   )   |   <   >   new-line   space   tab\n\nA  blank  is a tab or a space.  An identifier is a sequence of letters,\ndigits, or underscores starting with a letter or  underscore.   Identi-\nfiers  are used as components of variable names.  A vname is a sequence\nof one or more identifiers separated by a . and optionally preceded  by\na  ..  Vnames are used as function and variable names.  A word is a se-\nquence of characters from the character set defined by the current  lo-\ncale, excluding non-quoted metacharacters.\n\nA  command  is a sequence of characters in the syntax of the shell lan-\nguage.  The shell reads each command and carries out the desired action\neither  directly or by invoking separate utilities.  A built-in command\nis a command that is carried out by the shell itself without creating a\nseparate  process.   Some  commands are built-in purely for convenience\nand are not documented here.  Built-ins that cause side effects in  the\nshell environment and built-ins that are found before performing a path\nsearch (see Execution below) are documented here.  For historical  rea-\nsons,  some  of these built-ins behave differently than other built-ins\nand are called special built-ins.\n\nCommands.\nA simple-command is a list of variable assignments  (see  Variable  As-\nsignments  below)  or  a sequence of blank separated words which may be\npreceded by a list of variable  assignments  (see  Environment  below).\nThe  first  word specifies the name of the command to be executed.  Ex-\ncept as specified below, the remaining words are passed as arguments to\nthe  invoked  command.   The  command name is passed as argument 0 (see\nexec(2)).  The value of a simple-command is its exit status;  0-255  if\nit  terminates  normally;  256+signum  if it terminates abnormally (the\nname of the signal corresponding to the exit status can be obtained via\nthe -l option of the kill built-in utility).\n\nA  pipeline  is a sequence of one or more commands separated by |.  The\nstandard output of each command but the last is connected by a  pipe(2)\nto the standard input of the next command.  Each command, except possi-\nbly the last, is run as a separate process; the  shell  waits  for  the\nlast  command  to terminate.  The exit status of a pipeline is the exit\nstatus of the last command unless the pipefail option is enabled.  Each\npipeline  can be preceded by the reserved word !  which causes the exit\nstatus of the pipeline to become 0 if the exit status of the last  com-\nmand is non-zero, and 1 if the exit status of the last command is 0.\n\nA  list  is  a sequence of one or more pipelines separated by ;, &, |&,\n&&, or ||, and optionally terminated by ;, &, or  |&.   Of  these  five\nsymbols,  ;,  &, and |& have equal precedence, which is lower than that\nof && and ||.  The symbols && and || also  have  equal  precedence.   A\nsemicolon (;) causes sequential execution of the preceding pipeline; an\nampersand (&) causes asynchronous execution of the  preceding  pipeline\n(i.e.,  the shell does not wait for that pipeline to finish).  The sym-\nbol |& causes asynchronous execution of the preceding pipeline  with  a\ntwo-way  pipe  established  to the parent shell; the standard input and\noutput of the spawned pipeline can be written to and read from  by  the\nparent shell by applying the redirection operators <& and >& with arg p\nto commands and by using -p option of the built-in  commands  read  and\nprint described later.  The symbol && (||) causes the list following it\nto be executed only if the preceding pipeline returns a zero (non-zero)\nvalue.   One  or more new-lines may appear in a list instead of a semi-\ncolon, to delimit a command.  The first item  of the first pipeline  of\na  list  that is a simple command not beginning with a redirection, and\nnot occurring within a while, until, or if list, can be preceded  by  a\nsemicolon.   This  semicolon is ignored unless the showme option is en-\nabled as described with the set built-in below.\n\nA command is either a simple-command or one of the  following.   Unless\notherwise  stated,  the value returned by a command is that of the last\nsimple-command executed in the command.\n\nfor vname [ in word ... ] ;do list ;done\nEach time a for command is executed, vname is set  to  the  next\nword  taken  from the in word list.  If in word ...  is omitted,\nthen the for command executes the do list once  for  each  posi-\ntional  parameter that is set starting from 1 (see Parameter Ex-\npansion below).  Execution ends when there are no more words  in\nthe list.\n\nfor (( [expr1] ; [expr2] ; [expr3] )) ;do list ;done\nThe  arithmetic  expression expr1 is evaluated first (see Arith-\nmetic Evaluation below).  The arithmetic expression expr2 is re-\npeatedly evaluated until it evaluates to zero and when non-zero,\nlist is executed and the arithmetic expression expr3  evaluated.\nIf any expression is omitted, then it behaves as if it evaluated\nto 1.\n\nselect vname [ in word ... ] ;do list ;done\nA select command prints on standard error  (file  descriptor  2)\nthe set of words, each preceded by a number.  If in word ...  is\nomitted, then the positional parameters starting from 1 are used\ninstead  (see  Parameter  Expansion  below).   The PS3 prompt is\nprinted and a line is read from the  standard  input.   If  this\nline consists of the number of one of the listed words, then the\nvalue of the variable vname is set to the word corresponding  to\nthis  number.   If  this  line  is  empty, the selection list is\nprinted again.  Otherwise the value of the variable vname is set\nto  null.   The contents of the line read from standard input is\nsaved in the variable REPLY.  The list is executed for each  se-\nlection until a break or end-of-file is encountered.  If the RE-\nPLY variable is set to null by the execution of list,  then  the\nselection  list  is printed before displaying the PS3 prompt for\nthe next selection.\n\ncase word in [ [(]pattern [ | pattern ] ... ) list ;; ] ... esac\nA case command executes the list associated with the first  pat-\ntern that matches word.  The form of the patterns is the same as\nthat used for pathname expansion (see Pathname Expansion below).\nThe ;; operator causes execution of case to terminate.  If ;& is\nused in place of ;; the next subsequent list, if any,   is  exe-\ncuted.\n\nif list ;then list [ ;elif list ;then list ] ... [ ;else list ] ;fi\nThe list following if is executed and, if it returns a zero exit\nstatus, the list following the first then is  executed.   Other-\nwise,  the  list following elif is executed and, if its value is\nzero, the list following the next  then  is  executed.   Failing\neach successive elif list, the else list is executed.  If the if\nlist has non-zero exit status and there is no  else  list,  then\nthe if command returns a zero exit status.\n\nwhile list ;do list ;done\nuntil list ;do list ;done\nA  while  command repeatedly executes the while list and, if the\nexit status of the last command in the list  is  zero,  executes\nthe  do  list; otherwise the loop terminates.  If no commands in\nthe do list are executed, then the while command returns a  zero\nexit  status;  until may be used in place of while to negate the\nloop termination test.\n\n((expression))\nThe expression is evaluated using the rules for arithmetic eval-\nuation  described below.  If the value of the arithmetic expres-\nsion is non-zero, the exit status is 0, otherwise the exit  sta-\ntus is 1.\n\n(list)\nExecute list in a separate environment.  Note, that if two adja-\ncent open parentheses are needed for nesting, a  space  must  be\ninserted  to  avoid  evaluation  as an arithmetic command as de-\nscribed above.\n\n{ list;}\nlist is simply executed.  Note that unlike the metacharacters  (\nand  ),  { and } are reserved words and must occur at the begin-\nning of a line or after a ; in order to be recognized.\n\n[[ expression ]]\nEvaluates expression and returns a zero exit status when expres-\nsion is true.  See Conditional Expressions below, for a descrip-\ntion of expression.\n\nfunction varname { list ;}\nvarname () { list ;}\nDefine a function which is referenced by  varname.   A  function\nwhose  varname contains a .  is called a discipline function and\nthe portion of the varname preceding the last .  must  refer  to\nan  existing  variable.  The body of the function is the list of\ncommands between { and }.  A function defined with the  function\nvarname syntax can also be used as an argument to the .  special\nbuilt-in command to get the equivalent behavior as if  the  var-\nname() syntax were used to define it.  (See Functions below.)\n\nnamespace identifier { list ;}\nDefines  or uses the name space identifier and runs the commands\nin list in this name space.  (See Name Spaces below.)\n\n& [ name [ arg... ]  ]\nCauses subsequent list commands terminated by & to be placed  in\nthe  background job pool name.  If name is omitted a default un-\nnamed pool is used.  Commands in a named background pool may  be\nexecuted remotely.\n\ntime [ pipeline ]\nIf  pipeline is omitted the user and system time for the current\nshell and completed child processes is printed on  standard  er-\nror.   Otherwise,  pipeline  is executed and the elapsed time as\nwell as the user and system time are printed on standard  error.\nThe TIMEFORMAT variable may be set to a format string that spec-\nifies how the timing information should be displayed.  See Shell\nVariables below for a description of the TIMEFORMAT variable.\n\nThe  following reserved words are recognized as reserved only when they\nare the first word of a command and are not quoted:\n\nif then else elif fi case esac for while until do done { } function se-\nlect time [[ ]] !\n\nVariable Assignments.\nOne  or  more variable assignments can start a simple command or can be\narguments to the typeset, enum, export, or  readonly  special  built-in\ncommands  as  well  as  to other declaration commands created as types.\nThe syntax for an assignment is of the form:\n\nvarname=word\nvarname[word]=word\nNo space is permitted between varname and the = or between = and\nword.\n\nvarname=(assignlist)\nNo  space  is permitted between varname and the =.  The variable\nvarname is unset before the assignment.  An assignlist  can  be\none of the following:\nword ...\nIndexed array assignment.\n[word]=word ...\nAssociative  array  assignment.   If  preceded by\ntypeset -a this will create an indexed array  in-\nstead.\nassignment ...\nCompound  variable  assignment.   This  creates a\ncompound variable varname  with  subvariables  of\nthe  form  varname.name,  where  name is the name\nportion of assignment.  The value of varname will\ncontain  all the assignment elements.  Additional\nassignments made to subvariables of varname  will\nalso  be  displayed  as part of the value of var-\nname.  If no assignments are  specified,  varname\nwill  be a compound variable allowing subsequence\nchild elements to be defined.\ntypeset [options] assignment ...\nNested variable assignment.  Multiple assignments\ncan  be specified by separating each of them with\na ;.  The previous value is unset before the  as-\nsignment.   Other  declaration  commands  such as\nreadonly, enum, and  other  declaration  commands\ncan be used in place of typeset.\n. filename\nInclude  the  assignment  commands  contained  in\nfilename.\n\nIn addition, a += can be used in place of the = to signify adding to or\nappending  to  the previous value.  When += is applied to an arithmetic\ntype, word is evaluated as an arithmetic expression and  added  to  the\ncurrent value.  When applied to a string variable, the value defined by\nword is appended to the value.  For compound assignments, the  previous\nvalue  is not unset and the new values are appended to the current ones\nprovided that the types are compatible.\n\nThe right hand side of a variable assignment undergoes all  the  expan-\nsion  listed below except word splitting, brace expansion, and pathname\nexpansion.  When the left hand side is  an  assignment  is  a  compound\nvariable  and  the  right  hand is the name of a compound variable, the\ncompound variable on the right will be copied or appended to  the  com-\npound variable on the left.\n\nComments.\nA  word beginning with # causes that word and all the following charac-\nters up to a new-line to be ignored.\n\nAliasing.\nThe first word of each command is replaced by the text of an  alias  if\nan alias for this word has been defined.  An alias name consists of any\nnumber of characters excluding metacharacters, quoting characters, file\nexpansion  characters,  parameter  expansion  and  command substitution\ncharacters, the characters / and =.  The replacement string can contain\nany  valid shell script including the metacharacters listed above.  The\nfirst word of each command in the replaced text, other  than  any  that\nare  in  the process of being replaced, will be tested for aliases.  If\nthe last character of the alias value is a blank then the word  follow-\ning the alias will also be checked for alias substitution.  Aliases can\nbe used to redefine built-in commands but cannot be  used  to  redefine\nthe  reserved  words  listed  above.  Aliases can be created and listed\nwith the alias command and can be removed with the unalias command.\n\nAliasing is performed when scripts are read, not while  they  are  exe-\ncuted.   Therefore,  for  an alias to take effect, the alias definition\ncommand has to be executed before  the  command  which  references  the\nalias is read.\n\nThe  following  aliases  are automatically preset when the shell is in-\nvoked as an interactive shell, unless invoked in POSIX compliance  mode\n(see Invocation below).  Preset aliases can be unset or redefined.\nhistory='hist -l'\nr='hist -s'\n\nTilde Expansion.\nAfter  alias  substitution is performed, each word is checked to see if\nit begins with an unquoted ~.  For tilde expansion, word also refers to\nthe  word  portion  of parameter expansion (see Parameter Expansion be-\nlow).  If a word is preceded by a tilde, then it is checked up to  a  /\nto  see  if it matches a user name in the password database (see getpw-\nname(3)).  If a match is found, the ~ and the matched  login  name  are\nreplaced  by  the  login directory of the matched user.  If no match is\nfound, the original text is left unchanged.  A ~ by itself, or in front\nof  a  /,  is  replaced by $HOME, unless the HOME variable is unset, in\nwhich case the current user's home directory as configured in the oper-\nating  system is used.  A ~ followed by a + or - is replaced by $PWD or\n$OLDPWD respectively.\n\nIn addition, when expanding a variable assignment (see Variable Assign-\nments  above),  tilde  expansion is attempted when the value of the as-\nsignment begins with a ~, and when a ~ appears after a  :.   A  :  also\nterminates a user name following a ~.\n\nThe  tilde  expansion mechanism may be extended or modified by defining\none of the discipline functions  .sh.tilde.set  or  .sh.tilde.get  (see\nFunctions and Discipline Functions below).  If either exists, then upon\nencountering a tilde word to expand, that function is called  with  the\ntilde  word  assigned  to either .sh.value (for the .sh.tilde.set func-\ntion) or .sh.tilde (for the .sh.tilde.get function).  Performing  tilde\nexpansion  within  a discipline function will not recursively call that\nfunction, but default tilde expansion remains active, so literal tildes\nshould  still  be  quoted where required.  Either function may assign a\nreplacement string to .sh.value.  If this value is non-empty  and  does\nnot  start  with  a ~, it replaces the default tilde expansion when the\nfunction terminates.  Otherwise, the tilde expansion is left unchanged.\n\nCommand Substitution.\nThe standard output from a command list enclosed  in  parentheses  pre-\nceded  by  a dollar sign ( $(list) ), or in a brace group preceded by a\ndollar sign ( ${ list;} ), or in a pair of grave accents  (``)  may  be\nused  as part or all of a word; trailing new-lines are removed.  In the\nsecond case, the { and } are treated as a reserved words so that { must\nbe  followed  by a blank and } must appear at the beginning of the line\nor follow a ;.  In the third (obsolete) form, the  string  between  the\nquotes  is  processed for special quoting characters before the command\nis executed (see Quoting below).  The command substitution $(cat  file)\ncan  be  replaced  by  the equivalent but faster $(<file).  The command\nsubstitution $(n<#) will expand to the current byte offset for file de-\nscriptor  n.   Except for the second form, the command list is run in a\nsubshell so that no side effects are possible.  For  the  second  form,\nthe final } will be recognized as a reserved word after any token.\n\nArithmetic Expansion.\nAn  arithmetic  expression enclosed in double parentheses preceded by a\ndollar sign ( $(()) ) is replaced by the value of  the  arithmetic  ex-\npression within the double parentheses.\n\nProcess Substitution.\nEach  command  argument of the form <(list) or >(list) will run process\nlist asynchronously connected to some file in /dev/fd if this directory\nexists,  or  else  a fifo a temporary directory.  The name of this file\nwill become the argument to the command.  If the form  with  >  is  se-\nlected  then writing on this file will provide input for list.  If < is\nused, then the file passed as an argument will contain  the  output  of\nthe list process.  For example,\n\npaste  <(cut  -f1  file1)  <(cut  -f3  file2)  | tee >(process1)\n>(process2)\n\ncuts fields 1 and 3 from the files file1 and file2 respectively, pastes\nthe  results  together,  and  sends  it  to  the processes process1 and\nprocess2, as well as putting it onto the standard  output.   Note  that\nthe  file,  which  is  passed  as an argument to the command, is a UNIX\npipe(2) so programs that expect to lseek(2) on the file will not work.\n\nProcess substitution of the form <(list) can also be used  with  the  <\nredirection operator which causes the output of list to be standard in-\nput or the input for whatever file descriptor is specified.\n\nParameter Expansion.\nA parameter is a variable, one or more digits, or any of the characters\n*,  @, #, ?, -, $, and !.  A variable is denoted by a vname.  To create\na variable whose vname contains a ., a variable whose vname consists of\neverything  before  the  last  .  must already exist.  A variable has a\nvalue and zero or more attributes.  Variables can  be  assigned  values\nand  attributes by using the typeset special built-in command.  The at-\ntributes supported by the shell are described later  with  the  typeset\nspecial  built-in command.  Exported variables pass their attributes to\nthe environment so that a newly invoked ksh that is a child  or  exec'd\nprocess of the current shell will automatically import them, unless the\nposix shell option is on.\n\nThe shell supports both indexed and associative arrays.  An element  of\nan array variable is referenced by a subscript.  A subscript for an in-\ndexed array is denoted by  an  arithmetic  expression  (see  Arithmetic\nEvaluation  below) between a [ and a ].  To assign values to an indexed\narray, use vname=(value ...) or set -A vname  value ... .  The value of\nall  non-negative  subscripts  must  be  in  the  range  of  0  through\n4,194,303.  A negative subscript is treated as an offset from the maxi-\nmum  current  index  +1 so that -1 refers to the last element.  Indexed\narrays can be declared with the -a option to typeset.   Indexed  arrays\nneed  not  be  declared.  Any reference to a variable with a valid sub-\nscript is legal and an array will be created if necessary.\n\nAn associative array is created with the -A option to typeset.  A  sub-\nscript for an associative array is denoted by a string enclosed between\n[ and ].\n\nReferencing any array without a subscript is equivalent to  referencing\nthe array with subscript 0.\n\nThe value of a variable may be assigned by writing:\n\nvname=value [ vname=value ] ...\n\nor\nvname[subscript]=value [ vname[subscript]=value ] ...\nNote that no space is allowed before or after the =.\nAttributes  assigned  by  the typeset special built-in command apply to\nall elements of the array.  An array element can be a simple  variable,\na compound variable or an array variable.  An element of an indexed ar-\nray can be either an indexed array or an associative array.  An element\nof  an associative array can also be either.  To refer to an array ele-\nment that is part of an array element,  concatenate  the  subscript  in\nbrackets.   For  example, to refer to the foobar element of an associa-\ntive array that is defined as the third element of the  indexed  array,\nuse ${vname[3][foobar]}\nA  nameref  is  a  variable that is a reference to another variable.  A\nnameref is created with the -n attribute of typeset.  The value of  the\nvariable  at  the time of the typeset command becomes the variable that\nwill be referenced whenever the nameref variable is used.  The name  of\na  nameref  cannot  contain a ..  When a variable or function name con-\ntains a ., and the portion of the name up to the first  .  matches  the\nname  of  a  nameref, the variable referred to is obtained by replacing\nthe nameref portion with the name of the  variable  referenced  by  the\nnameref.   If a nameref is used as the index of a for loop, a name ref-\nerence is established for each item in the list.  A nameref provides  a\nconvenient way to refer to the variable inside a function whose name is\npassed as an argument to a function.  For example, if  the  name  of  a\nvariable is passed as the first argument to a function, the command\ntypeset -n var=$1\ninside the function causes references and assignments to var to be ref-\nerences and assignments to the variable whose name has been  passed  to\nthe function.\nIf  any of the floating point attributes, -E, -F, or -X, or the integer\nattribute, -i, is set for vname, then the value is  subject  to  arith-\nmetic evaluation as described below.\nPositional  parameters, parameters denoted by a number, may be assigned\nvalues with the set special built-in command.  Parameter $0 is set from\nargument zero when the shell is invoked.\nThe character $ is used to introduce substitutable parameters.\n${parameter}\nThe  shell reads all the characters from ${ to the matching } as\npart of the same word even if it contains braces or  metacharac-\nters.   The value, if any, of the parameter is substituted.  The\nbraces are required when parameter  is  followed  by  a  letter,\ndigit,  or  underscore  that is not to be interpreted as part of\nits name, when the variable name contains a ..  The  braces  are\nalso  required  when a variable is subscripted unless it is part\nof an Arithmetic Expression or a Conditional Expression.  If pa-\nrameter is one or more digits then it is a positional parameter.\nA positional parameter of more than one digit must  be  enclosed\nin  braces.  If parameter is * or @, then all the positional pa-\nrameters, starting with $1,  are  substituted  (separated  by  a\nfield  separator  character).   If an array vname with last sub-\nscript * @, or for indexed arrays of the form sub1 ..  sub2.  is\nused,  then  the value for each of the elements between sub1 and\nsub2 inclusive (or all elements for *  and  @)  is  substituted,\nseparated by the first character of the value of IFS.\n${#parameter}\nIf  parameter  is * or @, the number of positional parameters is\nsubstituted.  Otherwise, the length of the value of the  parame-\nter is substituted.\n${#vname[*]}\n${#vname[@]}\nThe number of elements in the array vname is substituted.\n\n${@vname}\nExpands  to  the  type  name  (See Type Variables  below) or at-\ntributes of the variable referred to by vname.\n${!vname}\nExpands to the name of the variable referred to by vname.   This\nwill be vname except when vname is a name reference.\n${!vname[subscript]}\nExpands  to  name of the subscript unless subscript is *, @.  or\nof the form sub1 ..  sub2.  When subscript is *, the list of ar-\nray  subscripts  for vname is generated.  For a variable that is\nnot an array, the value is 0 if the variable is set.   Otherwise\nit  is  null.   When  subscript is @, same as above, except that\nwhen used in double quotes, each array subscript yields a  sepa-\nrate  argument.   When subscript is of the form sub1 ..  sub2 it\nexpands to the list of subscripts between sub1 and  sub2  inclu-\nsive using the same quoting rules as @.\n${!prefix@}\n${!prefix*}\nThese  both expand to the names of the variables whose names be-\ngin with prefix.  The expansions otherwise work like $@ and  $*,\nrespectively (see under Quoting below).\n${parameter:-word}\nIf  parameter  is set and is non-null then substitute its value;\notherwise substitute word.\n${parameter:=word}\nIf parameter is not set or is null then  set  it  to  word;  the\nvalue  of the parameter is then substituted.  Positional parame-\nters may not be assigned to in this way.\n${parameter:?word}\nIf parameter is set and is non-null then substitute  its  value;\notherwise,  print  word and exit from the shell (if not interac-\ntive).  If word is omitted then a standard message is printed.\n${parameter:+word}\nIf parameter is set and is non-null then substitute word; other-\nwise substitute nothing.\nIn the above, word is not evaluated unless it is to be used as the sub-\nstituted string, so that, in the following  example,  pwd  is  executed\nonly if d is not set or is null:\nprint ${d:-$(pwd)}\nIf  the  colon  (  :  ) is omitted from the above expressions, then the\nshell only checks whether parameter is set or not.\n${parameter:offset:length}\n${parameter:offset}\nExpands to the portion of the value of parameter starting at the\ncharacter (counting from 0) determined by expanding offset as an\narithmetic expression and consisting of the number of characters\ndetermined  by  the arithmetic expression defined by length.  In\nthe second form, the remainder of the value is used.  If A nega-\ntive  offset  counts  backwards from the end of parameter.  Note\nthat one or more blanks is required in front of a minus sign  to\nprevent  the shell from interpreting the operator as :-.  If pa-\nrameter is * or @, or is an array name indexed by * or  @,  then\noffset  and  length  refer to the array index and number of ele-\nments respectively.  A negative offset is taken relative to  one\ngreater  than the highest subscript for indexed arrays.  The or-\nder for associative arrays is unspecified.\n${parameter#pattern}\n${parameter##pattern}\nIf the shell pattern matches the beginning of the value  of  pa-\nrameter,  then  the  value of this expansion is the value of the\nparameter with the matched portion deleted; otherwise the  value\nof  this parameter is substituted.  In the first form the small-\nest matching pattern is deleted  and  in  the  second  form  the\nlargest matching pattern is deleted.  When parameter is @, *, or\nan array variable with subscript @ or *, the substring operation\nis applied to each element in turn.\n\n${parameter%pattern}\n${parameter%%pattern}\nIf  the shell pattern matches the end of the value of parameter,\nthen the value of this expansion is the value of  the  parameter\nwith the matched part deleted; otherwise substitute the value of\nparameter.  In the first form the smallest matching  pattern  is\ndeleted  and  in the second form the largest matching pattern is\ndeleted.  When parameter is @, *, or an array variable with sub-\nscript  @  or *, the substring operation is applied to each ele-\nment in turn.\n\n${parameter/pattern/string}\n${parameter//pattern/string}\n${parameter/#pattern/string}\n${parameter/%pattern/string}\nExpands parameter and replaces the longest match of pattern with\nthe  given  string.  Each occurrence of \\n in string is replaced\nby the portion of parameter that matches  the  n-th  subpattern.\nIn  the  first form, only the first occurrence of pattern is re-\nplaced.  In the second form, each match for pattern is  replaced\nby the given string.  The third form restricts the pattern match\nto the beginning of the string while the fourth  form  restricts\nthe  pattern  match  to  the  end of the string.  When string is\nnull, the pattern will be deleted and the / in front  of  string\nmay  be  omitted.   When parameter is @, *, or an array variable\nwith subscript @ or *, the substitution operation is applied  to\neach  element in turn.  In this case, the string portion of word\nwill be re-evaluated for each element.\n\nShell Variables.\nThe following parameters are automatically set by the shell:\n#      The number of positional parameters in decimal.\n-      Options supplied to the shell on invocation or by the set\ncommand.\n?      The  exit  status  returned by the last executed command.\nIts meaning depends on the command or function  that  de-\nfines  it,  but there are conventions that other commands\noften  depend  on:  zero  typically  means  'success'  or\n'true', one typically means 'non-success' or 'false', and\na value greater than one typically indicates some kind of\nerror.  Only the 8 least significant bits of $? (values 0\nto 255) are preserved when the exit status is  passed  on\nto a parent process, but within the same (sub)shell envi-\nronment, it is a signed integer value  with  a  range  of\npossible  values as shown by the commands getconf INTMIN\nand getconf INTMAX. Shell functions that run in the cur-\nrent environment may return status values in this range.\n$      The  process ID of the main shell process. Note that this\nvalue will not change in a subshell, even if the subshell\nruns in a different process.  See also .sh.pid.\nInitially,  the value of  is an absolute pathname of the\nshell or script being executed as passed in the  environ-\nment.   Subsequently  it is assigned the last argument of\nthe previous command.  This parameter is not set for com-\nmands  which  are  asynchronous.   This parameter is also\nused to hold the name of  the  matching  MAIL  file  when\nchecking for mail.  While defining a compound variable or\na type,  is initialized as a reference to  the  compound\nvariable or type.  When a discipline function is invoked,\nis initialized as a reference to the  variable  associ-\nated  with  the call to this function.  Finally when  is\nused as the name of the first variable of a type  defini-\ntion,  the new type is derived from the type of the first\nvariable. (See Type Variables  below.)\n!      The process id or the pool name and  job  number  of  the\nlast  background  command  invoked or the most recent job\nput in the  background  with  the  bg  built-in  command.\nBackground  jobs  started  in a named pool will be in the\nform pool.number where pool is the pool name  and  number\nis the job number within that pool.\n.sh.command\nWhen  processing a DEBUG trap, this variable contains the\ncurrent command line that is about to run.  The value  is\nin  the same format as the output generated by the xtrace\noption (minus the preceding PS4 prompt).\n.sh.edchar\nThis variable contains the value of the keyboard  charac-\nter  (or sequence of characters if the first character is\nan ESC, ASCII 033) that has been entered when  processing\na  KEYBD  trap (see Key Bindings below).  If the value is\nchanged as part of the trap action, then  the  new  value\nreplaces the key (or key sequence) that caused the trap.\n.sh.edcol\nThe  character  position of the cursor at the time of the\nmost recent KEYBD trap.\n.sh.edmode\nThe value is set to ESC  when  processing  a  KEYBD  trap\nwhile  in  vi insert mode.  (See Vi Editing Mode  below.)\nOtherwise, .sh.edmode is null  when  processing  a  KEYBD\ntrap.\n.sh.edtext\nThe  characters  in  the  input buffer at the time of the\nmost recent KEYBD trap.  The value is null when not  pro-\ncessing a KEYBD trap.\n.sh.file\nThe  pathname  of the file that contains the current com-\nmand.\n.sh.fun\nThe name of the current function that is being executed.\n.sh.level\nSet to the current function depth.  This can  be  changed\ninside a DEBUG trap and will set the context to the spec-\nified level.\n.sh.lineno\nSet during a DEBUG trap to the line number for the caller\nof each function.\n.sh.match\nAn  indexed  array which stores the most recent match and\nsubpattern matches after conditional pattern matches that\nmatch  and after variables expansions using the operators\n#, %, or /.  The 0-th element stores the  complete  match\nand  the  i-th.   element  stores the i-th submatch.  The\n.sh.match variable becomes unset when the  variable  that\nhas expanded is assigned a new value.\n.sh.math\nUsed  for  defining  arithmetic functions (see Arithmetic\nEvaluation below) and stores the  list  of  user  defined\narithmetic functions.\n.sh.name\nSet to the name of the variable at the time that a disci-\npline function is invoked.\n.sh.subscript\nSet to the name subscript of the  variable  at  the  time\nthat a discipline function is invoked.\n.sh.subshell\nThe current depth for subshells and command substitution.\n.sh.pid\nSet to the process ID of the current shell.  This is dis-\ntinct from $$ as in forked subshells this is set  to  the\nprocess  ID of the subshell instead of the parent shell's\nprocess ID.  In virtual  subshells  .sh.pid  retains  its\nprevious value.\n.sh.value\nSet to the value of the variable at the time that the set\nor append discipline function is invoked.   When  a  user\ndefined  arithmetic  function  is  invoked,  the value of\n.sh.value is saved and .sh.value is set  to  long  double\nprecision floating point.  .sh.value is restored when the\nfunction returns.\n.sh.version\nSet to a value that identifies the version of this shell.\nKSHVERSION\nA name reference to .sh.version.\nLINENO The current line number within the script or function be-\ning executed.\nOLDPWD The previous working directory set by the cd command.\nOPTARG The  value  of  the last option argument processed by the\ngetopts built-in command.\nOPTIND The index of the last option argument  processed  by  the\ngetopts built-in command.\nPPID   The process id of the parent of the shell.\nPWD    The present working directory set by the cd command.\nRANDOM Each  time this variable is referenced, a random integer,\nuniformly distributed between 0 and 32767, is  generated.\nThe  sequence of random numbers can be initialized by as-\nsigning a numeric value to RANDOM.\nREPLY  This variable is set by the select statement and  by  the\nread built-in command when no arguments are supplied.\nSECONDS\nEach time this variable is referenced, the number of sec-\nonds since shell invocation is returned.  If  this  vari-\nable  is  assigned  a value, then the value returned upon\nreference will be the value that was  assigned  plus  the\nnumber of seconds since the assignment.\nSHLVL  An integer variable that is incremented and exported each\ntime the shell is invoked.  If SHLVL is not in the  envi-\nronment when the shell is invoked, it is set to 1.\n\nThe following variables are used by the shell:\nCDPATH The search path for the cd command.\nCOLUMNS\nIf  this variable is set, the value is used to define the\nwidth of the edit window for the shell edit modes and for\nprinting select lists.\nEDITOR If  the  VISUAL  variable  is  not set, the value of this\nvariable will be checked for the  patterns  as  described\nwith  VISUAL  below  and the corresponding editing option\n(see Special Command set below) will be turned on.\nENV    If this variable is set, then parameter  expansion,  com-\nmand substitution, and arithmetic expansion are performed\non the value to generate the pathname of the script  that\nwill  be executed when the shell is invoked interactively\n(see Invocation below).  This file is typically used  for\nalias  and  function  definitions.   The default value is\n$HOME/.kshrc.  On systems  that  support  a  system  wide\n/etc/ksh.kshrc  initialization file, if the filename gen-\nerated by the expansion of ENV begins with  /./  or  ././\nthe system wide initialization file will not be executed.\nFCEDIT Obsolete  name  for  the default editor name for the hist\ncommand.  FCEDIT is not used when HISTEDIT is set.\nFIGNORE\nA pattern that defines the set of filenames that will  be\nignored when performing filename matching.\nFPATH  The  search  path for function definitions.  The directo-\nries in this path are searched for a file with  the  same\nname  as the function or command when a function with the\n-u attribute is referenced and  when  a  command  is  not\nfound.   If an executable file with the name of that com-\nmand is found, then it is read and executed in  the  cur-\nrent  environment.   Unlike  PATH,  the current directory\nmust be represented explicitly by .  rather than by adja-\ncent : characters or a beginning or ending :.\nHISTCMD\nNumber of the current command in the history file.\nHISTEDIT\nName for the default editor name for the hist command.\nHISTFILE\nIf  this  variable is set when the shell is invoked, then\nthe value is the pathname of the file that will  be  used\nto  store  the  command history (see Command Re-entry be-\nlow).\nHISTSIZE\nIf this variable is set when the shell is  invoked,  then\nthe number of previously entered commands that are acces-\nsible by this shell will be greater than or equal to this\nnumber.  The default is 512.\nHOME   The default argument (home directory) for the cd command.\nIFS    Internal  field separators, normally space, tab, and new-\nline that are used to separate  the  results  of  command\nsubstitution  or  parameter  expansion  and  to  separate\nfields with the built-in command read.  The first charac-\nter of the IFS variable is used to separate arguments for\nthe \"$*\" expansion (see Quoting below).  Each single  oc-\ncurrence  of  an IFS character in the string to be split,\nthat is not in the isspace character class, and any adja-\ncent  characters in IFS that are in the isspace character\nclass, delimit a field.  One or more  characters  in  IFS\nthat  belong  to  the  isspace character class, delimit a\nfield.  In addition, if the same  isspace  character  ap-\npears consecutively inside IFS, this character is treated\nas if it were not in the isspace class, so  that  if  IFS\nconsists  of  two  tab  characters, then two adjacent tab\ncharacters delimit a null field.\nJOBMAX This variable defines the maximum  number  running  back-\nground  jobs  that can run at a time.  When this limit is\nreached, the shell will wait for a job to complete before\nstarting a new job.\nLANG   This variable determines the locale category for any cat-\negory not specifically selected with a variable  starting\nwith LC or LANG.\nLCALL This  variable  overrides  the value of the LANG variable\nand any other LC variable.\nLCCOLLATE\nThis variable determines the locale category for  charac-\nter collation information.\nLCCTYPE\nThis  variable determines the locale category for charac-\nter handling  functions.   It  determines  the  character\nclasses  for pattern matching (see Pathname Expansion be-\nlow).\nLCNUMERIC\nThis variable determines the locale category for the dec-\nimal point character.\nLINES  If  this  variable is set, the value is used to determine\nthe column length  for  printing  select  lists.   Select\nlists  will  print  vertically  until about two-thirds of\nLINES lines are filled.\nMAIL   If this variable is set to the name of a  mail  file  and\nthe  MAILPATH variable is not set, then the shell informs\nthe user of arrival of mail in the specified file.\nMAILCHECK\nThis variable specifies how often (in seconds) the  shell\nwill check for changes in the modification time of any of\nthe files specified by the MAILPATH  or  MAIL  variables.\nThe  default  value  is  600  seconds.  When the time has\nelapsed the shell will  check  before  issuing  the  next\nprompt.\nMAILPATH\nA  colon  (  :  )  separated list of file names.  If this\nvariable is set, then the shell informs the user  of  any\nmodifications  to  the specified files that have occurred\nwithin the last MAILCHECK seconds.  Each file name can be\nfollowed by a ?  and a message that will be printed.  The\nmessage will undergo parameter expansion, command substi-\ntution, and arithmetic expansion with the variable $ de-\nfined as the name of the file that has changed.  The  de-\nfault message is you have mail in $.\nPATH   The  search path for commands (see Execution below).  The\nuser may not change PATH if executing under rksh  (except\nin .profile).\nPS1    Every  time  a new command line is started on an interac-\ntive shell, the value of this variable is expanded to re-\nsolve  backslash  escaping,  parameter expansion, command\nsubstitution, and arithmetic expansion.  The  result  de-\nfines  the  primary  prompt string for that command line.\nThe default is ``$ ''.  The character !  in  the  primary\nprompt string is replaced by the command number (see Com-\nmand Re-entry below).  Two successive  occurrences  of  !\nwill  produce  a  single  !   when  the  prompt string is\nprinted.  Note that any terminal escape sequences used in\nthe  PS1 prompt thus need every instance of !  in them to\nbe changed to !!.\nPS2    Secondary prompt string, by default ``> ''.\nPS3    Selection prompt string used within a select loop, by de-\nfault ``#? ''.\nPS4    The  value  of  this  variable  is expanded for parameter\nevaluation, command substitution, and  arithmetic  expan-\nsion  and  precedes  each line of an execution trace.  By\ndefault, PS4 is ``+ ''.  In addition when PS4  is  unset,\nthe execution trace prompt is also ``+ ''.\nSHELL  The pathname of the shell is kept in the environment.  At\ninvocation, if the basename  of  this  variable  is  rsh,\nrksh, or krsh, then the shell becomes restricted.\nTIMEFORMAT\nThe  value  of  this parameter is used as a format string\nspecifying how the timing information for pipelines  pre-\nfixed  with  the  time reserved word should be displayed.\nThe % character introduces a format sequence that is  ex-\npanded  to a time value or other information.  The format\nsequences and their meanings are as follows.\n%%        A literal %.\n%[p][l]R  The elapsed time in seconds.\n%[p][l]U  The number of CPU seconds spent in user mode.\n%[p][l]S  The number of CPU seconds spent in system mode.\n%P        The CPU percentage, computed as (U + S) / R.\n\nThe brackets denote optional portions.  The optional p is\na  digit  specifying  the  precision, the number of frac-\ntional digits after a decimal point.  A value of 0 causes\nno decimal point or fraction to be output.  At most three\nplaces after the decimal point can be  displayed;  values\nof p greater than 3 are treated as 3.  If p is not speci-\nfied, the value 3 is used.\n\nThe optional l specifies a longer format, including hours\nif  greater  than  zero, minutes, and seconds of the form\nHHhMMmSS.FFs.  The value of p determines whether  or  not\nthe fraction is included.\n\nAll  other  characters  are  output  without change and a\ntrailing newline is added.  If unset, the default  value,\n$'\\nreal\\t%2lR\\nuser\\t%2lU\\nsys\\t%2lS',  is used.  If the\nvalue is null, no timing information is displayed.\n\nTMOUT  Terminal read timeout. If set to  a  value  greater  than\nzero,  the  read built-in command and the select compound\ncommand time out after TMOUT seconds when input is from a\nterminal.   An interactive shell will issue a warning and\nallow for an extra 60 second timeout grace period  before\nterminating  if  a  line  is  not entered within the pre-\nscribed number of seconds while reading from a  terminal.\n(Note that the shell can be compiled with a maximum bound\nfor this value which cannot be exceeded.)\n\nVISUAL If  the  value  of  this  variable  matches  the  pattern\n*[Vv][Ii]*,  then  the vi option (see Special Command set\nbelow) is turned on.  If the value  matches  the  pattern\n*gmacs*  ,  the  gmacs option is turned on.  If the value\nmatches the pattern *macs*, then the emacs option will be\nturned  on.   The  value of VISUAL overrides the value of\nEDITOR.\n\nThe shell gives default values to PATH, PS1, PS2, PS3, PS4,  MAILCHECK,\nFCEDIT,  TMOUT and IFS, while HOME, SHELL, ENV, and MAIL are not set at\nall by the shell (although HOME is set by login(1)).  On  some  systems\nMAIL and SHELL are also set by login(1).\n\nField Splitting.\nAfter parameter expansion and command substitution, the results of sub-\nstitutions are scanned for the field separator characters (those  found\nin IFS) and split into distinct fields where such characters are found.\nExplicit null fields (\"\" or '') are  retained.   Implicit  null  fields\n(those resulting from parameters that have no values or command substi-\ntutions with no output) are removed.\n\nBrace Expansion.\nIf the braceexpand (-B) option is set then each of the fields resulting\nfrom  IFS  are  checked to see if they contain one or more of the brace\npatterns {*,*}, {l1..l2} , {n1..n2} , {n1..n2% fmt} , {n1..n2  ..n3}  ,\nor {n1..n2 ..n3%fmt} , where * represents any character, l1,l2 are let-\nters and n1,n2,n3 are signed numbers and fmt is a format  specified  as\nused  by  printf.   In  each case, fields are created by prepending the\ncharacters before the { and appending the characters  after  the  }  to\neach  of  the  strings generated by the characters between the { and }.\nThe resulting fields are checked to see if they  have  any  brace  pat-\nterns.\n\nIn  the first form, a field is created for each string between { and ,,\nbetween , and ,, and between , and }.  The string represented by *  can\ncontain  embedded  matching { and } without quoting.  Otherwise, each {\nand } with * must be quoted.\n\nIn the seconds form, l1 and l2 must both be either upper case  or  both\nbe lower case characters in the C locale.  In this case a field is cre-\nated for each character from l1 thru l2.\n\nIn the remaining forms, a field is created for each number starting  at\nn1 and continuing until it reaches n2 incrementing n1 by n3.  The cases\nwhere n3 is not specified behave as if n3 where 1 if n1<=n2 and -1 oth-\nerwise.   If forms which specify %fmt any format flags, widths and pre-\ncisions can be specified and fmt can  end  in  any  of  the  specifiers\ncdiouxX.   For  example,  {a,z}{1..5..3%02d}{b..c}x  expands  to  the 8\nfields, a01bx, a01cx, a04bx, a04cx, z01bx, z01cx, z04bx and z04cx.\n\nPathname Expansion.\nThis is also known as globbing or sometimes filename generation.   Fol-\nlowing splitting, each field is scanned for the characters *, ?, (, and\n[ unless the -f option has been set.  If one of  these  characters  ap-\npears,  then  the word is regarded as a pattern.  Each file name compo-\nnent that contains any pattern character is  replaced  with  a  lexico-\ngraphically  sorted set of names that matches the pattern from that di-\nrectory.  If no file name is found that matches the pattern, then  that\ncomponent  of the filename is left unchanged unless the pattern is pre-\nfixed with ~(N) in which case it is removed as  described  below.   The\nspecial  traversal  names  .  and ..  are never matched.  If FIGNORE is\nset, then each file name component that matches the pattern defined  by\nthe value of FIGNORE is ignored when generating the matching filenames.\nIf FIGNORE is not set, the character .  at the start of each file  name\ncomponent  will  be  ignored  unless the first character of the pattern\ncorresponding to this component is the character .  itself.  Note, that\nfor  other  uses  of pattern matching the / and .  are not treated spe-\ncially.\n\n*      Matches any string, including the null string.  When used\nfor  filename expansion, if the globstar option is on, an\nisolated pattern of two adjacent *'s will match all files\nand zero or more directories and subdirectories.  If fol-\nlowed by a / then  only  directories  and  subdirectories\nwill match.\n?      Matches any single character.\n[...]  Matches  any  one  of the enclosed characters.  A pair of\ncharacters separated by - matches any character lexically\nbetween the pair, inclusive.  If the first character fol-\nlowing the opening [ is a !  or ^ then any character  not\nenclosed  is matched.  A - can be included in the charac-\nter set by putting it as the first or last character.\nWithin [ and ], character classes can be  specified  with\nthe  syntax [:class:] where class is one of the following\nclasses defined in the ANSI C standard: (Note  that  word\nis equivalent to alnum plus the character .)\nalnum  alpha  blank  cntrl  digit graph lower print punct\nspace upper word xdigit\nWithin [ and ], an equivalence  class  can  be  specified\nwith  the  syntax [=c=] which matches all characters with\nthe same primary collation weight (as defined by the cur-\nrent  locale) as the character c.  Within [ and ], [.sym-\nbol.]  matches the collating symbol symbol.\nA pattern-list is a list of one or more patterns  separated  from  each\nother  with  a & or |.  A & signifies that all patterns must be matched\nwhereas | requires that only one pattern be  matched.   Composite  pat-\nterns can be formed with one or more of the following subpatterns:\n?(pattern-list)\nOptionally matches any one of the given patterns.\n*(pattern-list)\nMatches zero or more occurrences of the given patterns.\n+(pattern-list)\nMatches one or more occurrences of the given patterns.\n{n}(pattern-list)\nMatches n occurrences of the given patterns.\n{m,n}(pattern-list)\nMatches  from  m  to n occurrences of the given patterns.\nIf m is omitted, 0 will be used.   If  n  is  omitted  at\nleast m occurrences will be matched.\n@(pattern-list)\nMatches exactly one of the given patterns.\n!(pattern-list)\nMatches anything except one of the given patterns.\nBy  default,  each pattern, or subpattern will match the longest string\npossible consistent with generating the longest overall match.  If more\nthan  one  match is possible, the one starting closest to the beginning\nof the string will be chosen.   However, for each of the above compound\npatterns  a  -  can be inserted in front of the ( to cause the shortest\nmatch to the specified pattern-list to be used.\n\nWhen pattern-list is contained within parentheses, the backslash  char-\nacter  \\ is treated specially even when inside a character class.   All\nANSI C character escapes are recognized and match the specified charac-\nter.  In addition the following escape sequences are recognized:\n\\d     Matches any character in the digit class.\n\\D     Matches any character not in the digit class.\n\\s     Matches any character in the space class.\n\\S     Matches any character not in the space class.\n\\w     Matches any character in the word class.\n\\W     Matches any character not in the word class.\n\nA  pattern  of  the form %(pattern-pair(s)) is a subpattern that can be\nused to match nested character expressions.  Each pattern-pair is a two\ncharacter sequence which cannot contain & or |.  The first pattern-pair\nspecifies the starting and ending characters for the match.  Each  sub-\nsequent  pattern-pair represents the beginning and ending characters of\na nested group that will be skipped over  when  counting  starting  and\nending  character  matches.  The behavior is unspecified when the first\ncharacter of a pattern-pair is alphanumeric except for the following:\nD      Causes the ending character to terminate the  search  for\nthis pattern without finding a match.\nE      Causes  the  ending character to be interpreted as an es-\ncape character.\nL      Causes the ending character to be interpreted as a  quote\ncharacter causing all characters to be ignored when look-\ning for a match.\nQ      Causes the ending character to be interpreted as a  quote\ncharacter  causing  all  characters other than any escape\ncharacter to be ignored when looking for a match.\nThus, %({}Q\"E\\), matches characters starting at { until the matching  }\nis  found not counting any { or } that is inside a double quoted string\nor preceded by the escape character \\.  Without  the  {}  this  pattern\nmatches any C language string.\n\nEach  subpattern  in a composite pattern is numbered, starting at 1, by\nthe location of the ( within the pattern.  The sequence \\n, where n  is\na  single  digit  and  \\n comes after the n-th. subpattern, matches the\nsame string as the subpattern itself.\n\nFinally a pattern can contain subpatterns of  the  form  ~(options:pat-\ntern-list),  where either options or :pattern-list can be omitted.  Un-\nlike the other compound patterns, these subpatterns are not counted  in\nthe numbered subpatterns.  :pattern-list must be omitted for options F,\nG, N , and V below.  If options is present, it can consist  of  one  or\nmore of the following:\n+      Enable the following options.  This is the default.\n-      Disable the following options.\nE      The  remainder  of  the pattern uses extended regular ex-\npression syntax like the egrep(1) command.\nF      The remainder of the  pattern  uses  fgrep(1)  expression\nsyntax.\nG      The  remainder  of the pattern uses basic regular expres-\nsion syntax like the grep(1) command.\nK      The remainder of the pattern uses shell  pattern  syntax.\nThis is the default.\nN      This  is  ignored.   However, when it is the first letter\nand is used with pathname expansion, and no  matches  oc-\ncur, the file pattern expands to the empty string.\nX      The  remainder  of the pattern uses augmented regular ex-\npression syntax like the xgrep(1) command.\nP      The remainder of the pattern uses perl(1) regular expres-\nsion  syntax.   Not all perl regular expression syntax is\ncurrently implemented.\nV      The remainder of the pattern uses System  V  regular  ex-\npression syntax.\ni      Always treat the match as case-insensitive, regardless of\nthe globcasedetect shell option.\ng      File the longest match (greedy).  This is the default.\nl      Left anchor the pattern.  This is the default for K style\npatterns.\nr      Right  anchor  the  pattern.   This  is the default for K\nstyle patterns.\nIf both options and :pattern-list are specified, then the options apply\nonly to  pattern-list.  Otherwise, these options remain in effect until\nthey are disabled by a subsequent ~(...) or at the end of  the  subpat-\ntern containing ~(...).\n\nQuoting.\nEach of the metacharacters listed earlier (see Definitions above) has a\nspecial meaning to the shell and causes termination of  a  word  unless\nquoted.   A character may be quoted (i.e., made to stand for itself) by\npreceding it with a \\.  The pair \\new-line is removed.  All  characters\nenclosed between a pair of single quote marks ('') that is not preceded\nby a $ are quoted.  A single quote  cannot  appear  within  the  single\nquotes.   A single quoted string preceded by an unquoted $ is processed\nas an ANSI C string except for the following:\n\\0     Causes the remainder of the string to be ignored.\n\\E     Equivalent to the escape character (ASCII 033),\n\\e     Equivalent to the escape character (ASCII 033),\n\\cx    Expands to the character control-x.\n\\C[.name.]\nExpands to the collating element name.\n\nInside double quote marks (\"\"), parameter and command substitution  oc-\ncur and \\ quotes the characters \\, `, \", and $.  A $ in front of a dou-\nble quoted string will be ignored in the \"C\" or \"POSIX\" locale, and may\ncause  the string to be replaced by a locale specific string otherwise.\nThe meaning of $* and $@ is identical when not quoted or when used as a\nvariable  assignment  value or as a file name.  However, when used as a\ncommand argument, \"$*\" is equivalent to \"$1d$2d...\",  where  d  is  the\nfirst character of the IFS variable, whereas \"$@\" is equivalent to \"$1\"\n\"$2\" ....  Inside grave quote marks (``), \\ quotes the characters \\, `,\nand  $.   If  the  grave quotes occur within double quotes, then \\ also\nquotes the character \".\n\nThe special meaning of reserved words or  aliases  can  be  removed  by\nquoting  any  character of the reserved word.  The recognition of func-\ntion names or built-in command names listed below cannot be altered  by\nquoting them.\n\nArithmetic Evaluation.\nThe  shell  performs arithmetic evaluation for arithmetic expansion, to\nevaluate an arithmetic command, to evaluate an indexed array subscript,\nand  to  evaluate  arguments  to the built-in commands shift and let as\nwell as arguments to numeric format specifiers given to print -f    and\nprintf.   Evaluations  are  performed  using  double precision floating\npoint arithmetic or long double precision floating  point  for  systems\nthat  provide this data type.  Floating point constants follow the ANSI\nC programming language floating point conventions.   The  case-insensi-\ntive floating point constants NaN and Inf can be used to represent \"not\na number\" and infinity respectively, unless the posix shell  option  is\non.   Integer  constants follow the ANSI C programming language integer\nconstant conventions although only single byte character constants  are\nrecognized  and  character  casts are not recognized.  In addition con-\nstants can be of the form [base#]n where base is a decimal  number  be-\ntween  two  and  sixty-four representing the arithmetic base and n is a\nnumber in that base.  The digits above 9 are represented by  the  lower\ncase letters, the upper case letters, @, and  respectively.  For bases\nless than or equal to 36, upper and lower case characters can  be  used\ninterchangeably.\n\nAn arithmetic expression uses the same syntax, precedence, and associa-\ntivity of expression as the C language.  All the C  language  operators\nthat  apply to floating point quantities can be used.  In addition, the\noperator  can be used for exponentiation.  It has  higher  precedence\nthan  multiplication  and  is  left associative.  In addition, when the\nvalue of an arithmetic variable or subexpression can be represented  as\na  long  integer,  all  C language integer arithmetic operations can be\nperformed.  Variables can be referenced by name  within  an  arithmetic\nexpression  without using the parameter expansion syntax.  When a vari-\nable is referenced, its value is evaluated as an arithmetic expression.\n\nAny of the following math library functions that are in the C math  li-\nbrary can be used within an arithmetic expression:\n\nabs  acos acosh asin asinh atan atan2 atanh cbrt ceil copysign cos cosh\nerf erfc exp exp10 exp2 expm1 fabs fdim finite  float  floor  fma  fmax\nfmin  fmod  fpclass  fpclassify  hypot ilogb int isfinite isgreater is-\ngreaterequal isinf isinfinite isless  islessequal  islessgreater  isnan\nisnormal issubnormal isunordered iszero j0 j1 jn ldexp lgamma log log10\nlog1p log2 logb nearbyint nextafter nexttoward pow remainder rint round\nscalb scalbn signbit sin sinh sqrt tan tanh tgamma trunc y0 y1 yn\n\nIn  addition,  arithmetic  functions  can be defined as shell functions\nwith a variant of the function name syntax,\n\nfunction .sh.math.name ident ... { list ;}\nwhere name is the function name used in the  arithmetic  expres-\nsion  and each identifier, ident is a name reference to the long\ndouble  precision  floating  point  argument.   The   value   of\n.sh.value  when  the function returns is the value of this func-\ntion.  User defined functions can take up  to  3  arguments  and\noverride C math library functions.\n\nAn internal representation of a variable as a double precision floating\npoint can be specified with the -E [n], -F [n], or -X [n] option of the\ntypeset  special  built-in command.  The -E option causes the expansion\nof the value to be represented using scientific notation when it is ex-\npanded.   The optional option argument n defines the number of signifi-\ncant figures.  The -F option causes the expansion to be represented  as\na  floating  decimal  number when it is expanded.  The -X option causes\nthe expansion to be represented using the  %a  format  defined  by  ISO\nC-99.   The optional option argument n defines the number of places af-\nter the decimal (or radix) point in this case.\n\nAn internal integer representation of a variable can be specified  with\nthe  -i  [n]  option  of the typeset special built-in command.  The op-\ntional option argument n specifies an arithmetic base to be  used  when\nexpanding the variable.  If you do not specify an arithmetic base, base\n10 will be used.\n\nArithmetic evaluation is performed on the value of each assignment to a\nvariable  with  the  -E, -F, -X, or -i attribute.  Assigning a floating\npoint number to a variable whose type is an integer  causes  the  frac-\ntional part to be truncated.\n\nPrompting.\nWhen  used interactively, the shell prompts with the value of PS1 after\nexpanding it for parameter expansion, command substitution, and  arith-\nmetic  expansion, before reading a command.  In addition, each single !\nin the prompt is replaced by the command number.  A !!  is required  to\nplace !  in the prompt.  If at any time a new-line is typed and further\ninput is needed to complete a command, then the secondary prompt (i.e.,\nthe value of PS2) is issued.\n\nConditional Expressions.\nA  conditional  expression is used with the [[ compound command to test\nattributes of files and to compare strings.  Field splitting and  path-\nname  expansion are not performed on the words between [[ and ]].  Each\nexpression can be constructed from one or more of the  following  unary\nor binary expressions:\nstring True, if string is not null.\n-a file\nSame as -e below.  This is obsolete.\n-b file\nTrue, if file exists and is a block special file.\n-c file\nTrue, if file exists and is a character special file.\n-d file\nTrue, if file exists and is a directory.\n-e file\nTrue, if file exists.\n-f file\nTrue, if file exists and is an ordinary file.\n-g file\nTrue, if file exists and it has its setgid bit set.\n-k file\nTrue, if file exists and it has its sticky bit set.\n-n string\nTrue, if length of string is non-zero.\n-o ?option\nTrue, if option named option is a valid option name.\n-o option\nTrue, if option named option is on.\n-p file\nTrue, if file exists and is a fifo special file or a pipe.\n-r file\nTrue, if file exists and is readable by current process.\n-s file\nTrue, if file exists and has size greater than zero.\n-t fildes\nTrue,  if  file  descriptor number fildes is open and associated\nwith a terminal device.\n-u file\nTrue, if file exists and it has its setuid bit set.\n-v name\nTrue, if variable name is a valid variable name and is set.\n-w file\nTrue, if file exists and is writable by current process.\n-x file\nTrue, if file exists and is executable by current  process.   If\nfile exists and is a directory, then true if the current process\nhas permission to search in the directory.\n-z string\nTrue, if length of string is zero.\n-L file\nTrue, if file exists and is a symbolic link.\n-h file\nTrue, if file exists and is a symbolic link.\n-N file\nTrue, if file exists and the modification time is  greater  than\nthe last access time.\n-O file\nTrue,  if  file  exists and is owned by the effective user id of\nthis process.\n-G file\nTrue, if file exists and its group matches the  effective  group\nid of this process.\n-R name\nTrue if variable name is a name reference.\n-S file\nTrue, if file exists and is a socket.\nfile1 -nt file2\nTrue, if file1 exists and file2 does not, or file1 is newer than\nfile2.\nfile1 -ot file2\nTrue, if file2 exists and file1 does not, or file1 is older than\nfile2.\nfile1 -ef file2\nTrue, if file1 and file2 exist and refer to the same file.\nstring == pattern\nTrue,  if  string  matches  pattern.  Any part of pattern can be\nquoted to cause it to be matched as a string.  With a successful\nmatch  to  a  pattern, the .sh.match array variable will contain\nthe match and subpattern matches.\nstring = pattern\nSame as == above, but is obsolete.\nstring != pattern\nTrue, if string does not match pattern.  When the string matches\nthe  pattern the .sh.match array variable will contain the match\nand subpattern matches.\nstring =~ ere\nTrue if string matches the pattern ~(E)ere where ere is  an  ex-\ntended regular expression.\nstring1 < string2\nTrue,  if  string1  comes before string2 based on ASCII value of\ntheir characters.\nstring1 > string2\nTrue, if string1 comes after string2 based  on  ASCII  value  of\ntheir characters.\nThe following obsolete arithmetic comparisons are also permitted:\nexp1 -eq exp2\nTrue, if exp1 is equal to exp2.\nexp1 -ne exp2\nTrue, if exp1 is not equal to exp2.\nexp1 -lt exp2\nTrue, if exp1 is less than exp2.\nexp1 -gt exp2\nTrue, if exp1 is greater than exp2.\nexp1 -le exp2\nTrue, if exp1 is less than or equal to exp2.\nexp1 -ge exp2\nTrue, if exp1 is greater than or equal to exp2.\n\nIn  each  of  the  above expressions, if file is of the form /dev/fd/n,\nwhere n is an integer, then the test is applied to the open file  whose\ndescriptor number is n.\n\nA compound expression can be constructed from these primitives by using\nany of the following, listed in decreasing order of precedence.\n(expression)\nTrue, if expression is true.  Used to group expressions.\n! expression\nTrue if expression is false.\nexpression1 && expression2\nTrue, if expression1 and expression2 are both true.\nexpression1 || expression2\nTrue, if either expression1 or expression2 is true.\n\nInput/Output.\nBefore a command is executed, its input and output  may  be  redirected\nusing  a  special notation interpreted by the shell.  The following may\nappear anywhere in a simple-command or may precede or follow a  command\nand  are  not  passed on to the invoked command.  Command substitution,\nparameter expansion, and arithmetic  expansion  occur  before  word  or\ndigit is used except as noted below.  Pathname expansion occurs only if\nthe shell is interactive and the pattern matches a single file.   Field\nsplitting is not performed.\n\nIn  each  of  the  following  redirections,  if  file  is  of  the form\n/dev/sctp/host/port, /dev/tcp/host/port, or  /dev/udp/host/port,  where\nhost is a hostname or host address, and port is a service given by name\nor an integer port number, then the redirection attempts to make a tcp,\nsctp or udp connection to the corresponding socket.\n\nNo  intervening  space is allowed between the characters of redirection\noperators.\n\n<word         Use file word as standard input (file descriptor 0).\n\n>word         Use file word as standard output (file descriptor 1).  If\nthe  file does not exist then it is created.  If the file\nexists, and the noclobber option is on,  this  causes  an\nerror; otherwise, it is truncated to zero length.\n\n>|word        Same as >, except that it overrides the noclobber option.\n\n>;word        Write  output  to  a temporary file.  If the command com-\npletes successfully rename it to word, otherwise,  delete\nthe  temporary file.  >;word cannot be used with the exec\nand redirect built-ins.\n\n>>word        Use file word as standard output.  If  the  file  exists,\nthen  output  is  appended to it (by first seeking to the\nend-of-file); otherwise, the file is created.\n\n<>word        Open file word for reading and writing as  standard  out-\nput.  If the posix option is active, it defaults to stan-\ndard input instead.\n\n<>;word       The same as <>word except that if the  command  completes\nsuccessfully,  word is truncated to the offset at command\ncompletion.  <>;word cannot be used with the exec and re-\ndirect built-ins.\n\n<<[-]word     The  shell input is read up to a line that is the same as\nword after any quoting has been removed, or to an end-of-\nfile.   No  parameter  expansion,  command  substitution,\narithmetic expansion or pathname expansion  is  performed\non word.  The resulting document, called a here-document,\nbecomes the standard input.  If any character of word  is\nquoted, then no interpretation is placed upon the charac-\nters of the  document;  otherwise,  parameter  expansion,\ncommand  substitution,  and  arithmetic  expansion occur,\n\\new-line is ignored, and \\ must be  used  to  quote  the\ncharacters  \\,  $,  `.   If - is appended to <<, then all\nleading tabs are stripped from word and  from  the  docu-\nment.   If  #  is appended to <<, then leading spaces and\ntabs will be stripped off the first line of the  document\nand up to an equivalent indentation will be stripped from\nthe remaining lines and from word.  A tab stop is assumed\nto occur at every 8 columns for the purposes of determin-\ning the indentation.\n\n<<<word       A short form of here document in which word  becomes  the\ncontents  of the here-document after any parameter expan-\nsion, command substitution, and arithmetic expansion  oc-\ncur.\n\n<&digit       The  standard  input  is  duplicated from file descriptor\ndigit (see dup(2)).\n\n>&digit       The standard output is duplicated  from  file  descriptor\ndigit.\n\n<&digit-      The  file  descriptor given by digit is moved to standard\ninput.\n\n>&digit-      The file descriptor given by digit is moved  to  standard\noutput.\n\n<&-           The standard input is closed.\n\n>&-           The standard output is closed.\n\n<&p           The input from the co-process is moved to standard input.\n\n>&p           The output to the co-process is moved to standard output.\n\n<#((expr))    Evaluate arithmetic expression expr and position file de-\nscriptor 0 to the resulting value bytes from the start of\nthe file.  The variables CUR and EOF evaluate to the cur-\nrent offset  and  end-of-file  offset  respectively  when\nevaluating expr.\n\n>#((offset))  The same as <# except applies to file descriptor 1.\n\n<#pattern     Seeks  forward to the beginning of the next line contain-\ning pattern.\n\n<##pattern    The same as <# except that the portion of the  file  that\nis skipped is copied to standard output.\n\nIf  one of the above is preceded by a digit, with no intervening space,\nthen the file descriptor number referred to is that  specified  by  the\ndigit (instead of the default 0 or 1).  If one of the above, other than\n>&- and the ># and <# forms, is preceded by {varname} with no interven-\ning  space,  then  a file descriptor number > 9 will be selected by the\nshell and stored in the variable varname, so it can  be  read  from  or\nwritten  to  with redirections like <& $varname or >& $varname.  If >&-\nor the any of the ># and <# forms is preceded by {varname} the value of\nvarname defines the file descriptor to close or position.  For example:\n\n... 2>&1\n\nmeans  file  descriptor 2 is to be opened for writing as a duplicate of\nfile descriptor 1 and\n\nexec {n}<file\n\nmeans open file named file for reading and store  the  file  descriptor\nnumber in variable n.\n\nA  special  shorthand  redirection  operator &>word is available; it is\nequivalent to >word 2>&1. It cannot be preceded by any digit  or  vari-\nable  name. This shorthand is disabled if the posix shell option is ac-\ntive.\n\nThe order in which redirections  are  specified  is  significant.   The\nshell  evaluates  each  redirection  in  terms of the (file descriptor,\nfile) association at the time of evaluation.  For example:\n\n... 1>fname 2>&1\n\nfirst associates file descriptor 1 with file fname.  It then associates\nfile descriptor 2 with the file associated with file descriptor 1 (i.e.\nfname).  If the order of redirections were reversed, file descriptor  2\nwould  be  associated with the terminal (assuming file descriptor 1 had\nbeen) and then file descriptor 1 would be associated with file fname.\n\nIf a command is followed by & and job control is not active,  then  the\ndefault  standard  input  for  the command is the empty file /dev/null.\nOtherwise, the environment for the execution of a command contains  the\nfile  descriptors  of  the  invoking  shell as modified by input/output\nspecifications.\n\nEnvironment.\nThe environment (see environ(7)) is a list of name-value pairs that  is\npassed  to  an  executed  program  in the same way as a normal argument\nlist.  The names must be  identifiers  and  the  values  are  character\nstrings.  The shell interacts with the environment in several ways.  On\ninvocation, the shell scans the environment and creates a variable  for\neach  name  found, giving it the corresponding value and attributes and\nmarking it export.  Executed commands inherit the environment.  If  the\nuser  modifies the values of these variables or creates new ones, using\nthe export or typeset -x commands, they become part of the environment.\nThe  environment  seen  by any executed command is thus composed of any\nname-value pairs originally inherited by the shell, whose values may be\nmodified  by  the current shell, plus any additions which must be noted\nin export or typeset -x commands.\n\nThe environment for any simple-command or function may be augmented  by\nprefixing it with one or more variable assignments.  A variable assign-\nment argument is a word of the form identifier=value.  Thus:\n\nTERM=450 cmd args                  and\n(export TERM; TERM=450; cmd args)\n\nare equivalent (as far as the above execution of cmd is  concerned  ex-\ncept for special built-in commands listed below - those that are marked\nwith <*>).\n\nIf the obsolete -k option is set, all variable assignment arguments are\nplaced  in  the environment, even if they occur after the command name.\nThe following first prints a=b c and then c:\n\necho a=b c\nset -k\necho a=b c\nThis feature is intended for use with scripts written  for  early  ver-\nsions  of the shell and its use in new scripts is strongly discouraged.\nIt is likely to disappear someday.\n\nFunctions.\nFor historical reasons, there are two ways  to  define  functions,  the\nname()  syntax  and the function name syntax, described in the Commands\nsection above.  Shell functions are  read  in  and  stored  internally.\nAlias names are resolved when the function is read.  Functions are exe-\ncuted like commands with the arguments passed as positional parameters.\n(See Execution below.)\n\nFunctions  defined  by the function name syntax and called by name exe-\ncute in the same process as the caller and share all files and  present\nworking  directory with the caller.  Traps caught by the caller are re-\nset to their default action inside the function.  A trap condition that\nis  not caught or ignored by the function causes the function to termi-\nnate and the condition to be passed on to the caller.  A trap  on  EXIT\nset  inside a function is executed in the environment of the caller af-\nter the function completes.  Ordinarily, variables are  shared  between\nthe  calling  program  and  the function.  However, the typeset special\nbuilt-in command used within a function defines local  variables  whose\nscope  includes  the current function.  They can be passed to functions\nthat they call in the variable assignment list that precedes  the  call\nor as arguments passed as name references.  Errors within functions re-\nturn control to the caller.\n\nFunctions defined with the name() syntax and functions defined with the\nfunction  name syntax that are invoked with the .  special built-in are\nexecuted in the caller's environment and share all variables and  traps\nwith  the  caller.   Errors  within these function executions cause the\nscript that contains them to abort.\n\nThe special built-in command return is used  to  return  from  function\ncalls.\n\nFunction  names  can  be listed with the -f or +f option of the typeset\nspecial built-in command.  The text of functions, when available,  will\nalso  be listed with -f.  Functions can be undefined with the -f option\nof the unset special built-in command.\n\nOrdinarily, functions are unset when the shell executes a shell script.\nFunctions  that  need  to be defined across separate invocations of the\nshell should be placed in a directory and  the  FPATH  variable  should\ncontain  the name of this directory.  They may also be specified in the\nENV file.\n\nDiscipline Functions.\nEach variable can have zero or  more  discipline  functions  associated\nwith  it.   The  shell  initially understands the discipline names get,\nset, append, and unset but can be added when defining  new  types.   On\nmost  systems others can be added at run time via the C programming in-\nterface extension provided by the builtin built-in utility.  If the get\ndiscipline  is defined for a variable, it is invoked whenever the given\nvariable is referenced.  If the variable .sh.value is assigned a  value\ninside  the  discipline function, the referenced variable will evaluate\nto this value instead.  If the set discipline is defined  for  a  vari-\nable,  it  is  invoked whenever the given variable is assigned a value.\nIf the append discipline is defined for a variable, it is invoked when-\never a value is appended to the given variable.  The variable .sh.value\nis given the value of the variable before invoking the discipline,  and\nthe  variable  will be assigned the value of .sh.value after the disci-\npline completes.  If .sh.value is unset  inside  the  discipline,  then\nthat  value  is  unchanged.   If  the unset discipline is defined for a\nvariable, it is invoked whenever the  given  variable  is  unset.   The\nvariable  will  not  be unset unless it is unset explicitly from within\nthis discipline function.\n\nThe variable .sh.name contains the name of the variable for  which  the\ndiscipline  function  is  called, .sh.subscript is the subscript of the\nvariable, and .sh.value will contain the value  being  assigned  inside\nthe  set  discipline  function.   The  variable  is a reference to the\nvariable including the subscript  if  any.   For  the  set  discipline,\nchanging  .sh.value will change the value that gets assigned.  Finally,\nthe expansion ${var.name}, when name is the name of a  discipline,  and\nthere is no variable of this name, is equivalent to the command substi-\ntution ${ var.name;}.\n\nName Spaces.\nCommands and functions that are executed as part of the list of a name-\nspace  command  that  modify variables or create new ones, create a new\nvariable whose name is the name of the name space as given  by  identi-\nfier  preceded by ..  When a variable whose name is name is referenced,\nit is first searched for using .identifier.name.  Similarly, a function\ndefined  by  a  command in the namespace list is created using the name\nspace name preceded by a ..\n\nWhen  the list of a namespace command contains a namespace command, the\nnames  of variables and functions that are created consist of the vari-\nable or function name preceded by the list of identifiers each preceded\nby ..\n\nOutside  of  a name space, a variable or function created inside a name\nspace can be referenced by preceding it with the name space name.\n\nBy default, variables starting with .sh are in the sh name space.\n\nType Variables.\nTyped variables provide a way to create data structure and objects.   A\ntype  can  be  defined either by a shared library, by the enum built-in\ncommand described below, or by using the new -T option of  the  typeset\nbuilt-in command.  With the -T option of typeset, the type name, speci-\nfied as an option argument to -T, is set with a compound  variable  as-\nsignment that defines the type.  Function definitions can appear inside\nthe compound variable assignment and these become discipline  functions\nfor  this  type and can be invoked or redefined by each instance of the\ntype.  The function name create is treated specially.   It  is  invoked\nfor  each instance of the type that is created but is not inherited and\ncannot be redefined for each instance.\n\nWhen a type is defined a special  built-in  command  of  that  name  is\nadded.   These  built-ins  are declaration commands and follow the same\nexpansion rules as the  built-in  commands  described  below  that  are\nmarked  with a <> symbol. These commands can subsequently be used in-\nside further type definitions.  The man page for these commands can  be\ngenerated  by using the --man option or any of the other -- options de-\nscribed with getopts.  The -r, -a, -A, -h, and -S  options  of  typeset\nare permitted with each of these new built-ins.\n\nAn  instance of a type is created by invoking the type name followed by\none or more instance names.  Each instance of the type  is  initialized\nwith  a  copy  of the subvariables except for subvariables that are de-\nfined with the -S option.  Variables defined with the -S are shared  by\nall  instances  of the type.  Each instance can change the value of any\nsubvariable and can also define new discipline functions  of  the  same\nnames  as  those defined by the type definition as well as any standard\ndiscipline names.  No additional subvariables can be  defined  for  any\ninstance.\n\nWhen  defining a type, if the value of a subvariable is not set and the\n-r attribute is specified, it causes the subvariable to be  a  required\nsubvariable.   Whenever  an instance of a type is created, all required\nsubvariables must be specified.  These subvariables become read-only in\neach instance.\n\nWhen unset is invoked on a subvariable within a type, and the -r attri-\nbute has not been specified for this field, the value is reset  to  the\ndefault  value associative with the type.  Invoking unset on a type in-\nstance not contained within another type deletes all  subvariables  and\nthe variable itself.\n\nA type definition can be derived from another type definition by defin-\ning the first subvariable name as  and defining its type as  the  base\ntype.   Any  remaining  definitions will be additions and modifications\nthat apply to the new type.  If the new type name is the same  as  that\nof  the base type, the type will be replaced and the original type will\nno longer be accessible.\n\nThe typeset command with the -T and no option argument or operands will\nwrite all the type definitions to standard output in a form that can be\nread in to create all they types.\n\nJobs.\nIf the monitor option of the set command is turned on,  an  interactive\nshell associates a job with each pipeline.  It keeps a table of current\njobs, printed by the jobs command, and assigns them small integer  num-\nbers.   When a job is started asynchronously with &, the shell prints a\nline which looks like:\n\n[1] 1234\n\nindicating that the job which was started asynchronously was job number\n1 and had one (top-level) process, whose process id was 1234.\n\nThis  paragraph  and the next require features that are not in all ver-\nsions of UNIX and may not apply.  If you are running a job and wish  to\ndo something else you may hit the key ^Z (control-Z) which sends a STOP\nsignal to the current job.  The shell will then normally indicate  that\nthe job has been `Stopped', and print another prompt.  You can then ma-\nnipulate the state of this job, putting it in the background  with  the\nbg  command,  or  run some other commands and then eventually bring the\njob back into the foreground with the  foreground  command  fg.   A  ^Z\ntakes  effect immediately and is like an interrupt in that pending out-\nput and unread input are discarded when it is typed.\n\nA job being run in the background will stop if it tries  to  read  from\nthe  terminal.  Background jobs are normally allowed to produce output,\nbut this can be disabled by giving the command stty tostop.  If you set\nthis  tty  option, then background jobs will stop when they try to pro-\nduce output like they do when they try to read input.\n\nA job pool is a collection of jobs started with list & associated  with\na name.\n\nThere are several ways to refer to jobs in the shell.  A job can be re-\nferred to by the process id of any process of the job or by one of  the\nfollowing:\n%number\nThe job with the given number.\npool   All the jobs in the job pool named by pool.\npool.number\nThe job number number in the job pool named by pool.\n%string\nAny job whose command line begins with string.\n%?string\nAny job whose command line contains string.\n%%     Current job.\n%+     Equivalent to %%.\n%-     Previous  job.   In addition, unless noted otherwise, wherever a\njob can be specified, the name of a background job pool  can  be\nused to represent all the jobs in that pool.\n\nThe shell learns immediately whenever a process changes state.  It nor-\nmally informs you whenever a job becomes blocked  so  that  no  further\nprogress is possible, but only just before it prints a prompt.  This is\ndone so that it does not otherwise disturb your work.  The  notify  op-\ntion of the set command causes the shell to print these job change mes-\nsages as soon as they occur.\n\nWhen the monitor option is on, each background job that completes trig-\ngers any trap set for CHLD.\n\nWhen  you try to leave the shell while jobs are running or stopped, you\nwill be warned that `You have stopped(running) jobs.'  You may use  the\njobs  command  to  see  what  they are.  If you immediately try to exit\nagain, the shell will not warn you a second time, and the stopped  jobs\nwill be terminated.  When a login shell receives a HUP signal, it sends\na HUP signal to each job that has not been  disowned  with  the  disown\nbuilt-in command described below.\n\nSignals.\nThe INT and QUIT signals for an invoked command are ignored if the com-\nmand is followed by & and the monitor option is not active.  Otherwise,\nsignals have the values inherited by the shell from its parent (but see\nalso the trap built-in command below).\n\nExecution.\nEach time a command is read, the above expansions and substitutions are\ncarried  out.   If the command name matches one of the Special Built-in\nCommands listed below, it is executed within the current shell process.\nNext,  the  command name is checked to see if it matches a user defined\nfunction.  If it does, the positional parameters are saved and then re-\nset to the arguments of the function call.  A function is also executed\nin the current shell process.  When the function completes or issues  a\nreturn,  the  positional parameter list is restored.  For functions de-\nfined with the function name syntax, any trap set on  EXIT  within  the\nfunction is executed.  The exit value of a function is the value of the\nlast command executed.  If a command name is  not  a  special  built-in\ncommand  or a user defined function, but it is one of the built-in com-\nmands listed below, it is executed in the current shell process.\n\nThe shell variables PATH followed by the  variable  FPATH  defines  the\nlist of directories to search for the command name.  Alternative direc-\ntory names are separated by a colon (:).  The default path is the value\nthat was output by getconf PATH at the time ksh was compiled.  The cur-\nrent directory can be specified by two or more adjacent colons, or by a\ncolon  at  the  beginning or end of the path list.  If the command name\ncontains a /, then the search path is not used.  Otherwise, each direc-\ntory in the list of directories defined by PATH and FPATH is checked in\norder.  If the directory being searched is contained in FPATH and  con-\ntains  a  file whose name matches the command being searched, then this\nfile is loaded into the current shell environment as if it were the ar-\ngument  to  the . command except that only preset aliases are expanded,\nand a function of the given name is executed as described above.\n\nIf this directory is not in FPATH the shell  first  determines  whether\nthere is a built-in version of a command corresponding to a given path-\nname and if so it is invoked in the current process.  If no built-in is\nfound,  the shell checks for a file named .paths in this directory.  If\nfound and there is a line of the form FPATH=path where  path  names  an\nexisting  directory  then  that directory is searched immediately after\nthe current directory as if it were found in the  FPATH  variable.   If\npath does not begin with /, it is checked for relative to the directory\nbeing searched.\n\nThe .paths file is then checked for a line of the form  PLUGINLIB=lib-\nname  [  :  libname  ]  ...  .   Each  library named by libname will be\nsearched for as if it were an option argument to builtin -f, and if  it\ncontains a built-in of the specified name this will be executed instead\nof a command by this name.  Any built-in loaded from  a  library  found\nthis  way  will  be associated with the directory containing the .paths\nfile so it will only execute if not found in an earlier directory.\n\nFinally, the directory will be checked for a file of  the  given  name.\nIf  the file has execute permission but is not an a.out file, it is as-\nsumed to be a file containing shell  commands.   A  separate  shell  is\nspawned  to  read  it.   All non-exported variables are removed in this\ncase.  If the shell command file doesn't have read  permission,  or  if\nthe  setuid and/or setgid bits are set on the file, then the shell exe-\ncutes an agent whose job it is to set up the  permissions  and  execute\nthe  shell with the shell command file passed down as an open file.  If\nthe .paths contains a line of the form name=value in the first or  sec-\nond  line, then the environment variable name is modified by prepending\nthe directory specified by value to the directory list.   If  value  is\nnot  an  absolute  directory, then it specifies a directory relative to\nthe directory that the executable was found.  If the environment  vari-\nable  name  does  not already exist it will be added to the environment\nlist for the specified command.  A parenthesized command is executed in\na subshell without removing non-exported variables.\n\nCommand Re-entry.\nThe  text  of  the  last HISTSIZE (default 512) commands entered from a\nterminal device is saved in a history file.  The file $HOME/.shhistory\nis  used if the HISTFILE variable is not set or if the file it names is\nnot writable.  A shell can  access  the  commands  of  all  interactive\nshells which use the same named HISTFILE.  The built-in command hist is\nused to list or edit a portion of this file.  The portion of  the  file\nto be edited or listed can be selected by number or by giving the first\ncharacter or characters of the command.  A single command or  range  of\ncommands  can be specified.  If you do not specify an editor program as\nan argument to hist then the value of the variable  HISTEDIT  is  used.\nIf  HISTEDIT is unset, the obsolete variable FCEDIT is used.  If FCEDIT\nis not defined, then /bin/ed is used.  The edited command(s) is printed\nand  re-executed  upon leaving the editor unless you quit without writ-\ning.  The -s option (and in obsolete versions, the editor  name  -)  is\nused  to skip the editing phase and to re-execute the command.  In this\ncase a substitution parameter of the form old=new can be used to modify\nthe  command  before  execution.  For example, with the preset alias r,\nwhich is aliased to 'hist -s', typing `r bad=good  c'  will  re-execute\nthe  most  recent command which starts with the letter c, replacing the\nfirst occurrence of the string bad with the string good.\n\nIn-line Editing Options.\nNormally, each command line entered from a terminal  device  is  simply\ntyped  followed by a new-line (`RETURN' or `LINE FEED').  If either the\nemacs, gmacs, or vi option is active, the user  can  edit  the  command\nline.   To  be  in either of these edit modes set the corresponding op-\ntion.  An editing option is automatically selected each time the VISUAL\nor EDITOR variable is assigned a value ending in either of these option\nnames.\n\nThe editing features require that the user's terminal  accept  `RETURN'\nas  carriage return without line feed and that a space (` ') must over-\nwrite the current character on the screen.\n\nUnless the multiline option is on, the editing modes implement  a  con-\ncept  where  the  user is looking through a window at the current line.\nThe window width is the value of COLUMNS if it  is  defined,  otherwise\n80.   If  the window width is too small to display the prompt and leave\nat least 8 columns to enter input, the prompt  is  truncated  from  the\nleft.  If the line is longer than the window width minus two, a mark is\ndisplayed at the end of the window to notify the user.  As  the  cursor\nmoves  and  reaches  the  window boundaries the window will be centered\nabout the cursor.  The mark is a > (<, *) if the line  extends  on  the\nright (left, both) side(s) of the window.\n\nThe  search  commands  in  each edit mode provide access to the history\nfile.  Only strings are matched, not patterns, although a leading ^  in\nthe  string  restricts the match to begin at the first character in the\nline.\n\nEach of the edit modes has an operation to list the files  or  commands\nthat match a partially entered word.  When applied to the first word on\nthe line, or the first word after a ;, |, &, or (, and  the  word  does\nnot  begin  with  ~ or contain a /, the list of aliases, functions, and\nexecutable commands defined by the PATH variable that could  match  the\npartial word is displayed.  Otherwise, the list of files that match the\ngiven word is displayed.  If the partially entered word does  not  con-\ntain  any  file expansion characters, a * is appended before generating\nthese lists.  After displaying the generated list, the  input  line  is\nredrawn.   These  operations  are  called command name listing and file\nname listing, respectively.  There are additional operations,  referred\nto  as  command name completion and file name completion, which compute\nthe list of matching commands or files, but  instead  of  printing  the\nlist,  replace  the current word with a complete or partial match.  For\nfile name completion, if the match is unique, a / is  appended  if  the\nfile is a directory and a space is appended if the file is not a direc-\ntory.  Otherwise, the longest common prefix for all the matching  files\nreplaces  the  word.   For command name completion, only the portion of\nthe file names after the last / are used to find  the  longest  command\nprefix.   If  only  a single name matches this prefix, then the word is\nreplaced with the command name followed by a space.  When using  a  tab\nfor  completion  that  does  not yield a unique match, a subsequent tab\nwill provide a numbered list of matching alternatives.  A specific  se-\nlection can be made by entering the selection number followed by a tab.\n\nKey Bindings.\nThe  KEYBD  trap  can  be  used to intercept keys as they are typed and\nchange the characters that are actually seen by the shell.   This  trap\nis  executed  after  each character (or sequence of characters when the\nfirst character is ESC) is entered while reading from a terminal.   The\nvariable  .sh.edchar contains the character or character sequence which\ngenerated the trap.  Changing the value of .sh.edchar in the  trap  ac-\ntion  causes  the shell to behave as if the new value were entered from\nthe keyboard rather than the original value.\n\nThe variable .sh.edcol is set to the input column number of the  cursor\nat  the  time of the input.  The variable .sh.edmode is set to ESC when\nin vi insert mode (see below) and is  null  otherwise.   By  prepending\n${.sh.editmode}  to  a  value  assigned to .sh.edchar it will cause the\nshell to change to control mode if it is not already in this mode.\n\nThis trap is not invoked for characters entered as arguments to editing\ndirectives, or while reading input for a character search.\n\nEmacs Editing Mode.\nThis mode is entered by enabling either the emacs or gmacs option.  The\nonly difference between these two modes is the way they handle ^T.   To\nedit,  the  user  moves  the cursor to the point needing correction and\nthen inserts or deletes characters or words as needed.  All the editing\ncommands  are control characters or escape sequences.  The notation for\ncontrol characters is caret (^) followed by the character.   For  exam-\nple,  ^F  is the notation for control F.  This is entered by depressing\n`f' while holding down the `CTRL' (control) key.  The  `SHIFT'  key  is\nnot depressed.  (The notation ^?  indicates the DEL (delete) key.)\n\nThe  notation  for escape sequences is M- followed by a character.  For\nexample, M-f (pronounced Meta f) is entered by  depressing  ESC  (ASCII\n033)  followed  by `f'.  (M-F would be the notation for ESC followed by\n`SHIFT' (capital) `F'.)\n\nAll edit commands operate from any place on the line (not just  at  the\nbeginning).   Neither  the  `RETURN' nor the `LINE FEED' key is entered\nafter edit commands except when noted.\n\nThe M-[ multi-character commands below are DEC VT220  escape  sequences\ngenerated  by  special keys on standard PC keyboards, such as the arrow\nkeys.  You could type them directly but they are meant to recognize the\nkeys in question, which are indicated in parentheses.\n\n^F        Move cursor forward (right) one character.\nM-[C      (Right arrow) Same as ^F.\nM-f       Move  cursor forward one word.  (The emacs editor's idea of a\nword is a string of characters consisting  of  only  letters,\ndigits and underscores.)\n^B        Move cursor backward (left) one character.\nM-[D      (Left arrow) Same as ^B.\nM-b       Move cursor backward one word.\n^A        Move cursor to start of line.\nM-[H      (Home) Same as ^A.\n^E        Move cursor to end of line.\nM-[F      (End) Same as ^E.\nM-[Y      Same as ^E.\n^]char    Move cursor forward to character char on current line.\nM-^]char  Move cursor backward to character char on current line.\n^X^X      Interchange the cursor and mark.\nerase     (User  defined erase character as defined by the stty(1) com-\nmand, usually ^H .)  Delete previous character.\nlnext     (User defined  literal  next  character  as  defined  by  the\nstty(1)  command,  or  ^V  if not defined.)  Removes the next\ncharacter's editing features (if any).\n^D        Delete current character.\nM-[3~     (Forward delete) Same as ^D.\nM-d       Delete current word.\nM-^H      (Meta-backspace) Delete previous word.\nM-h       Delete previous word.\nM-^?      (Meta-DEL) Delete previous word (if your interrupt  character\nis ^?  (DEL, the default) then this command will not work).\n^T        Transpose  current  character with previous character and ad-\nvance the cursor in emacs mode.  Transpose two previous char-\nacters in gmacs mode.\n^C        Capitalize current character.\nM-c       Capitalize current word.\nM-l       Change the current word to lower case.\n^K        Delete  from  the cursor to the end of the line.  If preceded\nby a numerical parameter whose value is less than the current\ncursor  position,  then  delete from given position up to the\ncursor.  If preceded by a numerical parameter whose value  is\ngreater  than  the  current cursor position, then delete from\ncursor up to given cursor position.\n^W        Kill from the cursor to the mark.\nM-p       Push the region from the cursor to the mark on the stack.\nkill      (User defined kill character as defined by the stty  command,\nusually  ^U  .)   Kill  the entire current line.  If two kill\ncharacters are entered in  succession,  all  kill  characters\nfrom  then on cause a line feed (useful when using paper ter-\nminals).  A subsequent pair of kill  characters  undoes  this\nchange.\n^Y        Restore  last  item removed from line. (Yank item back to the\nline.)\n^L        Line feed and print current line.\nM-^L      Clear the screen.\n^@        (Null character) Set mark.\nM-space   (Meta space) Set mark.\n^J        (New line) Execute the current line.\n^M        (Return) Execute the current line.\neof       End-of-file character, normally ^D, is processed as  an  End-\nof-file only if the current line is null.\n^P        Fetch previous command.  Each time ^P is entered the previous\ncommand back in time is accessed.  Moves back one  line  when\nnot on the first line of a multi-line command.\nM-[A      (Up  arrow)  If  the  cursor is at the end of the line, it is\nequivalent to ^R with string set to the contents of the  cur-\nrent line.  Otherwise, it is equivalent to ^P.\nM-<       Fetch the least recent (oldest) history line.\nM->       Fetch the most recent (youngest) history line.\n^N        Fetch  next  command  line.  Each time ^N is entered the next\ncommand line forward in time is accessed.\nM-[B      (Down arrow) Equivalent to ^N.\n^Rstring  Reverse search history for a previous command line containing\nstring.   If a parameter of zero is given, the search is for-\nward.  String is terminated by a `RETURN' or `NEW LINE'.   If\nstring  is  preceded by a ^, the matched line must begin with\nstring.  If string is omitted, then  the  next  command  line\ncontaining  the most recent string is accessed.  In this case\na parameter of zero reverses the direction of the search.\n^O        Operate - Execute the current line and fetch  the  next  line\nrelative to current line from the history file.\nM-digits  (Escape)  Define numeric parameter, the digits are taken as a\nparameter to the next command.  The commands  that  accept  a\nparameter are ^F, ^B, erase, ^C, ^D, ^K, ^R, ^P, ^N, ^], M-.,\nM-^], M-, M-=, M-b, M-c, M-d, M-f, M-h, M-l, M-^H,  and  the\narrow keys and forward-delete key.\nM-letter  Soft-key  -  Your  alias list is searched for an alias by the\nname letter and if an alias of this  name  is  defined,  its\nvalue  will  be inserted on the input queue.  The letter must\nnot be one of the above meta-functions.\nM-[letter Soft-key - Your alias list is searched for an  alias  by  the\nname  letter  and  if an alias of this name is defined, its\nvalue will be inserted on the input queue.  This can be  used\nto program function keys on many terminals.\nM-.       The  last  word  of  the  previous command is inserted on the\nline.  If preceded by a numeric parameter, the value of  this\nparameter  determines  which  word  to insert rather than the\nlast word.\nM-       Same as M-..\nM-*       Attempt pathname expansion on the current word.  An  asterisk\nis appended if the word doesn't match any file or contain any\nspecial pattern characters.\nM-ESC     Command or file name completion as described above.\n^I tab    Attempts command or file name completion as described  above.\nIf a partial completion occurs, repeating this will behave as\nif M-= were entered.  If no match is found or  entered  after\nspace, a tab is inserted.\nM-=       If not preceded by a numeric parameter, it generates the list\nof matching commands or file names as described above.   Oth-\nerwise,  the  word  under  the cursor is replaced by the item\ncorresponding to the value of the numeric parameter from  the\nmost  recently generated command or file list.  If the cursor\nis not on a word, it is inserted instead.\n^U        Multiply parameter of next command by 4.\n\\         If the backslashctrl shell option is on (which is the default\nsetting),  this  escapes the next character.  Editing charac-\nters, the user's erase,  kill  and  interrupt  (normally  ^C)\ncharacters  may  be  entered in a command line or in a search\nstring if preceded by a \\.  The \\ removes  the  next  charac-\nter's editing features (if any).  See also lnext which is not\nsubject to any shell option.\nM-^V      Display version of the shell.\nM-#       If the line does not begin with a #, a # is inserted  at  the\nbeginning  of  the line and after each new-line, and the line\nis entered.  This causes a comment to be inserted in the his-\ntory file.  If the line begins with a #, the # is deleted and\none # after each new-line is also deleted.\n\nVi Editing Mode.\nThere are two typing modes.  Initially, when you enter  a  command  you\nare in the input mode.  To edit, the user enters control mode by typing\nESC (033) and moves the cursor to the point needing correction and then\ninserts  or  deletes  characters or words as needed.  Most control com-\nmands accept an optional repeat count prior to the command.\n\nThe notation for control characters used below is ^ followed by a char-\nacter.  For instance, ^H is entered by holding down the Control key and\npressing H.  ^[ (Control+[) is equivalent to the ESC key.  The notation\nfor escape sequences is ^[ followed by one or more characters.\n\nThe ^[[ (ESC [) multi-character commands below are DEC VT220 escape se-\nquences generated by special keys on standard PC keyboards, such as the\narrow  keys,  which  are  indicated in parentheses. When in input mode,\nthese keys will switch you to control mode before performing the  asso-\nciated  action.  These sequences can use preceding repeat count parame-\nters, but only when the ^[ and the subsequent [ are  entered  into  the\ninput buffer at the same time, such as when pressing one of those keys.\n\nInput Edit Commands\nBy default the editor is in input mode.\nerase     (User  defined  erase character as defined by the stty\ncommand, usually ^H or #.)  Delete previous character.\n^W        Delete the previous blank  separated  word.   On  some\nsystems  the  viraw option may be required for this to\nwork.\neof       As the first character of the line causes the shell to\nterminate  unless the ignoreeof option is set.  Other-\nwise this character is ignored.\nlnext     (User defined literal next character as defined by the\nstty(1) or ^V if not defined.)  Removes the next char-\nacter's editing features (if any).   On  some  systems\nthe viraw option may be required for this to work.\n\\         If  the backslashctrl shell option is on (which is the\ndefault setting), this escapes the next erase or  kill\ncharacter.\n^I tab    Attempts  command or file name completion as described\nabove and returns to input mode.  If a partial comple-\ntion  occurs,  repeating this will behave as if = were\nentered from control mode.  If no match  is  found  or\nentered after space, a tab is inserted.\nMotion Edit Commands\nThese commands will move the cursor.\n[count]l  Cursor forward (right) one character.\n[count]^[[C\n(Right arrow) Same as l.\n[count]w  Cursor forward one alphanumeric word.\n[count]W  Cursor  to the beginning of the next word that follows\na blank.\n[count]e  Cursor to end of word.\n[count]E  Cursor to end of the current blank delimited word.\n[count]h  Cursor backward (left) one character.\n[count]^[[D\n(Left arrow) Same as h.\n[count]b  Cursor backward one word.\n[count]B  Cursor to preceding blank separated word.\n[count]|  Cursor to column count.\n[count]fc Find the next character c in the current line.\n[count]Fc Find the previous character c in the current line.\n[count]tc Equivalent to f followed by h.\n[count]Tc Equivalent to F followed by l.\n[count];  Repeats count times, the last  single  character  find\ncommand, f, F, t, or T.\n[count],  Reverses  the last single character find command count\ntimes.\n0         Cursor to start of line.\n^[[H      (Home) Same as 0.\n^         Cursor to first non-blank character in line.\n$         Cursor to end of line.\n^[[F      (End) Same as $.\n^[[Y      Same as $.\n%         Moves to balancing (, ), {, }, [, or ].  If cursor  is\nnot  on  one of the above characters, the remainder of\nthe line is searched for the first occurrence  of  one\nof the above characters first.\nSearch Edit Commands\nThese commands access your command history.\n[count]k  Fetch  previous  command.   Each time k is entered the\nprevious command back in time is accessed.\n[count]-  Equivalent to k.\n[count]^[[A\n(Up arrow) If cursor is at the end of the line  it  is\nequivalent to / with string set to the contents of the\ncurrent line.  Otherwise, it is equivalent to k.\n[count]j  Fetch next command.  Each time j is entered  the  next\ncommand forward in time is accessed.\n[count]+  Equivalent to j.\n[count]^[[B\n(Down arrow) Equivalent to j.\n[count]G  The  command  number count is fetched.  The default is\nthe least recent history command.\n/string   Search backward through history for a previous command\ncontaining string.  String is terminated by a `RETURN'\nor `NEW LINE'.  If string is  preceded  by  a  ^,  the\nmatched  line  must  begin  with string.  If string is\nnull, the previous string will be used.\n?string   Same as / except that search will be  in  the  forward\ndirection.\nn         Search  for  next  match of the last pattern to / or ?\ncommands.\nN         Search for next match of the last pattern to /  or  ?,\nbut in reverse direction.\nText Modification Edit Commands\nThese commands will modify the line.\na         Enter  input  mode  and  enter  text after the current\ncharacter.\nA         Append text to the end of the line.  Equivalent to $a.\n[count]cmotion\nc[count]motion\nDelete current character through  the  character  that\nmotion  would move the cursor to and enter input mode.\nIf motion is c, the entire line will  be  deleted  and\ninput mode entered.\nC         Delete  the  current character through the end of line\nand enter input mode.  Equivalent to c$.\nS         Equivalent to cc.\n[count]s  Replace characters under the cursor in input mode.\nD         Delete the current character through the end of  line.\nEquivalent to d$.\n[count]dmotion\nd[count]motion\nDelete  current  character  through the character that\nmotion would move to.  If motion is  d  ,  the  entire\nline will be deleted.\ni         Enter  input  mode  and insert text before the current\ncharacter.\nI         Insert text before the beginning of the line.  Equiva-\nlent to 0i.\n[count]P  Place  the  previous text modification before the cur-\nsor.\n[count]p  Place the previous text modification after the cursor.\nR         Enter input mode and replace characters on the  screen\nwith characters you type overlay fashion.\n[count]rc Replace the count character(s) starting at the current\ncursor position with c, and advance the cursor.\n[count]x  Delete current character.\n[count]^[[3~\n(Forward delete) Same as x.\n[count]X  Delete preceding character.\n[count].  Repeat the previous text modification command.\n[count]~  Invert the case of the count character(s) starting  at\nthe current cursor position and advance the cursor.\n[count]  Causes  the  count  word of the previous command to be\nappended and input mode entered.   The  last  word  is\nused if count is omitted.\n*         Causes  an  *  to  be appended to the current word and\npathname expansion attempted.  If no match  is  found,\nit rings the bell.  Otherwise, the word is replaced by\nthe matching pattern and input mode is entered.\n\\         Command or file name completion as described above.\nOther Edit Commands\nMiscellaneous commands.\n[count]ymotion\ny[count]motion\nYank current character through character  that  motion\nwould move the cursor to and puts them into the delete\nbuffer.  The text and cursor are unchanged.\nyy        Yanks the entire line.\nY         Yanks from current position to end of  line.   Equiva-\nlent to y$.\nu         Undo the last text modifying command.\nU         Undo  all the text modifying commands performed on the\nline.\n[count]v  Returns the command hist  -e  ${VISUAL:-${EDITOR:-vi}}\ncount  in the input buffer.  If count is omitted, then\nthe current line is used.\n^L        Line feed and print current line.  Has effect only  in\ncontrol mode.\n^J        (New line)  Execute  the  current  line, regardless of\nmode.\n^M        (Return) Execute the current line, regardless of mode.\n#         If the first character of the command  is  a  #,  then\nthis  command deletes this # and each # that follows a\nnewline.  Otherwise, sends the line after inserting  a\n#  in  front  of each line in the command.  Useful for\ncausing the current line to be inserted in the history\nas  a  comment  and  uncommenting previously commented\ncommands in the history file.\n[count]=  If count is not specified, it generates  the  list  of\nmatching  commands  or  file names as described above.\nOtherwise, the word under the cursor  is  replaced  by\nthe  count  item from the most recently generated com-\nmand or file list.  If the cursor is not on a word, it\nis inserted instead.\n@letter   Your  alias  list is searched for an alias by the name\nletter and if an alias of this name is  defined,  its\nvalue will be inserted on the input queue for process-\ning.\n^V        Display version of the shell.\n\nBuilt-in Commands.\nThe simple-commands listed below are built in to the shell and are exe-\ncuted  in  the same process as the shell.  The effects of any added In-\nput/Output redirections are local to the command, except for  the  exec\nand redirect commands.  Unless otherwise indicated, the output is writ-\nten on standard output (file descriptor 1) and the  exit  status,  when\nthere  is  no  syntax  error,  is zero.  Except for :, true, false, and\necho, all built-in commands accept -- to indicate end of  options,  and\nare self-documenting.\n\nThe  self-documenting  commands interpret the option --man as a request\nto display that command's own manual page, --help as a request to  dis-\nplay  the  OPTIONS section from their manual page, and -?  as a request\nto print a brief usage message.  All these are processed as error  mes-\nsages, so they are written on standard error (file descriptor 2) and to\npipe them into a pager such as more(1) you need to add a 2>&1 redirect-\nion before the |. The display of boldface text depends on whether stan-\ndard error is on a terminal, so is disabled when using a pager. Export-\ning  the ERROROPTIONS environment variable with a value containing em-\nphasis will force this on; a value containing noemphasis forces it off.\nThe  test/[  command needs an additional -- argument to recognize self-\ndocumentation options, e.g. test --man --.  The exec and redirect  com-\nmands,  as they make redirections permanent, should use self-documenta-\ntion options in a subshell when  redirecting,  for  example:  (redirect\n--man)  2>&1.   There  are advanced output options as well; see getopts\n--man for more information.\n\nCommands that are preceded by a <*>  symbol  below  are  special built-\nin commands and are treated specially in the following ways:\n1.     Variable assignment lists preceding the command remain in effect\nwhen the command completes.\n2.     I/O redirections are processed after variable assignments.\n3.     Errors cause a script that contains them to abort.\n4.     They are not valid function names.\nCommands that are preceded by a <> symbol below are  declaration com-\nmands.   Any  following  words that are in the format of a variable as-\nsignment are expanded with the same rules  as  a  variable  assignment.\nThis  means  that  tilde expansion is performed after the = sign, array\nassignments of the form varname=(assignlist) are supported, and  field\nsplitting and pathname expansion are not performed.\n\n<*> : [ arg ... ]\nThe command only expands parameters.\n\n<*> . name [ arg ... ]\nIf  name  is  a function defined with the function name reserved\nword syntax, the function is executed in the current environment\n(as  if  it had been defined with the name() syntax).  Otherwise\nif name refers to a file, the file is read in its  entirety  and\nthe commands are executed in the current shell environment.  The\nsearch path specified by PATH is used to find the directory con-\ntaining  the  file.  If any arguments arg are given, they become\nthe positional parameters while processing the  .   command  and\nthe original positional parameters are restored upon completion.\nOtherwise the positional parameters  are  unchanged.   The  exit\nstatus is the exit status of the last command executed.\n\n[ expression ]\nThe  [  command  is the same as test, with the exception that an\nadditional closing ] argument is required. See test below.\n\nalias [ -ptx ]  [ name[ =value  ] ] ...\nalias with no arguments prints the list of aliases in  the  form\nname=value  on  standard  output.  The -p option causes the word\nalias to be inserted before each one.  When one  or  more  argu-\nments  are  given, an alias is defined for each name whose value\nis given.  A trailing space in value causes the next word to  be\nchecked  for  alias substitution.  With the -t option, each name\nis looked up as a command in $PATH and its path is added to  the\nhash  table  as  a  'tracked  alias'.  If no name is given, this\nprints the hash table. See hash.  Without  the  -t  option,  for\neach  name in the argument list for which no value is given, the\nname and value of the alias is printed.  The obsolete -x  option\nhas  no effect.  The exit status is non-zero if a name is given,\nbut no value, and no alias has been defined for the name.\n\nautoload name ...\nMarks each name undefined so that the  FPATH  variable  will  be\nsearched  to  find  the function definition when the function is\nreferenced.  The same as typeset -fu.\n\nbg [ job... ]\nThis command is only on systems that support job control.   Puts\neach  specified job into the background.  The current job is put\nin the background if job is not specified.  See Jobs for  a  de-\nscription of the format of job.\n\n<*> break [ n ]\nExit  from  the  enclosing for, while, until, or select loop, if\nany.  If n is specified, then break n levels.\n\nbuiltin [ -ds ] [ -f file ] [ name ... ]\nIf name is not specified, and no -f  option  is  specified,  the\nbuilt-ins  are printed on standard output.  The -s option prints\nonly the special built-ins.  Otherwise, each name represents the\npathname  whose basename is the name of the built-in.  The entry\npoint function name is determined by prepending b to the built-\nin  name.   A built-in specified by a pathname will only be exe-\ncuted when that pathname would be found during the path  search.\nBuilt-ins found in libraries loaded via the .paths file will as-\nsociate with the pathname of the directory containing the .paths\nfile.\n\nThe  ISO  C/C++ prototype is bmycommand(int argc, char *argv[],\nvoid *context) for the builtin command mycommand where  argv  is\narray  an of argc elements and context is an optional pointer to\na Shellt structure as described in <ast/shell.h>.\n\nSpecial built-ins cannot be bound to a pathname or deleted.  The\n-d  option deletes each of the given built-ins.  On systems that\nsupport dynamic loading, the -f option names  a  shared  library\ncontaining  the  code  for built-ins.  The shared library prefix\nand/or suffix, which depend on the system, can be omitted.  Once\na library is loaded, its symbols become available for subsequent\ninvocations of builtin.  Multiple  libraries  can  be  specified\nwith separate invocations of the builtin command.  Libraries are\nsearched in the reverse order in which they are specified.  When\na  library  is  loaded,  it  looks for a function in the library\nwhose name is libinit() and invokes this function with an argu-\nment of 0.\n\ncd [ -L ] [ -eP ] [ arg ]\ncd [ -L ] [ -eP ] old new\nThis  command  can be in either of two forms.  In the first form\nit changes the current directory to arg.  If arg is - the direc-\ntory  is  changed to the previous directory.  The shell variable\nHOME is the default arg.  The variable PWD is set to the current\ndirectory.   The  shell  variable CDPATH defines the search path\nfor the directory containing arg.  Alternative  directory  names\nare separated by a colon (:).  The default path is <null> (spec-\nifying the current directory).  Note that the current  directory\nis  specified  by a null path name, which can appear immediately\nafter the equal sign or between the  colon  delimiters  anywhere\nelse  in  the path list.  If arg begins with a / then the search\npath is not used.  Otherwise, each  directory  in  the  path  is\nsearched for arg.\nThe  second form of cd substitutes the string new for the string\nold in the current directory name, PWD, and tries to  change  to\nthis new directory.\nBy default, symbolic link names are treated literally when find-\ning the directory name.  This is equivalent to  the  -L  option.\nThe  -P  option causes symbolic links to be resolved when deter-\nmining the directory.  The last instance of -L or -P on the com-\nmand line determines which method is used.\nIf -e and -P are both in effect and the correct PWD could not be\ndetermined after successfully changing the  directory,  cd  will\nreturn with exit status one and produce no output.  If any other\nerror occurs while both flags are active,  the  exit  status  is\ngreater than one.\nThe cd command may not be executed by rksh.\n\ncommand [ -pvxV ] name [ arg ... ]\nWith the -v option, command is equivalent to the built-in whence\ncommand described below.  The -V option causes  command  to  act\nlike whence -v.\n\nWithout the -v or -V options, command executes name with the ar-\nguments given  by  arg.   Functions  and  aliases  will  not  be\nsearched  for  when  finding  name.  If name refers to a special\nbuilt-in, as marked with <*> in this  manual,  command  disables\nthe  special properties described above for that mark, executing\nthe command as a regular built-in.  (For example, using  command\nset  -o  option-name  prevents a script from terminating when an\ninvalid option name is given.)\n\nThe -p option causes the operating system's  standard  utilities\npath  (as output by getconf PATH) to be searched rather than the\none defined by the value of PATH.\n\nThe -x option runs name as an external command, bypassing built-\nins.  If the arguments contain at least one word that expands to\nmultiple arguments, such as \"$@\" or *.txt, then  the  -x  option\nalso allows executing external commands with argument lists that\nare longer than the operating system allows. This  functionality\nis similar to xargs(1) but is easier to use. The shell does this\nby invoking the external command multiple times if  needed,  di-\nviding  the expanded argument list over the invocations. Any ar-\nguments that come before the first word that expands to multiple\narguments,  as  well  as any that follow the last such word, are\nconsidered static arguments and are repeated  for  each  invoca-\ntion.  This  allows  each invocation to use the same command op-\ntions, as well as the same trailing  destination  arguments  for\ncommands  like  cp(1)  or  mv(1).  When all invocations are com-\npleted, command -x exits with the status of the invocation  that\nhad  the  highest  exit status.  (Note that command -x may still\nfail with an \"argument list too long\" error if a single argument\nexceeds  the  maximum  length of the argument list, or if a long\narguments list contains no word that expands to  multiple  argu-\nments.)\n\n<> compound vname[=value] ...\nCauses  each vname to be a compound variable.  The same as type-\nset -C.\n\n<*> continue [ n ]\nResume the next iteration of the enclosing for, while, until, or\nselect loop.  If n is specified, then resume at the n-th enclos-\ning loop.\n\ndisown [ job... ]\nCauses the shell not to send a HUP signal to each given job,  or\nall  active  jobs  if  job is omitted, when a login shell termi-\nnates.\n\necho [ arg ... ]\nWhen the first arg does not begin with a -, and none of the  ar-\nguments contain a \\, then echo prints each of its arguments sep-\narated by a space and terminated by a new-line.  Otherwise,  the\nbehavior  of  echo  is  system dependent and print or printf de-\nscribed below should be used.  See echo(1)  for  usage  and  de-\nscription.\n\n<> enum [ -i  ] type[=(value ...) ]\nCreates  a declaration command named type that allows one of the\nspecified values as enumeration names.  If =(value ...) is omit-\nted,  then  type must be an indexed array variable with at least\ntwo elements and the values are taken from this array  variable.\nIf -i is specified the values are case-insensitive.  Declaration\ncommands are created as special builtins that cannot be  removed\nor overridden by shell functions.  Each created declaration com-\nmand has a --man option that shows documentation on  its  type's\nbehavior and possible values.\n\nWithin arithmetic expressions (see Arithmetic Evaluation above),\nenumeration type values translate to index numbers between 0 and\nthe  number  of  defined  values  minus 1. It is an error for an\narithmetic expression to assign a value outside of  that  range.\nDecimal fractions are ignored.\n\n<*> eval [ arg ... ]\nThe  arguments  are read as input to the shell and the resulting\ncommand(s) executed.\n\n<*> exec [ -c ] [ -a name ] [ arg ... ]\nIf arg is given, the command specified by the arguments is  exe-\ncuted  in  place  of  this shell without creating a new process.\nThe value of the SHLVL environment variable is decreased by one,\nunless  the  shell replaced is a subshell.  The -c option causes\nthe environment to be cleared before applying  variable  assign-\nments associated with the exec invocation.  The -a option causes\nname rather than the first arg, to become argv[0]  for  the  new\nprocess.   If  arg  is  not  given and only I/O redirections are\ngiven, then this command persistently modifies file  descriptors\nas in redirect.\n\n<*> exit [ n ]\nCauses  the  shell  to exit with the exit status specified by n.\nThe value will be the least significant 8 bits of n  (if  speci-\nfied)  or  of  the exit status of the last command executed.  An\nend-of-file will also cause the shell to exit, except for an in-\nteractive shell that has the ignoreeof option turned on (see set\nbelow).\n\n<*><> export [ -p ] [ name[=value] ] ...\nIf name is not given, the names and values of each variable with\nthe  export  attribute  are  printed with the values quoted in a\nmanner that allows them to be re-input.  The export  command  is\nthe  same  as  typeset -x except that if you use export within a\nfunction, no local variable is created.  The  -p  option  causes\nthe  word export to be inserted before each one.  Otherwise, the\ngiven names are marked for automatic export to  the  environment\nof subsequently-executed commands.\n\nfalse  Does nothing, and exits 1. Used with until for infinite loops.\n\nfc [ -e ename  ] [ -N num ] [ -nlr ] [ first [ last ] ]\nfc -s  [ old=new ] [ command ]\nThe same as hist.\n\nfg [ job... ]\nThis  command is only on systems that support job control.  Each\njob specified is brought to the foreground and waited for in the\nspecified order.  Otherwise, the current job is brought into the\nforeground.  See Jobs for a description of the format of job.\n\n<> float vname[=value] ...\nDeclares each vname to be a long  floating  point  number.   The\nsame as typeset -lE.\n\nfunctions [ -Stux ] [ name ... ]\nLists functions.  The same as typeset -f.\n\ngetconf [ name [ pathname ] ]\nPrints the current value of the configuration parameter given by\nname.  The configuration parameters  are  defined  by  the  IEEE\nPOSIX  1003.1 and IEEE POSIX 1003.2 standards.  (See pathconf(2)\nand sysconf(3).)  The pathname argument is required for  parame-\nters whose value depends on the location in the file system.  If\nno arguments are given, getconf prints the names and  values  of\nthe  current  configuration  parameters.  The pathname / is used\nfor each of the parameters that requires pathname.\n\ngetopts [ -a name ] optstring vname [ arg ... ]\nChecks arg for legal options.  If arg is omitted, the positional\nparameters are used.  An option argument begins with a + or a -.\nAn option not beginning with + or - or the argument -- ends  the\noptions.  Options beginning with + are only recognized when opt-\nstring begins with a +.  optstring  contains  the  letters  that\ngetopts recognizes.  If a letter is followed by a :, that option\nis expected to have an argument.  The options can  be  separated\nfrom  the  argument by blanks.  The option -?  causes getopts to\ngenerate a usage message on standard error.  The -a argument can\nbe  used to specify the name to use for the usage message, which\ndefaults to $0.\ngetopts places the next option letter it finds  inside  variable\nvname  each  time  it  is  invoked.   The  option letter will be\nprepended with a + when arg begins with a +.  The index  of  the\nnext arg is stored in OPTIND.  The option argument, if any, gets\nstored in OPTARG.\nA leading : in optstring causes getopts to store the  letter  of\nan  invalid  option in OPTARG, and to set vname to ?  for an un-\nknown option and to : when a required option argument  is  miss-\ning.  Otherwise, getopts prints an error message.  The exit sta-\ntus is non-zero when there are no more options.\nThere is no way to specify any of the options :, +, -, ?, [, and\n].  The option # can only be specified as the first option.\n\nhash [ -r ] [ utility ]\nhash  displays  or modifies the hash table with the locations of\nrecently used programs. If given no arguments, it lists all com-\nmand/path  associations  (a.k.a.  'tracked aliases') in the hash\ntable. Otherwise, hash performs a PATH search for  each  utility\nsupplied  and  adds the result to the hash table.  The -r option\nempties the hash table. This can also be achieved  by  resetting\nPATH.\n\nhist [ -e ename  ] [ -N num ] [ -nlr ] [ first [ last ] ]\nhist -s [ old=new ] [ command ]\nIn the first form, a range of commands from first to last is se-\nlected from the last HISTSIZE commands that were  typed  at  the\nterminal.   The  arguments  first and last may be specified as a\nnumber or as a string.  A string is used to locate the most  re-\ncent  command starting with the given string.  A negative number\nis used as an offset to the current command number.  If  the  -l\noption  is selected, the commands are listed on standard output.\nOtherwise, the editor program ename is invoked on  a  file  con-\ntaining these keyboard commands.  If ename is not supplied, then\nthe value of the variable HISTEDIT is used.  If HISTEDIT is  not\nset,  then FCEDIT (default /bin/ed) is used as the editor.  When\nediting is complete, the edited command(s) is  executed  if  the\nchanges have been saved.  If last is not specified, then it will\nbe set to first.  If first is not specified, the default is  the\nprevious command for editing and -16 for listing.  The option -r\nreverses the order of the commands and the option -n  suppresses\ncommand  numbers  when  listing.  In the second form, command is\ninterpreted as first described above and defaults  to  the  last\ncommand  executed.   The resulting command is executed after the\noptional substitution  old=new  is  performed.   The  option  -N\ncauses hist to start num commands back.\n\n<> integer vname[=value] ...\nDeclares  each  vname  to be a long integer number.  The same as\ntypeset -li.\n\njobs [ -lnp ] [ job ... ]\nLists information about each given job; or all  active  jobs  if\njob  is omitted.  The -l option lists process ids in addition to\nthe normal information.  The -n option only displays  jobs  that\nhave  stopped  or  exited  since  last  notified.  The -p option\ncauses only the process group to be listed.  See Jobs for a  de-\nscription of the format of job.\n\nkill [ -s signame ] job ...\nkill [ -n signum ] job ...\nkill -Ll [ sig ... ]\nSends either the TERM (terminate) signal or the specified signal\nto the specified jobs or processes.  Signals are either given by\nnumber  with  the  -n  option  or by name with the -s option (as\ngiven in <signal.h>, stripped of the prefix ``SIG'' with the ex-\nception that SIGCLD is named CHLD).  For backward compatibility,\nthe n and s can be omitted and the number or name placed immedi-\nately after the -.  If the signal being sent is TERM (terminate)\nor HUP (hangup), then the job or process will  be  sent  a  CONT\n(continue) signal if it is stopped.  The argument job can be the\nprocess id of a process that is not a member of one of  the  ac-\ntive jobs.  See Jobs for a description of the format of job.  In\nthe third form, kill -l, or kill -L, if sig  is  not  specified,\nthe signal names are listed.  The -l option list only the signal\nnames.  -L options lists each signal name and corresponding num-\nber.   Otherwise, for each sig that is a name, the corresponding\nsignal number is listed.  For each sig that  is  a  number,  the\nsignal name corresponding to the least significant 8 bits of sig\nis listed.\n\nlet arg ...\nEach arg is a separate arithmetic expression  to  be  evaluated.\nlet  only  recognizes octal numbers starting with 0 when the set\noption letoctal is on.  See Arithmetic Evaluation  above  for  a\ndescription of arithmetic expression evaluation.\nThe exit status is 0 if the value of the last expression is non-\nzero, and 1 otherwise.\n\n<> nameref vname[=refname] ...\nDeclares each vname to be a variable name reference.   The  same\nas typeset -n.\n\nprint [ -CRenprsv ] [ -u unit ] [ -f format ] [ arg ... ]\nWith  no  options or with option - or --, each arg is printed on\nstandard output.  The -f  option  causes  the  arguments  to  be\nprinted  as  described  by printf.  In this case, any e, n, r, R\noptions are ignored.  Otherwise, unless the -C, -R,  -r,  or  -v\nare specified, the following escape conventions will be applied:\n\\a     The alert character (ASCII 07).\n\\b     The backspace character (ASCII 010).\n\\c     Causes print to end without processing more arguments and\nnot adding a new-line.\n\\f     The formfeed character (ASCII 014).\n\\n     The newline character (ASCII 012).\n\\r     The carriage return character (ASCII 015).\n\\t     The tab character (ASCII 011).\n\\v     The vertical tab character (ASCII 013).\n\\E     The escape character (ASCII 033).\n\\\\     The backslash character \\.\n\\0x    The character defined by  the  1,  2,  or  3-digit  octal\nstring given by x.\n\nThe  -R  option  will print all subsequent arguments and options\nother than -n.  The -e causes the above escape conventions to be\napplied.   This is the default behavior.  It reverses the effect\nof an earlier -r.  The -p option  causes  the  arguments  to  be\nwritten  onto the pipe of the process spawned with |& instead of\nstandard output.  The -v option treats each arg  as  a  variable\nname  and  writes the value in the printf %B format.  The -C op-\ntion treats each arg as a variable name and writes the value  in\nthe printf %#B format.  The -s option causes the arguments to be\nwritten onto the history file instead of standard  output.   The\n-u  option  can  be  used to specify a one digit file descriptor\nunit number unit on which the output will be  placed.   The  de-\nfault  is  1.  If the option -n is used, no new-line is added to\nthe output.\n\nprintf [ -v vname ] format [ arg ... ]\nThe arguments arg are printed on standard output  in  accordance\nwith  the  ANSI  C  formatting  rules associated with the format\nstring format.  If the number of arguments exceeds the number of\nformat specifications, the format string is reused to format re-\nmaining arguments.  The following extensions can also be used:\n%b     A %b format can be used instead of %s to cause escape se-\nquences  in  the  corresponding arg to be expanded as de-\nscribed in print.\n%B     A %B option causes each of the arguments to be treated as\nvariable  names  and the binary value of variable will be\nprinted.  The alternate flag # causes a compound variable\nto  be  output on a single line.  This is most useful for\ncompound variables and variables whose attribute is -b.\n%H     A %H format can be used instead of %s to cause characters\nin  arg  that are special in HTML and XML to be output as\ntheir entity name.  The alternate flag # formats the out-\nput for use as a URI.\n%p     A %p format will convert the given number to hexadecimal.\n%P     A  %P format can be used instead of %s to cause arg to be\ninterpreted as an  extended  regular  expression  and  be\nprinted as a shell pattern.\n%q     A  %q  format  can be used instead of %s to cause the re-\nsulting string to be quoted in a manner than can be rein-\nput  to the shell.  When q is preceded by the alternative\nformat specifier, #, the string is quoted in manner suit-\nable as a field in a .csv format file.\n%(date-format)T\nA %(date-format)T format can be used to treat an argument\nas a date/time string and to format the date/time accord-\ning to the date-format.\n%Q     A  %Q  format will convert the given number of seconds to\nreadable time.\n%R     A %R format can be used instead of %s to cause arg to  be\ninterpreted  as  a  shell pattern and to be printed as an\nextended regular expression.\n%Z     A %Z format will output a byte whose value is 0.\n%d     The precision field of the %d format can be followed by a\n.  and the output base.  In this case, the # flag charac-\nter causes base# to be prepended.\n#      The # flag, when used with the %d format without an  out-\nput base, displays the output in powers of 1000 indicated\nby one of the following suffixes: k M G T P E,  and  when\nused  with the %i format displays the output in powers of\n1024 indicated by one of the following suffixes: Ki Mi Gi\nTi Pi Ei.\n=      The  = flag centers the output within the specified field\nwidth.\nL      The L flag, when used with the %c or %s  formats,  treats\nprecision as character width instead of byte count.\n,      The  ,  flag,  when used with the %d or %f formats, sepa-\nrates groups of digits with the grouping delimiter (,  on\ngroups of 3 in the C locale).\n\nThe  -v option assigns the output directly to a variable instead\nof\nwriting it to standard output. This is faster  than  cap-\nturing the output using a command substitution and avoids\nthe latter's stripping of final linefeed characters (\\n).\nThe  vname  argument should be a valid variable name, op-\ntionally with one or  more  array  subscripts  in  square\nbrackets.   Note that square brackets should be quoted to\navoid pathname expansion.\n\npwd [ -LP ]\nOutputs the value of the current working directory.  The -L  op-\ntion  is  the default; it prints the logical name of the current\ndirectory.  If the -P option is given, all  symbolic  links  are\nresolved  from  the  name.  The last instance of -L or -P on the\ncommand line determines which method is used.\n\nread [ -ACSprsv ] [ -d delim ] [ -n n ] [ [ -N n ] [ -t timeout ] [  -u\nunit ] [ vname?prompt ] [ vname ... ]\nThe  shell  input  mechanism.  One line is read and is broken up\ninto fields using the characters in IFS as separators.  The  es-\ncape character, \\, is used to remove any special meaning for the\nnext character and for line continuation.  The -d option  causes\nthe read to continue to the first character of delim rather than\nnew-line.  The -n option causes at most n bytes to read rather a\nfull  line  but  will  return when reading from a slow device as\nsoon as any characters have been read.  The -N option causes ex-\nactly n to be read unless an end-of-file has been encountered or\nthe read times out because of the -t option.  In raw  mode,  -r,\nthe  \\  character  is not treated specially.  The first field is\nassigned to the first vname, the  second  field  to  the  second\nvname,  etc.,  with  leftover fields assigned to the last vname.\nWhen vname has the binary attribute and -n or -N  is  specified,\nthe  bytes  that are read are stored directly into the variable.\nIf the -v is specified, then the value of the first  vname  will\nbe  used as a default value when reading from a terminal device.\nThe -A option causes the variable vname to  be  unset  and  each\nfield  that  is  read to be stored in successive elements of the\nindexed array vname.  The -C option causes the variable vname to\nbe  read  as  a  compound variable.  Blanks will be ignored when\nfinding the beginning open parenthesis.  The  -S  option  causes\nthe  line  to  be treated like a record in a .csv format file so\nthat double quotes can be used to allow the delimiter  character\nand the new-line character to appear within a field.  The -p op-\ntion causes the input line to be taken from the input pipe of  a\nprocess  spawned  by  the  shell  using |&.  If the -s option is\npresent, the input will be saved as a  command  in  the  history\nfile.  The option -u can be used to specify a one digit file de-\nscriptor unit unit to read from.  The  file  descriptor  can  be\nopened  with  the  exec  special  built-in command.  The default\nvalue of unit n is 0.  The option -t is used to specify a  time-\nout  in  seconds when reading from a terminal or pipe.  If vname\nis omitted, then REPLY is used as the default vname.  An end-of-\nfile  with the -p option causes cleanup for this process so that\nanother can be spawned.  If the first argument contains a ?, the\nremainder  of  this  word  is used as a prompt on standard error\nwhen the shell is interactive.  The exit status is 0  unless  an\nend-of-file is encountered or read has timed out.\n\n<*><> readonly [ -p ] [ vname[=value] ] ...\nIf  vname  is  not  given, the names and values of each variable\nwith the read-only attribute is printed with the  values  quoted\nin  a  manner  that  allows  them to be re-input.  The -p option\ncauses the word readonly to be inserted before each one.  Other-\nwise, the given vnames are marked read-only and these names can-\nnot be changed by subsequent assignment.   Unlike  typeset -r  ,\nreadonly  does  not  create a function-local scope and the given\nvnames are marked globally read-only by default.  When  defining\na  type, if the value of a read-only subvariable is not defined,\nthe value is required when creating each instance.\n\nredirect\nThis command only accepts  input/output  redirections.   It  can\nopen  and close files and modify file descriptors from 0 to 9 as\nspecified by the input/output  redirection  list  (see  the  In-\nput/Output  section  above), with the difference that the effect\npersists past the execution of the redirect command.   When  in-\nvoking  another  program,  file  descriptors greater than 2 that\nwere opened with this mechanism are only passed on if  they  are\nexplicitly  redirected  to  themselves as part of the invocation\n(e.g. 4>&4) or if the posix option is set.\n\n<*> return [ n ]\nCauses a shell function, dot script (see . and source), or  pro-\nfile script to return to the invoking shell environment with the\nexit status specified by n.  This status value can use the  full\nsigned  integer  range  as shown by the commands getconf INTMIN\nand getconf INTMAX. A value outside that range will  produce  a\nwarning  and  an  exit status of 128.  If n is omitted, then the\nvalue of $? is assumed, i.e., the exit status of the  last  com-\nmand executed is passed on.  If return is invoked while not in a\nfunction, dot script, or profile script,  then  it  behaves  the\nsame as exit.\n\n<*>  set [ +-BCGHabefhkmnprstuvx ] [ +-o [ option ] ] ... [ +-A vname ]\n[ arg ... ]\nThe options for this command have meaning as follows:\n-A      Array assignment.  Unset the variable vname  and  assign\nvalues  sequentially  from the arg list.  If +A is used,\nthe variable vname is not unset first.\n-B      Enable brace group expansion. On by default,  except  if\nksh is invoked as sh or rsh.\n-C      Prevents  redirection  > from truncating existing files.\nFiles that are created are opened with the OEXCL  mode.\nRequires >| to truncate a file when turned on.\n-G      Enables  recursive  pathname  expansion.   This adds the\ndouble-star pattern  to the  pathname  expansion  (see\nPathname  Expansion  above).   By itself, it matches the\nrecursive contents of the current directory, which is to\nsay,  all files and directories in the current directory\nand in all its subdirectories,  sub-subdirectories,  and\nso on.  If the pathname pattern ends in /, only direc-\ntories and subdirectories are  matched,  including  sym-\nbolic  links  that point to directories.  A prefixed di-\nrectory name is not included in the results unless  that\ndirectory  was  itself  found by a pattern. For example,\ndir/ matches the recursive contents of dir but not dir\nitself, whereas di[r]/ matches both dir itself and the\nrecursive contents of dir.  Symbolic links to non-direc-\ntories  are not followed.  Symbolic links to directories\nare followed if they are specified literally or match  a\npattern  as  described under Pathname Expansion, but not\nif they result from a double-star pattern.\n-H      Enable !-style history expansion similar to csh(1).\n-a      All subsequent variables that are defined are  automati-\ncally exported.\n-b      Prints  job  completion messages as soon as a background\njob changes state  rather  than  waiting  for  the  next\nprompt.\n-e      Unless  contained  in a || or && command, or the command\nfollowing an if while or until command or in  the  pipe-\nline  following !, if a command has a non-zero exit sta-\ntus, execute the ERR trap, if set, and exit.  This  mode\nis disabled while reading profiles.\n-f      Disables pathname expansion.\n-h      Each  command becomes a tracked alias when first encoun-\ntered.\n-k      (Obsolete). All variable assignment arguments are placed\nin  the  environment  for a command, not just those that\nprecede the command name.\n-m      Background jobs will run in a separate process group and\na  line  will print upon completion.  The exit status of\nbackground jobs is reported in a completion message.  On\nsystems with job control, this option is turned on auto-\nmatically for interactive shells.\n-n      Read commands and check them for syntax errors,  but  do\nnot execute them.  Ignored for interactive shells.\n-o      The  following  argument can be one of the following op-\ntion names:\nallexport\nSame as -a.\nbackslashctrl\nThe backslash character \\ escapes the next  con-\ntrol  character in the emacs built-in editor and\nthe next erase  or  kill  character  in  the  vi\nbuilt-in editor.  On by default.\nbgnice  All background jobs are run at a lower priority.\nThis is the default mode.\nbraceexpand\nSame as -B.\nemacs   Puts you in an emacs style  in-line  editor  for\ncommand entry.\nerrexit Same as -e.\nglobcasedetect\nWhen  this  option  is  turned on, globbing (see\nPathname Expansion above) and file name  listing\nand  completion  (see  In-line  Editing  Options\nabove) automatically become case-insensitive  on\nfile systems where the difference between upper-\nand lowercase is ignored for file names. This is\ntransparently  determined for each directory, so\na path pattern that spans multiple file  systems\ncan  be part case-sensitive and part case-insen-\nsitive.  In more precise terms, each slash-sepa-\nrated  path  name component pattern p is treated\nas ~(i:p) if its parent directory  exists  on  a\ncase-insensitive  file  system.   This option is\nonly present on operating systems  that  support\ncase-insensitive file systems.\nglobstar\nSame as -G.\ngmacs   Puts  you  in  a  gmacs style in-line editor for\ncommand entry.\nhistexpand\nSame as -H.\nignoreeof\nAn interactive shell will not  exit  on  end-of-\nfile.  The command exit must be used.\nkeyword Same as -k.\nletoctal\nThe  let  command  allows octal numbers starting\nwith 0.  On by default if ksh is invoked  as  sh\nor rsh.\nmarkdirs\nAll  directory names resulting from pathname ex-\npansion have a trailing / appended.\nmonitor Same as -m.\nmultiline\nThe built-in editors will use multiple lines  on\nthe  screen  for  lines that are longer than the\nwidth of the screen.  This may not work for  all\nterminals.\nnoclobber\nSame as -C.\nnoexec  Same as -n.\nnoglob  Same as -f.\nnolog   Obsolete; has no effect.\nnotify  Same as -b.\nnounset Same as -u.\npipefail\nA  pipeline  will  not complete until all compo-\nnents of the pipeline have  completed,  and  the\nreturn  value will be the value of the last non-\nzero command to fail or zero if no  command  has\nfailed.\nposix   Enables the POSIX standard mode for maximum com-\npatibility with other compliant shells.  At  the\nmoment  that  the  posix option is turned on, it\nalso turns on letoctal and turns off -B/braceex-\npand;  the  reverse is done when posix is turned\nback off. (These options can still be controlled\nindependently   in  between.)  Furthermore,  the\nposix option is automatically turned on upon in-\nvocation if ksh is invoked as sh or rsh. In that\ncase, or if the option is turned on by  specify-\ning -o posix on the invocation command line, the\ninvoked shell will not set  the  preset  aliases\neven  if  interactive,  and will not import type\nattributes for variables  (such  as  integer  or\nleft/right justify) from the environment.\nIn addition, while on, the posix option\no  disables  exporting  variable type attributes\nto the environment for other ksh processes to\nimport;\no  causes  file  descriptors > 2 to be left open\nwhen invoking another program;\no  disables the &> redirection shorthand;\no  makes the <> redirection operator default  to\nredirecting  standard  input  if  no file de-\nscriptor number precedes it;\no  disables the special floating point constants\nInf and NaN in arithmetic evaluation so that,\ne.g., $((inf))  and  $((nan))  refer  to  the\nvariables by those names;\no  enables  the recognition of a leading zero as\nintroducing an octal number in all arithmetic\nevaluation contexts, except in the let built-\nin while letoctal is off;\no  stops the . command  (but  not  source)  from\nlooking  up  functions defined with the func-\ntion syntax;\no  changes the test/[ built-in command  to  make\nits  deprecated  expr1  -a expr2 and expr1 -o\nexpr2 operators work even if expr1 equals \"!\"\nor  \"(\" (which means the nonstandard unary -a\nfile and -o option operators  cannot  be  di-\nrectly  negated  using ! or wrapped in paren-\ntheses); and\no  disables a hack that makes test -t ([  -t  ])\nequivalent to test -t 1 ([ -t 1 ]).\nprivileged\nSame as -p.\nshowme  When  enabled, simple commands or pipelines pre-\nceded by a semicolon (;) will be displayed as if\nthe  xtrace  option were enabled but will not be\nexecuted.  Otherwise, the leading ; will be  ig-\nnored.\ntrackall\nSame as -h.\nverbose Same as -v.\nvi      Puts  you  in  insert mode of a vi style in-line\neditor until you hit the escape  character  033.\nThis  puts  you in control mode.  A return sends\nthe line.\nviraw   Each character is processed as it is typed in vi\nmode.  The shell may have been compiled to force\nthis option on at all times.  Otherwise, canoni-\ncal processing (line-by-line input) is initially\nenabled and the  command  line  will  be  echoed\nagain  if  the speed is 1200 baud or greater and\nit contains any control characters or less  than\none  second  has  elapsed  since  the prompt was\nprinted. The ESC character terminates  canonical\nprocessing  for the remainder of the command and\nthe user can then modify the command line.  This\nscheme  has the advantages of canonical process-\ning with the type-ahead echoing of raw mode.  If\nthe  viraw  option is set, the terminal will al-\nways have canonical processing  disabled.   This\nmode is implicit for systems that do not support\ntwo alternate end of line delimiters, and may be\nhelpful for certain terminals.\nxtrace  Same as -x.\nIf  no  option name is supplied, then the current option\nsettings are printed.\n-p      Disables processing of the $HOME/.profile file and  uses\nthe  file  /etc/suidprofile  instead  of  the ENV file.\nThis mode is on whenever the effective uid (gid) is  not\nequal  to  the  real uid (gid).  Turning this off causes\nthe effective uid and gid to be set to the real uid  and\ngid.\n-r      Enables the restricted shell.  This option cannot be un-\nset once set.\n-s      Sort the positional parameters lexicographically.\n-t      (Obsolete).  Exit after reading and executing  one  com-\nmand.\n-u      Treat  unset  parameters  as an error when substituting.\n$@ and $* are exempt.\n-v      Print shell input lines as they are read.\n-x      Print commands and their arguments as they are executed.\n--      Do not change any of the options; useful in  setting  $1\nto  a  value  beginning  with -.  If no arguments follow\nthis option then the positional parameters are unset.\n\nAs an obsolete feature, if the first arg is - then the -x and -v\noptions  are turned off and the next arg is treated as the first\nargument.  Using + rather than -  causes  these  options  to  be\nturned  off.   These options can also be used upon invocation of\nthe shell.  The current set of options may be found in $-.   Un-\nless -A is specified, the remaining arguments are positional pa-\nrameters and are assigned, in order, to $1 $2 ....  If no  argu-\nments  are given, then the names and values of all variables are\nprinted on the standard output.\n\n<*> shift [ n ]\nThe positional parameters from $n+1 ...  are renamed  $1  ...  ,\ndefault  n  is 1.  The parameter n can be any arithmetic expres-\nsion that evaluates to a non-negative number less than or  equal\nto $#.\n\nsleep [ -s ] duration\nSuspends  execution  for  the number of decimal seconds or frac-\ntions of a second given by duration.  duration can be  an  inte-\nger,  floating  point  value or ISO 8601 duration specifying the\nlength of time to sleep.  The option -s causes the sleep builtin\nto  terminate  when  it receives any signal.  If duration is not\nspecified in conjunction with -s, sleep will wait for  a  signal\nindefinitely.\n\nsource name [ arg ... ]\nSame  as  ., except it is not treated as a special built-in com-\nmand.\n\nstop job ...\nSends a SIGSTOP signal to one or  more  processes  specified  by\njob,  suspending  them  until they receive SIGCONT.  The same as\nkill -s STOP.\n\nsuspend\nSends a SIGSTOP signal to the main shell process, suspending the\nscript or child shell session until it receives SIGCONT (for in-\nstance, when typing fg  in  the  parent  shell).  Equivalent  to\nkill -s STOP \"$$\",  except  that  it accepts no operands and re-\nfuses to suspend a login shell.\n\ntest expression\nThe test and [ commands execute conditional expressions  similar\nto those specified for the [[ compound command under Conditional\nExpressions above, but with several important  differences.  The\n=, == and != operators test for string (in)equality without pat-\ntern matching; == is nonstandard and unportable. The f3&& and ||\noperators are not available. Instead, the -a and -o binary oper-\nators can be used, but they are fraught  with  pitfalls  due  to\ngrammatical ambiguities and therefore deprecated in favor of in-\nvoking separate test commands. Most importantly, as test  and  [\nare simple regular commands, field splitting and pathname expan-\nsion are performed on all their arguments  and  all  aspects  of\nregular  shell grammar (such as redirection) remain active. This\nis usually harmful, so care must be taken to quote arguments and\nexpansions  to  avoid  this.  To avoid the many pitfalls arising\nfrom these issues, the [[ compound command should  be  used  in-\nstead. The primary purpose of the test and [ commands is compat-\nibility with other shells that lack [[.\n\nThe test/[ command does not parse options except  if  there  are\ntwo  arguments  and the second is --. To access the inline docu-\nmentation with an option such as --man,  you  need  one  of  the\nforms test --man -- or [ --man -- ].\n\ntimes  Displays  the  accumulated  user  and system CPU times, one line\nwith the times used by the shell and another with those used  by\nall of the shell's child processes. No options are supported.\n\n<*> trap [ -p ] [ action ] [ sig ] ...\nThe  -p  option causes the trap action associated with each trap\nas specified by the arguments to  be  printed  with  appropriate\nquoting.   Otherwise,  action will be processed as if it were an\nargument to eval when the shell receives  signal(s)  sig.   Each\nsig can be given as a number or as the name of the signal.  Trap\ncommands are executed in order of signal number.  Any attempt to\nset  a trap on a signal that was ignored on entry to the current\nshell is ineffective.  If action is omitted and the first sig is\na  number,  or if action is -, then the trap(s) for each sig are\nreset to their original values.  If action is  the  null  string\nthen  this signal is ignored by the shell and by the commands it\ninvokes.  If sig is ERR then action will be executed whenever  a\ncommand has a non-zero exit status.  If sig is DEBUG then action\nwill be executed before each command.  The variable  .sh.command\nwill contain the current command line when action is running, in\nthe same format as the output generated  by  the  xtrace  option\n(minus  the  preceding  PS4  prompt).  If the exit status of the\ntrap is 2 the command will not be executed.  If the exit  status\nof  the  trap  is 255 and inside a function or a dot script, the\nfunction or dot script will return.  If sig is 0 or EXIT and the\ntrap statement is executed inside the body of a function defined\nwith the function name syntax, then the command action  is  exe-\ncuted  after  the function completes.  If sig is 0 or EXIT for a\ntrap set outside any function then the command  action  is  exe-\ncuted on exit from the shell.  If sig is KEYBD, then action will\nbe executed whenever a key is read while in emacs, gmacs, or  vi\nmode.   The trap command with no arguments prints a list of com-\nmands associated with each signal number.\n\nAn exit or return without an argument in a trap  action  will  preserve\nthe exit status of the command that invoked the trap.\n\ntrue   Does nothing, and exits 0. Used with while for infinite loops.\n\ntype [ -afpq ] name ...\nThe same as whence -v.\n\n<*><>  typeset [ +-ACHSbflmnprstux ] [ +-EFLRXZi[n] ]   [ +-M  [ map-\nname ] ] [ -T  [ tname=(assignlist) ] ] [ -h str ] [  -a  [type]  ]  [\nvname[=value ]  ] ...\nSets  attributes  and  values for shell variables and functions.\nWhen invoked inside a function defined with  the  function  name\nsyntax, a new instance of the variable vname is created, and the\nvariable's value and type are restored when  the  function  com-\npletes.  The following list of attributes may be specified:\n-A     Declares  vname  to  be an associative array.  Subscripts\nare strings rather than arithmetic expressions.\n-C     Causes each vname to be a  compound  variable.  If  value\nnames a compound variable, it is copied into vname.  Oth-\nerwise, the empty compound value is assigned to vname.\n-a     Declares vname to be an indexed array.  If type is speci-\nfied,  it must be the name of an enumeration type created\nwith the enum command and it allows enumeration constants\nto be used as subscripts.\n-E     Declares  vname  to  be a double precision floating point\nnumber.  If n is non-zero, it defines the number of  sig-\nnificant  figures  that  are  used  when expanding vname.\nOtherwise, ten significant figures will be used.\n-F     Declares vname to be a double  precision  floating  point\nnumber.   If  n  is  non-zero,  it  defines the number of\nplaces after the decimal point that are used when expand-\ning  vname.  Otherwise ten places after the decimal point\nwill be used.\n-H     This option provides UNIX to host-name  file  mapping  on\nnon-UNIX machines.\n-L     Left  justify and remove leading blanks from value.  If n\nis non-zero, it defines the width of the field, otherwise\nit  is  determined by the width of the value of first as-\nsignment.  When the variable is assigned to, it is filled\non  the  right with blanks or truncated, if necessary, to\nfit into the field.  The -R option is turned off.\n-M     Use the character mapping mapping defined by  wctrans(3).\nsuch  as  tolower  and  toupper when assigning a value to\neach of the specified operands.  When mapping  is  speci-\nfied  and  there are not operands, all variables that use\nthis mapping are written to standard output.   When  map-\nping  is  omitted  and  there are no operands, all mapped\nvariables are written to standard output.\n-R     Right justify and fill with leading blanks.  If n is non-\nzero,  it defines the width of the field, otherwise it is\ndetermined by the width of the value of first assignment.\nThe  field  is  left filled with blanks or truncated from\nthe end if the variable is reassigned.  The -L option  is\nturned off.\n-S     When used within the assignlist of a type definition, it\ncauses the specified subvariable to be shared by all  in-\nstances of the type.  When used inside a function defined\nwith the function reserved word, the specified  variables\nwill have function static scope.  Otherwise, the variable\nis unset prior to processing the assignment list.\n-T     If followed by tname, it creates a type  named  by  tname\nusing the compound assignment assignlist to tname.  Oth-\nerwise, it writes all the type  definitions  to  standard\noutput.\n-X     Declares  vname  to  be a double precision floating point\nnumber and expands using the %a format of ISO-C99.  If  n\nis  non-zero,  it  defines the number of hex digits after\nthe radix point that is used when expanding  vname.   The\ndefault is 10.\n-Z     Right  justify  and  fill with leading zeros if the first\nnon-blank character is a digit and the -L option has  not\nbeen  set.  Remove leading zeros if the -L option is also\nset.  If n is non-zero,  it  defines  the  width  of  the\nfield,  otherwise  it  is  determined by the width of the\nvalue of first assignment.\n-f     The names refer to function names  rather  than  variable\nnames.   No  assignments  can  be made and the only other\nvalid options are -S, -t, -u and -x.  The -S can be  used\nwith  discipline  functions defined in a type to indicate\nthat the function is static.  For a static function,  the\nsame method will be used by all instances of that type no\nmatter which instance references it.  In addition, it can\nonly  use value of variables from the original type defi-\nnition.  These discipline functions cannot  be  redefined\nin  any  type instance.  The -t option turns on execution\ntracing for this function.  The  -u  option  causes  this\nfunction to be marked undefined.  The FPATH variable will\nbe searched to find  the  function  definition  when  the\nfunction  is  referenced.  If no options other than -f is\nspecified, then the function definition will be displayed\non standard output.  If +f is specified, then a line con-\ntaining the function name followed  by  a  shell  comment\ncontaining  the  line  number  and  path name of the file\nwhere this function was defined, if  any,  is  displayed.\nThe  exit  status  can  be  used to determine whether the\nfunction is defined so that typeset -f .sh.math.name will\nreturn  0 when math function name is defined and non-zero\notherwise.\n-b     The variable can hold any number of bytes of  data.   The\ndata  can be text or binary.  The value is represented by\nthe base64 encoding of the data.  If -Z  is  also  speci-\nfied, the size in bytes of the data in the buffer will be\ndetermined by the size associated with the  -Z.   If  the\nbase64  string  assigned results in more data, it will be\ntruncated.  Otherwise, it will be filled with bytes whose\nvalue  is zero.  The printf format %B can be used to out-\nput the actual data in this buffer instead of the  base64\nencoding of the data.\n-h     Used within type definitions to add information when gen-\nerating information about  the  subvariable  on  the  man\npage.   It is ignored when used outside of a type defini-\ntion.  When used with -f the  information  is  associated\nwith the corresponding discipline function.\n-i     Declares  vname  to be represented internally as integer.\nThe right hand side of an assignment is evaluated  as  an\narithmetic expression when assigning to an integer.  If n\nis non-zero, it defines the output arithmetic base,  oth-\nerwise the output base will be ten.\n-l     Used with -i, -E or -F, to indicate long integer, or long\nfloat.  Otherwise, all uppercase characters are converted\nto  lowercase.   The uppercase option, -u, is turned off.\nEquivalent to -M tolower .\n-m     moves or renames the variable.  The value is the name  of\na variable whose value will be moved to vname.  The orig-\ninal variable will be unset.  Cannot  be  used  with  any\nother options.\n-n     Declares  vname  to  be a reference to the variable whose\nname is defined by the value of variable vname.  This  is\nusually  used  to  reference a variable inside a function\nwhose name has been passed as  an  argument.   Cannot  be\nused with any other options.\n-p     The  name, attributes and values for the given vnames are\nwritten on standard output in a form that can be used  as\nshell input.  If +p is specified, then the values are not\ndisplayed.\n-r     The given vnames are marked  read-only  and  these  names\ncannot be changed by subsequent assignment.\n-s     When  given  along  with  -i,  restricts  integer size to\nshort.\n-t     Tags the variables.  Tags are user definable and have  no\nspecial meaning to the shell.\n-u     When  given  along  with  -i, specifies unsigned integer.\nOtherwise, all lowercase characters are converted to  up-\npercase.   The  lowercase  option,  -l,  is  turned  off.\nEquivalent to -M toupper .\n-x     The given vnames are marked for automatic export  to  the\nenvironment of subsequently-executed commands.  Variables\nwhose names contain a .  cannot be exported.\n\nThe -i, -F, -E, and -X options cannot be  specified  along  with\n-R, -L, or -Z.  The -b option cannot be specified along with -L,\n-u, or -l.  The -f, -m, -n, and -T options cannot  be  used  to-\ngether with any other option.\n\nUsing + rather than - causes these options to be turned off.  If\nno vname arguments are given, a list of vnames  (and  optionally\nthe values) of the variables is printed.  (Using + rather than -\nkeeps the values from being  printed.)   The  -p  option  causes\ntypeset followed by the option letters to be printed before each\nname rather than the names of the options.  If any option  other\nthan  -p  is  given,  only those variables which have all of the\ngiven options are printed.  Otherwise, the vnames and attributes\nof all variables that have attributes are printed.\n\nulimit [ -HSaMctdfxlqenupmrbiswTv ] [ limit ]\nSet  or display a resource limit.  The available resource limits\nare listed below.  Many systems do not support one  or  more  of\nthese  limits.   The  limit for a specified resource is set when\nlimit is specified.  The value of limit can be a number  in  the\nunit specified below with each resource, or the value unlimited.\nThe -H and -S options specify whether the hard limit or the soft\nlimit for the given resource is set.  A hard limit cannot be in-\ncreased once it is set.  A soft limit can be increased up to the\nvalue of the hard limit.  If neither the H nor S option is spec-\nified, the limit applies to both.  The current resource limit is\nprinted  when limit is omitted.  In this case, the soft limit is\nprinted unless H is specified.  When more than one  resource  is\nspecified,  then  the  limit name and unit is printed before the\nvalue.\n-a     Lists all of the current resource limits.\n-b     The socket buffer size in bytes.\n-c     The number of 512-byte blocks on the size of core dumps.\n-d     The number of K-bytes on the size of the data area.\n-e     The scheduling priority.\n-f     The number of 512-byte blocks on files that can be  writ-\nten  by  the current process or by child processes (files\nof any size may be read).\n-i     The signal queue size.\n-l     The locked address space in K-bytes.\n-M     The address space limit in K-bytes.\n-m     The number of K-bytes on the size of physical memory.\n-n     The number of file descriptors plus 1.\n-p     The number of 512-byte blocks for pipe buffering.\n-q     The message queue size in K-bytes.\n-r     The max real-time priority.\n-s     The number of K-bytes on the size of the stack area.\n-T     The number of threads.\n-t     The number of CPU seconds to be used by each process.\n-u     The number of processes.\n-v     The number of K-bytes for virtual memory.\n-w     The swap size in K-bytes.\n-x     The number of file locks.\n\nIf no option is given, -f is assumed.\n\numask [ -S ] [ mask ]\nThe user file-creation mask is set to mask (see umask(2)).  mask\ncan  either  be an octal number or a symbolic value as described\nin chmod(1).  If a symbolic value is given, the new umask  value\nis  the complement of the result of applying mask to the comple-\nment of the previous umask value.  If mask is omitted, the  cur-\nrent  value  of  the  mask is printed.  The -S option causes the\nmode to be printed as a symbolic value.  Otherwise, the mask  is\nprinted in octal.\n\nunalias [ -a ] name ...\nThe  aliases  given  by  the  list of names are removed from the\nalias list.  The -a option causes all the aliases to be unset.\n\n<*> unset [ -fnv ] vname ...\nThe variables given by the list of vnames are unassigned,  i.e.,\nexcept  for  subvariables  within  a  type, their values and at-\ntributes are erased.  For subvariables of a type, the values are\nreset  to  the default value from the type definition.  Readonly\nvariables cannot be unset.  If the -f option is  set,  then  the\nnames  refer  to  function names.  If the -v option is set, then\nthe names refer to variable names.  The -f option overrides  -v.\nIf -n is set and name is a name reference, then name will be un-\nset rather than the variable that it references.  The default is\nequivalent  to -v.  Unsetting LINENO, MAILCHECK, OPTARG, OPTIND,\nRANDOM, SECONDS, TMOUT, and  removes their special meaning even\nif they are subsequently assigned to.\n\nwait [ job ... ]\nWait  for  the  specified job and report its termination status.\nIf job is not given, then all currently active  child  processes\nare  waited  for.   The exit status from this command is that of\nthe last process waited for if job is specified; otherwise it is\nzero.  See Jobs for a description of the format of job.\n\nwhence [ -afpqv ] name ...\nFor each name, indicate how it would be interpreted if used as a\ncommand name.\nThe -v option produces a more verbose  report.   The  -f  option\nskips  the  search  for  functions.   The  -p option does a path\nsearch for name even if name is an alias, a function, or  a  re-\nserved word.  The -p option turns off the -v option.  The -q op-\ntion causes whence to enter quiet mode.  whence will return zero\nif all arguments are built-ins, functions, or are programs found\non the path.  The -a option is similar  to  the  -v  option  but\ncauses all interpretations of the given name to be reported.\n\nInvocation.\nIf  the shell is invoked by exec(2), initialization depends on argument\nzero ($0) as follows.  If the first character of $0 is -, or the -l op-\ntion is given on the invocation command line, then the shell is assumed\nto be a login shell.  If the basename of the command path in $0 is rsh,\nrksh,  or  krsh, then the shell becomes restricted.  If the basename is\nsh or rsh, or the -o posix option is given on  the  invocation  command\nline,  then the shell is initialized in full POSIX compliance mode (see\nthe set builtin command above for more information).   After  this,  if\nthe  shell  was  assumed  to  be  a login shell, commands are read from\n/etc/profile and then from $HOME/.profile if it exists.  Alternatively,\nthe  option  -l causes the shell to be treated as a login shell.  Next,\nfor interactive shells, commands are read from the file named by ENV if\nthe  file exists, its name being determined by performing parameter ex-\npansion, command substitution, and arithmetic expansion on the value of\nthat environment variable.  If the -s option is not present and arg and\na file by the name of arg exists,  then  it  reads  and  executes  this\nscript.   Otherwise,  if  the  first  arg  does not contain a /, a path\nsearch is performed on the first arg  to  determine  the  name  of  the\nscript to execute.  The script arg must have execute permission and any\nsetuid and setgid settings will be ignored.  If the script is not found\non  the  path,  arg  is  processed as if it named a built-in command or\nfunction.  Commands are then read as described below; the following op-\ntions are interpreted by the shell when it is invoked:\n\n-D      A  list  of  all double quoted strings that are preceded by a $\nwill be printed on standard output and  the  shell  will  exit.\nThis  set  of  strings  will be subject to language translation\nwhen the locale is not C or POSIX.  No commands  will  be  exe-\ncuted.\n\n-E or -o rc or --rc\nRead  the  file named by the ENV variable or by $HOME/.kshrc if\nnot defined after the profiles.  On by default for  interactive\nshells. Use +E, +o rc or --norc to turn off.\n\n-c      Read and execute a script from the first arg instead of a file.\nThe second arg, if present, becomes that script's command  name\n($0).   Any third and further args become positional parameters\nstarting at $1.\n\n-s      Read and execute a script from  standard  input  instead  of  a\nfile.   The  command  name ($0) cannot be set.  Any args become\nthe positional parameters  starting  at  $1.   This  option  is\nforced on if no arg is given and is ignored if -c is also spec-\nified.\n\n-i or -o interactive or --interactive\nIf the -i option is present or if the  shell's  standard  input\nand standard error are attached to a terminal (as told by tcge-\ntattr(3)), then this shell is interactive.  In this  case  TERM\nis  ignored (so that kill 0 does not kill an interactive shell)\nand INTR is caught and ignored (so that wait is interruptible).\nIn all cases, QUIT is ignored by the shell.\n\n-r or -o restricted or --restricted\nIf the -r option is present, the shell is a restricted shell.\n\nThe remaining options and arguments are described under the set command\nabove.  An optional - as the first argument is ignored.\n\nRksh Only.\nRksh is used to set up login names and execution environments whose ca-\npabilities  are  more controlled than those of the standard shell.  The\nactions of rksh are identical to those of ksh, except that the  follow-\ning are disallowed:\nunsetting the restricted option,\nchanging directory (see cd(1)),\nsetting  or  unsetting  the  value  or attributes of SHELL, ENV,\nFPATH, or PATH,\nspecifying path or command names containing /,\nredirecting output (>, >|, <>, and >>),\nadding or deleting built-in commands,\nusing command -p to invoke a command.\n\nThe restrictions above are enforced after .profile and  the  ENV  files\nare interpreted.\n\nWhen  a  command  to be executed is found to be a shell procedure, rksh\ninvokes ksh to execute it.  Thus, it is possible to provide to the end-\nuser  shell  procedures that have access to the full power of the stan-\ndard shell, while imposing a limited menu of commands; this scheme  as-\nsumes  that the end-user does not have write and execute permissions in\nthe same directory.\n\nThe net effect of these rules is that the writer of  the  .profile  has\ncomplete  control over user actions, by performing guaranteed setup ac-\ntions and leaving the user in an appropriate  directory  (probably  not\nthe login directory).\n\nThe  system  administrator often sets up a directory of commands (e.g.,\n/usr/rbin) that can be safely invoked by rksh.\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "Errors detected by the shell, such as syntax errors, cause the shell to\nreturn a non-zero exit status.  If the shell is being used non-interac-\ntively, then execution of the shell file is abandoned unless the  error\noccurs inside a subshell in which case the subshell is abandoned.  Oth-\nerwise, the shell returns the exit status of the last command  executed\n(see  also  the  exit  command above).  Run time errors detected by the\nshell are reported by printing the command or function name and the er-\nror  condition.   If  the  line  number  that  the error occurred on is\ngreater than one, then the line number is also printed in square brack-\nets ([]) after the command or function name.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/profile\nThe system wide initialization file, executed for login shells.\n\n$HOME/.profile\nThe  personal initialization file, executed for login shells af-\nter /etc/profile.\n\n$HOME/.kshrc\nDefault personal initialization file, executed  for  interactive\nshells when ENV is not set.\n\n/etc/suidprofile\nAlternative  initialization  file,  executed instead of the per-\nsonal initialization file when the real and  effective  user  or\ngroup id do not match.\n\n/dev/null\nNULL device\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "cat(1),  cd(1), chmod(1), cut(1), date(1), egrep(1), echo(1), emacs(1),\nenv(1), fgrep(1), gmacs(1), grep(1), stty(1), test(1), umask(1), vi(1),\ndup(2),  exec(2),  fork(2),  getpwnam(3), ioctl(2), lseek(2), paste(1),\npathconf(2), pipe(2), sysconf(3), umask(2), ulimit(2),  wait(2),  strf-\ntime(3), wctrans(3), rand(3), profile(5), environ(7).\n\nMorris  I. Bolsky and David G. Korn, The New KornShell Command and Pro-\ngramming Language, Prentice Hall, 1995.\n\nPOSIX - Part 2: Shell and  Utilities,  IEEE  Std  1003.2-1992,  ISO/IEC\n9945-2, IEEE, 1993.\n",
            "subsections": []
        },
        "CAVEATS": {
            "content": "If  a command is executed, and then a command with the same name is in-\nstalled in a directory in the search path before  the  directory  where\nthe  original  command  was  found, the shell will continue to exec the\noriginal command.  Use the hash command or the -t option of  the  alias\ncommand to correct this situation.\n\nSome very old shell scripts contain a ^ as a synonym for the pipe char-\nacter |.\n\nUsing the hist built-in command within a compound  command  will  cause\nthe whole command to disappear from the history file.\n\nThe  built-in  command  . file reads the whole file before any commands\nare executed.  Therefore, alias and unalias commands in the  file  will\nnot apply to any commands defined in the file.\n\nTraps  are  not  processed  while  a  job  is  waiting for a foreground\nprocess.  Thus, a trap on CHLD won't be executed until  the  foreground\njob terminates.\n\nIt  is  a good idea to leave a space after the comma operator in arith-\nmetic expressions to prevent the comma from being  interpreted  as  the\ndecimal point character in certain locales.\n\nKSH(1)",
            "subsections": []
        }
    },
    "summary": "ksh,  rksh  -  KornShell, a standard/restricted command and programming language",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "cat",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/cat/1/json"
        },
        {
            "name": "cd",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/cd/1/json"
        },
        {
            "name": "chmod",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/chmod/1/json"
        },
        {
            "name": "cut",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/cut/1/json"
        },
        {
            "name": "date",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/date/1/json"
        },
        {
            "name": "egrep",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/egrep/1/json"
        },
        {
            "name": "echo",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/echo/1/json"
        },
        {
            "name": "emacs",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/emacs/1/json"
        },
        {
            "name": "env",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/env/1/json"
        },
        {
            "name": "fgrep",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/fgrep/1/json"
        },
        {
            "name": "gmacs",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/gmacs/1/json"
        },
        {
            "name": "grep",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/grep/1/json"
        },
        {
            "name": "stty",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/stty/1/json"
        },
        {
            "name": "test",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/test/1/json"
        },
        {
            "name": "umask",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/umask/1/json"
        },
        {
            "name": "vi",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/vi/1/json"
        },
        {
            "name": "dup",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/dup/2/json"
        },
        {
            "name": "exec",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/exec/2/json"
        },
        {
            "name": "fork",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fork/2/json"
        },
        {
            "name": "getpwnam",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/getpwnam/3/json"
        },
        {
            "name": "ioctl",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/ioctl/2/json"
        },
        {
            "name": "lseek",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/lseek/2/json"
        },
        {
            "name": "paste",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/paste/1/json"
        },
        {
            "name": "pathconf",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/pathconf/2/json"
        },
        {
            "name": "pipe",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/pipe/2/json"
        },
        {
            "name": "sysconf",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/sysconf/3/json"
        },
        {
            "name": "umask",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/umask/2/json"
        },
        {
            "name": "ulimit",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/ulimit/2/json"
        },
        {
            "name": "wait",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/wait/2/json"
        },
        {
            "name": "time",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/time/3/json"
        },
        {
            "name": "wctrans",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/wctrans/3/json"
        },
        {
            "name": "rand",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/rand/3/json"
        },
        {
            "name": "profile",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/profile/5/json"
        },
        {
            "name": "environ",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/environ/7/json"
        }
    ]
}