{
    "content": [
        {
            "type": "text",
            "text": "# bash-builtins (man)\n\n## NAME\n\nbash-builtins - bash built-in commands, see bash(1)\n\n## SYNOPSIS\n\nbash defines the following built-in commands: :, ., [, alias, bg, bind, break, builtin, case,\ncd, command, compgen, complete, continue, declare, dirs, disown, echo,  enable,  eval,  exec,\nexit, export, fc, fg, getopts, hash, help, history, if, jobs, kill, let, local, logout, popd,\nprintf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test,  times,\ntrap, type, typeset, ulimit, umask, unalias, unset, until, wait, while.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **BASH BUILTIN COMMANDS** (2 subsections)\n- **SHELL COMPATIBILITY MODE** (8 subsections)\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "bash-builtins",
        "section": "",
        "mode": "man",
        "summary": "bash-builtins - bash built-in commands, see bash(1)",
        "synopsis": "bash defines the following built-in commands: :, ., [, alias, bg, bind, break, builtin, case,\ncd, command, compgen, complete, continue, declare, dirs, disown, echo,  enable,  eval,  exec,\nexit, export, fc, fg, getopts, hash, help, history, if, jobs, kill, let, local, logout, popd,\nprintf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test,  times,\ntrap, type, typeset, ulimit, umask, unalias, unset, until, wait, while.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "bash",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/bash/1/json"
            },
            {
                "name": "sh",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/sh/1/json"
            },
            {
                "name": "BASH-BUILTINS",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/BASH-BUILTINS/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "BASH BUILTIN COMMANDS",
                "lines": 460,
                "subsections": [
                    {
                        "name": "export -p",
                        "lines": 110
                    },
                    {
                        "name": "history -c",
                        "lines": 930
                    }
                ]
            },
            {
                "name": "SHELL COMPATIBILITY MODE",
                "lines": 36,
                "subsections": [
                    {
                        "name": "compat31",
                        "lines": 3
                    },
                    {
                        "name": "compat32",
                        "lines": 5
                    },
                    {
                        "name": "compat40",
                        "lines": 5
                    },
                    {
                        "name": "compat41",
                        "lines": 7
                    },
                    {
                        "name": "compat42",
                        "lines": 8
                    },
                    {
                        "name": "compat43",
                        "lines": 10
                    },
                    {
                        "name": "compat44",
                        "lines": 10
                    },
                    {
                        "name": "compat50",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "bash-builtins - bash built-in commands, see bash(1)\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "bash defines the following built-in commands: :, ., [, alias, bg, bind, break, builtin, case,\ncd, command, compgen, complete, continue, declare, dirs, disown, echo,  enable,  eval,  exec,\nexit, export, fc, fg, getopts, hash, help, history, if, jobs, kill, let, local, logout, popd,\nprintf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test,  times,\ntrap, type, typeset, ulimit, umask, unalias, unset, until, wait, while.\n",
                "subsections": []
            },
            "BASH BUILTIN COMMANDS": {
                "content": "Unless  otherwise noted, each builtin command documented in this section as accepting options\npreceded by - accepts -- to signify the end of the options.  The :, true, false,  and  test/[\nbuiltins  do  not  accept  options  and do not treat -- specially.  The exit, logout, return,\nbreak, continue, let, and shift builtins accept and process arguments beginning with -  with‐\nout  requiring  --.   Other builtins that accept arguments but are not specified as accepting\noptions interpret arguments beginning with - as invalid options and  require  --  to  prevent\nthis interpretation.\n: [arguments]\nNo  effect;  the  command  does  nothing beyond expanding arguments and performing any\nspecified redirections.  The return status is zero.\n\n.  filename [arguments]\nsource filename [arguments]\nRead and execute commands from filename in the current shell  environment  and  return\nthe exit status of the last command executed from filename.  If filename does not con‐\ntain a slash, filenames in PATH are used to find the  directory  containing  filename.\nThe file searched for in PATH need not be executable.  When bash is not in posix mode,\nthe current directory is searched if no file is found in PATH.  If the sourcepath  op‐\ntion to the shopt builtin command is turned off, the PATH is not searched.  If any ar‐\nguments are supplied, they become the positional parameters when filename is executed.\nOtherwise  the  positional  parameters  are  unchanged.   If the -T option is enabled,\nsource inherits any trap on DEBUG; if it is not, any DEBUG trap string  is  saved  and\nrestored  around  the  call  to source, and source unsets the DEBUG trap while it exe‐\ncutes.  If -T is not set, and the sourced file changes the DEBUG trap, the  new  value\nis  retained  when source completes.  The return status is the status of the last com‐\nmand exited within the script (0 if no commands are executed), and false  if  filename\nis not found or cannot be read.\n\nalias [-p] [name[=value] ...]\nAlias  with  no arguments or with the -p option prints the list of aliases in the form\nalias name=value on standard output.  When arguments are supplied, an alias is defined\nfor each name whose value is given.  A trailing space in value causes the next word to\nbe checked for alias substitution when the alias is expanded.  For each  name  in  the\nargument  list  for  which  no  value  is supplied, the name and value of the alias is\nprinted.  Alias returns true unless a name is given for which no alias  has  been  de‐\nfined.\n\nbg [jobspec ...]\nResume each suspended job jobspec in the background, as if it had been started with &.\nIf jobspec is not present, the shell's notion of the current job is used.  bg  jobspec\nreturns  0  unless  run when job control is disabled or, when run with job control en‐\nabled, any specified jobspec was not found or was started without job control.\n\nbind [-m keymap] [-lpsvPSVX]\nbind [-m keymap] [-q function] [-u function] [-r keyseq]\nbind [-m keymap] -f filename\nbind [-m keymap] -x keyseq:shell-command\nbind [-m keymap] keyseq:function-name\nbind [-m keymap] keyseq:readline-command\nDisplay current readline key and function bindings, bind a key sequence to a  readline\nfunction  or macro, or set a readline variable.  Each non-option argument is a command\nas it would appear in .inputrc, but each binding or command must be passed as a  sepa‐\nrate  argument; e.g., '\"\\C-x\\C-r\": re-read-init-file'.  Options, if supplied, have the\nfollowing meanings:\n-m keymap\nUse keymap as the keymap to be affected by the subsequent bindings.  Acceptable\nkeymap  names  are  emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,\nvi-command, and vi-insert.  vi is equivalent to vi-command (vi-move is  also  a\nsynonym); emacs is equivalent to emacs-standard.\n-l     List the names of all readline functions.\n-p     Display readline function names and bindings in such a way that they can be re-\nread.\n-P     List current readline function names and bindings.\n-s     Display readline key sequences bound to macros and the strings they  output  in\nsuch a way that they can be re-read.\n-S     Display readline key sequences bound to macros and the strings they output.\n-v     Display  readline  variable names and values in such a way that they can be re-\nread.\n-V     List current readline variable names and values.\n-f filename\nRead key bindings from filename.\n-q function\nQuery about which keys invoke the named function.\n-u function\nUnbind all keys bound to the named function.\n-r keyseq\nRemove any current binding for keyseq.\n-x keyseq:shell-command\nCause shell-command to be executed whenever keyseq is entered.  When shell-com‐\nmand  is executed, the shell sets the READLINELINE variable to the contents of\nthe readline line buffer and the READLINEPOINT and READLINEMARK variables  to\nthe  current location of the insertion point and the saved insertion point (the\nmark), respectively.  If the executed command changes the value of any of READ‐‐\nLINELINE, READLINEPOINT, or READLINEMARK, those new values will be reflected\nin the editing state.\n-X     List all key sequences bound to shell commands and the associated commands in a\nformat that can be reused as input.\n\nThe return value is 0 unless an unrecognized option is given or an error occurred.\n\nbreak [n]\nExit from within a for, while, until, or select loop.  If n is specified, break n lev‐\nels.  n must be ≥ 1.  If n is greater than the number of enclosing loops, all  enclos‐\ning  loops are exited.  The return value is 0 unless n is not greater than or equal to\n1.\n\nbuiltin shell-builtin [arguments]\nExecute the specified shell builtin, passing it arguments, and return its exit status.\nThis is useful when defining a function whose name is the same as a shell builtin, re‐\ntaining the functionality of the builtin within the function.  The cd builtin is  com‐\nmonly  redefined this way.  The return status is false if shell-builtin is not a shell\nbuiltin command.\n\ncaller [expr]\nReturns the context of any active subroutine call (a shell function or a  script  exe‐\ncuted  with  the . or source builtins).  Without expr, caller displays the line number\nand source filename of the current subroutine call.  If a non-negative integer is sup‐\nplied  as expr, caller displays the line number, subroutine name, and source file cor‐\nresponding to that position in the current execution call stack.  This extra  informa‐\ntion  may be used, for example, to print a stack trace.  The current frame is frame 0.\nThe return value is 0 unless the shell is not executing a subroutine call or expr does\nnot correspond to a valid position in the call stack.\n\ncd [-L|[-P [-e]] [-@]] [dir]\nChange  the  current  directory to dir.  if dir is not supplied, the value of the HOME\nshell variable is the default.  Any additional arguments following  dir  are  ignored.\nThe variable CDPATH defines the search path for the directory containing dir: each di‐\nrectory name in CDPATH is searched for dir.  Alternative directory names in CDPATH are\nseparated  by a colon (:).  A null directory name in CDPATH is the same as the current\ndirectory, i.e., ``.''.  If dir begins with a slash (/), then CDPATH is not used.  The\n-P  option  causes  cd  to  use the physical directory structure by resolving symbolic\nlinks while traversing dir and before processing instances of .. in dir (see also  the\n-P  option to the set builtin command); the -L option forces symbolic links to be fol‐\nlowed by resolving the link after processing instances of .. in dir.  If .. appears in\ndir, it is processed by removing the immediately previous pathname component from dir,\nback to a slash or the beginning of dir.  If the -e option is supplied  with  -P,  and\nthe current working directory cannot be successfully determined after a successful di‐\nrectory change, cd will return an unsuccessful status.  On systems  that  support  it,\nthe  -@ option presents the extended attributes associated with a file as a directory.\nAn argument of - is converted to $OLDPWD before the directory change is attempted.  If\na non-empty directory name from CDPATH is used, or if - is the first argument, and the\ndirectory change is successful, the absolute pathname of the new working directory  is\nwritten  to  the  standard output.  The return value is true if the directory was suc‐\ncessfully changed; false otherwise.\n\ncommand [-pVv] command [arg ...]\nRun command with args suppressing the normal shell function lookup.  Only builtin com‐\nmands  or  commands  found  in  the PATH are executed.  If the -p option is given, the\nsearch for command is performed using a default value for PATH that is  guaranteed  to\nfind  all of the standard utilities.  If either the -V or -v option is supplied, a de‐\nscription of command is printed.  The -v option causes a single  word  indicating  the\ncommand  or  filename used to invoke command to be displayed; the -V option produces a\nmore verbose description.  If the -V or -v option is supplied, the exit status is 0 if\ncommand  was found, and 1 if not.  If neither option is supplied and an error occurred\nor command cannot be found, the exit status is 127.  Otherwise, the exit status of the\ncommand builtin is the exit status of command.\n\ncompgen [option] [word]\nGenerate  possible  completion matches for word according to the options, which may be\nany option accepted by the complete builtin with the exception of -p and -r, and write\nthe  matches  to  the  standard  output.  When using the -F or -C options, the various\nshell variables set by the programmable completion facilities, while  available,  will\nnot have useful values.\n\nThe  matches  will be generated in the same way as if the programmable completion code\nhad generated them directly from a completion specification with the same  flags.   If\nword is specified, only those completions matching word will be displayed.\n\nThe return value is true unless an invalid option is supplied, or no matches were gen‐\nerated.\n\ncomplete [-abcdefgjksuv] [-o comp-option] [-DEI] [-A action] [-G globpat] [-W wordlist]\n[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] name [name ...]\ncomplete -pr [-DEI] [name ...]\nSpecify how arguments to each name should be completed.  If the -p option is supplied,\nor if no options are supplied, existing completion specifications are printed in a way\nthat allows them to be reused as input.  The -r option removes a completion specifica‐\ntion  for each name, or, if no names are supplied, all completion specifications.  The\n-D option indicates that other supplied options and actions should apply to the  ``de‐\nfault''  command  completion;  that is, completion attempted on a command for which no\ncompletion has previously been defined.  The -E option indicates that  other  supplied\noptions  and actions should apply to ``empty'' command completion; that is, completion\nattempted on a blank line.  The -I option indicates that other  supplied  options  and\nactions  should apply to completion on the initial non-assignment word on the line, or\nafter a command delimiter such as ; or |, which is usually  command  name  completion.\nIf  multiple  options  are  supplied, the -D option takes precedence over -E, and both\ntake precedence over -I.  If any of -D, -E, or -I are supplied, any other  name  argu‐\nments are ignored; these completions only apply to the case specified by the option.\n\nThe  process  of  applying these completion specifications when word completion is at‐\ntempted is described above under Programmable Completion.\n\nOther options, if specified, have the following meanings.  The arguments  to  the  -G,\n-W, and -X options (and, if necessary, the -P and -S options) should be quoted to pro‐\ntect them from expansion before the complete builtin is invoked.\n-o comp-option\nThe comp-option controls several aspects of the compspec's behavior beyond the\nsimple generation of completions.  comp-option may be one of:\nbashdefault\nPerform  the rest of the default bash completions if the compspec gen‐\nerates no matches.\ndefault Use readline's default filename completion if the  compspec  generates\nno matches.\ndirnames\nPerform  directory  name  completion  if  the  compspec  generates  no\nmatches.\nfilenames\nTell readline that the compspec generates filenames, so it can perform\nany  filename-specific  processing  (like  adding a slash to directory\nnames, quoting special characters, or  suppressing  trailing  spaces).\nIntended to be used with shell functions.\nnoquote Tell  readline  not to quote the completed words if they are filenames\n(quoting filenames is the default).\nnosort  Tell readline not to sort the list of possible completions  alphabeti‐\ncally.\nnospace Tell  readline  not to append a space (the default) to words completed\nat the end of the line.\nplusdirs\nAfter any matches defined by the  compspec  are  generated,  directory\nname  completion is attempted and any matches are added to the results\nof the other actions.\n-A action\nThe action may be one of the following to generate a list of possible  comple‐\ntions:\nalias   Alias names.  May also be specified as -a.\narrayvar\nArray variable names.\nbinding Readline key binding names.\nbuiltin Names of shell builtin commands.  May also be specified as -b.\ncommand Command names.  May also be specified as -c.\ndirectory\nDirectory names.  May also be specified as -d.\ndisabled\nNames of disabled shell builtins.\nenabled Names of enabled shell builtins.\nexport  Names of exported shell variables.  May also be specified as -e.\nfile    File names.  May also be specified as -f.\nfunction\nNames of shell functions.\ngroup   Group names.  May also be specified as -g.\nhelptopic\nHelp topics as accepted by the help builtin.\nhostname\nHostnames,  as  taken  from  the  file specified by the HOSTFILE shell\nvariable.\njob     Job names, if job control is active.  May also be specified as -j.\nkeyword Shell reserved words.  May also be specified as -k.\nrunning Names of running jobs, if job control is active.\nservice Service names.  May also be specified as -s.\nsetopt  Valid arguments for the -o option to the set builtin.\nshopt   Shell option names as accepted by the shopt builtin.\nsignal  Signal names.\nstopped Names of stopped jobs, if job control is active.\nuser    User names.  May also be specified as -u.\nvariable\nNames of all shell variables.  May also be specified as -v.\n-C command\ncommand is executed in a subshell environment, and its output is used  as  the\npossible completions.\n-F function\nThe  shell  function  function  is  executed in the current shell environment.\nWhen the function is executed, the first argument ($1) is the name of the com‐\nmand whose arguments are being completed, the second argument ($2) is the word\nbeing completed, and the third argument ($3) is the word  preceding  the  word\nbeing  completed  on the current command line.  When it finishes, the possible\ncompletions are retrieved from the value of the COMPREPLY array variable.\n-G globpat\nThe pathname expansion pattern globpat is expanded to  generate  the  possible\ncompletions.\n-P prefix\nprefix  is  added at the beginning of each possible completion after all other\noptions have been applied.\n-S suffix\nsuffix is appended to each possible completion after all  other  options  have\nbeen applied.\n-W wordlist\nThe  wordlist is split using the characters in the IFS special variable as de‐\nlimiters, and each resultant word  is  expanded.   Shell  quoting  is  honored\nwithin  wordlist,  in  order  to  provide a mechanism for the words to contain\nshell metacharacters or characters in the value of IFS.  The possible  comple‐\ntions  are  the  members of the resultant list which match the word being com‐\npleted.\n-X filterpat\nfilterpat is a pattern as used for pathname expansion.  It is applied  to  the\nlist of possible completions generated by the preceding options and arguments,\nand each completion matching filterpat is removed from the list.  A leading  !\nin  filterpat  negates  the pattern; in this case, any completion not matching\nfilterpat is removed.\n\nThe return value is true unless an invalid option is supplied, an option other than -p\nor  -r  is supplied without a name argument, an attempt is made to remove a completion\nspecification for a name for which no specification exists, or an error occurs  adding\na completion specification.\n\ncompopt [-o option] [-DEI] [+o option] [name]\nModify  completion  options  for  each  name according to the options, or for the cur‐\nrently-executing completion if no names are supplied.  If no options are  given,  dis‐\nplay  the  completion  options  for each name or the current completion.  The possible\nvalues of option are those valid for the complete builtin described above.  The -D op‐\ntion  indicates  that  other  supplied options should apply to the ``default'' command\ncompletion; that is, completion attempted on a command for  which  no  completion  has\npreviously  been  defined.  The -E option indicates that other supplied options should\napply to ``empty'' command completion; that is, completion attempted on a blank  line.\nThe  -I option indicates that other supplied options should apply to completion on the\ninitial non-assignment word on the line, or after a command delimiter such as ; or  |,\nwhich is usually command name completion.\n\nThe  return  value is true unless an invalid option is supplied, an attempt is made to\nmodify the options for a name for which no completion specification exists, or an out‐\nput error occurs.\n\ncontinue [n]\nResume the next iteration of the enclosing for, while, until, or select loop.  If n is\nspecified, resume at the nth enclosing loop.  n must be ≥ 1.  If n is greater than the\nnumber  of  enclosing  loops,  the last enclosing loop (the ``top-level'' loop) is re‐\nsumed.  The return value is 0 unless n is not greater than or equal to 1.\n\ndeclare [-aAfFgiIlnrtux] [-p] [name[=value] ...]\ntypeset [-aAfFgiIlnrtux] [-p] [name[=value] ...]\nDeclare variables and/or give them attributes.  If no names are given then display the\nvalues  of  variables.   The  -p option will display the attributes and values of each\nname.  When -p is used with name arguments, additional options, other than -f and  -F,\nare  ignored.   When  -p  is  supplied without name arguments, it will display the at‐\ntributes and values of all variables having the attributes specified by the additional\noptions.   If  no  other  options  are  supplied with -p, declare will display the at‐\ntributes and values of all shell variables.  The -f option will restrict  the  display\nto  shell functions.  The -F option inhibits the display of function definitions; only\nthe function name and attributes are printed.  If the extdebug shell option is enabled\nusing  shopt, the source file name and line number where each name is defined are dis‐\nplayed as well.  The -F option implies -f.  The -g option forces variables to be  cre‐\nated  or  modified at the global scope, even when declare is executed in a shell func‐\ntion.  It is ignored in all other cases.  The -I option causes local variables to  in‐\nherit the attributes (except the nameref attribute) and value of any existing variable\nwith the same name at a surrounding scope.  If there is no existing variable, the  lo‐\ncal variable is initially unset.  The following options can be used to restrict output\nto variables with the specified attribute or to give variables attributes:\n-a     Each name is an indexed array variable (see Arrays above).\n-A     Each name is an associative array variable (see Arrays above).\n-f     Use function names only.\n-i     The variable is treated as an integer; arithmetic  evaluation  (see  ARITHMETIC\nEVALUATION above) is performed when the variable is assigned a value.\n-l     When  the variable is assigned a value, all upper-case characters are converted\nto lower-case.  The upper-case attribute is disabled.\n-n     Give each name the nameref attribute, making it a  name  reference  to  another\nvariable.   That  other  variable  is defined by the value of name.  All refer‐\nences, assignments, and attribute modifications to name, except those using  or\nchanging  the  -n attribute itself, are performed on the variable referenced by\nname's value.  The nameref attribute cannot be applied to array variables.\n-r     Make names readonly.  These names cannot then be assigned values by  subsequent\nassignment statements or unset.\n-t     Give each name the trace attribute.  Traced functions inherit the DEBUG and RE‐‐\nTURN traps from the calling shell.  The trace attribute has no special  meaning\nfor variables.\n-u     When  the variable is assigned a value, all lower-case characters are converted\nto upper-case.  The lower-case attribute is disabled.\n-x     Mark names for export to subsequent commands via the environment.\n\nUsing `+' instead of `-' turns off the attribute instead, with the exceptions that  +a\nand  +A may not be used to destroy array variables and +r will not remove the readonly\nattribute.  When used in a function, declare and typeset make each name local, as with\nthe  local  command, unless the -g option is supplied.  If a variable name is followed\nby =value, the value of the variable is set to value.  When using -a  or  -A  and  the\ncompound  assignment  syntax  to  create array variables, additional attributes do not\ntake effect until subsequent assignments.  The return value is 0 unless an invalid op‐\ntion  is encountered, an attempt is made to define a function using ``-f foo=bar'', an\nattempt is made to assign a value to a readonly variable, an attempt is made to assign\na  value to an array variable without using the compound assignment syntax (see Arrays\nabove), one of the names is not a valid shell variable name, an  attempt  is  made  to\nturn off readonly status for a readonly variable, an attempt is made to turn off array\nstatus for an array variable, or an attempt is made to display a non-existent function\nwith -f.\n\ndirs [-clpv] [+n] [-n]\nWithout  options,  displays the list of currently remembered directories.  The default\ndisplay is on a single line with directory names separated by spaces.  Directories are\nadded  to  the  list with the pushd command; the popd command removes entries from the\nlist.  The current directory is always the first directory in the stack.\n-c     Clears the directory stack by deleting all of the entries.\n-l     Produces a listing using full pathnames; the  default  listing  format  uses  a\ntilde to denote the home directory.\n-p     Print the directory stack with one entry per line.\n-v     Print  the  directory  stack with one entry per line, prefixing each entry with\nits index in the stack.\n+n     Displays the nth entry counting from the left of the list shown  by  dirs  when\ninvoked without options, starting with zero.\n-n     Displays  the  nth entry counting from the right of the list shown by dirs when\ninvoked without options, starting with zero.\n\nThe return value is 0 unless an invalid option is supplied or n indexes beyond the end\nof the directory stack.\n\ndisown [-ar] [-h] [jobspec ... | pid ... ]\nWithout options, remove each jobspec from the table of active jobs.  If jobspec is not\npresent, and neither the -a nor the -r option is supplied, the current  job  is  used.\nIf  the  -h option is given, each jobspec is not removed from the table, but is marked\nso that SIGHUP is not sent to the job if the shell receives a SIGHUP.  If  no  jobspec\nis  supplied,  the -a option means to remove or mark all jobs; the -r option without a\njobspec argument restricts operation to running jobs.  The return value is 0 unless  a\njobspec does not specify a valid job.\n\necho [-neE] [arg ...]\nOutput  the  args, separated by spaces, followed by a newline.  The return status is 0\nunless a write error occurs.  If -n is specified, the trailing newline is  suppressed.\nIf  the  -e option is given, interpretation of the following backslash-escaped charac‐\nters is enabled.  The -E option disables the interpretation of  these  escape  charac‐\nters,  even  on systems where they are interpreted by default.  The xpgecho shell op‐\ntion may be used to dynamically determine whether or not  echo  expands  these  escape\ncharacters  by  default.  echo does not interpret -- to mean the end of options.  echo\ninterprets the following escape sequences:\n\\a     alert (bell)\n\\b     backspace\n\\c     suppress further output\n\\e\n\\E     an escape character\n\\f     form feed\n\\n     new line\n\\r     carriage return\n\\t     horizontal tab\n\\v     vertical tab\n\\\\     backslash\n\\0nnn  the eight-bit character whose value is the octal value nnn (zero to three octal\ndigits)\n\\xHH   the eight-bit character whose value is the hexadecimal value HH (one or two hex\ndigits)\n\\uHHHH the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH\n(one to four hex digits)\n\\UHHHHHHHH\nthe Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHH‐\nHHHHH (one to eight hex digits)\n\nenable [-a] [-dnps] [-f filename] [name ...]\nEnable and disable builtin shell commands.  Disabling a builtin allows a disk  command\nwhich  has  the  same name as a shell builtin to be executed without specifying a full\npathname, even though the shell normally searches for builtins before  disk  commands.\nIf  -n  is used, each name is disabled; otherwise, names are enabled.  For example, to\nuse the test binary found via the PATH instead of the shell builtin version, run ``en‐\nable  -n test''.  The -f option means to load the new builtin command name from shared\nobject filename, on systems that support dynamic loading.  The -d option will delete a\nbuiltin  previously  loaded with -f.  If no name arguments are given, or if the -p op‐\ntion is supplied, a list of shell builtins is printed.  With  no  other  option  argu‐\nments,  the list consists of all enabled shell builtins.  If -n is supplied, only dis‐\nabled builtins are printed.   If  -a  is  supplied,  the  list  printed  includes  all\nbuiltins,  with  an  indication of whether or not each is enabled.  If -s is supplied,\nthe output is restricted to the POSIX special builtins.  The return value is 0  unless\na name is not a shell builtin or there is an error loading a new builtin from a shared\nobject.\n\neval [arg ...]\nThe args are read and concatenated together into a single command.   This  command  is\nthen  read  and executed by the shell, and its exit status is returned as the value of\neval.  If there are no args, or only null arguments, eval returns 0.\n\nexec [-cl] [-a name] [command [arguments]]\nIf command is specified, it replaces the shell.  No new process is created.  The argu‐\nments become the arguments to command.  If the -l option is supplied, the shell places\na dash at the beginning of the zeroth argument passed to command.  This  is  what  lo‐\ngin(1)  does.   The -c option causes command to be executed with an empty environment.\nIf -a is supplied, the shell passes name as the zeroth argument to the  executed  com‐\nmand.   If  command cannot be executed for some reason, a non-interactive shell exits,\nunless the execfail shell option is enabled.  In that case, it  returns  failure.   An\ninteractive  shell  returns  failure if the file cannot be executed.  A subshell exits\nunconditionally if exec fails.  If command is not specified, any redirections take ef‐\nfect  in the current shell, and the return status is 0.  If there is a redirection er‐\nror, the return status is 1.\n\nexit [n]\nCause the shell to exit with a status of n.  If n is omitted, the exit status is  that\nof the last command executed.  A trap on EXIT is executed before the shell terminates.\n\nexport [-fn] [name[=word]] ...",
                "subsections": [
                    {
                        "name": "export -p",
                        "content": "The  supplied names are marked for automatic export to the environment of subsequently\nexecuted commands.  If the -f option is given, the names refer to  functions.   If  no\nnames  are  given,  or  if  the -p option is supplied, a list of names of all exported\nvariables is printed.  The -n option causes the export property  to  be  removed  from\neach  name.  If a variable name is followed by =word, the value of the variable is set\nto word.  export returns an exit status of 0 unless an invalid option is  encountered,\none  of  the  names  is not a valid shell variable name, or -f is supplied with a name\nthat is not a function.\n\nfc [-e ename] [-lnr] [first] [last]\nfc -s [pat=rep] [cmd]\nThe first form selects a range of commands from first to last from  the  history  list\nand  displays  or  edits  and  re-executes them.  First and last may be specified as a\nstring (to locate the last command beginning with that string) or as a number (an  in‐\ndex  into the history list, where a negative number is used as an offset from the cur‐\nrent command number).  When listing, a first or last of 0 is equivalent to -1  and  -0\nis  equivalent to the current command (usually the fc command); otherwise 0 is equiva‐\nlent to -1 and -0 is invalid.  If last is not specified, it is set to the current com‐\nmand for listing (so that ``fc -l -10'' prints the last 10 commands) and to first oth‐\nerwise.  If first is not specified, it is set to the previous command for editing  and\n-16 for listing.\n\nThe -n option suppresses the command numbers when listing.  The -r option reverses the\norder of the commands.  If the -l option is given, the commands are listed on standard\noutput.   Otherwise,  the  editor given by ename is invoked on a file containing those\ncommands.  If ename is not given, the value of the FCEDIT variable is  used,  and  the\nvalue  of  EDITOR if FCEDIT is not set.  If neither variable is set, vi is used.  When\nediting is complete, the edited commands are echoed and executed.\n\nIn the second form, command is re-executed after each instance of pat is  replaced  by\nrep.  Command is interpreted the same as first above.  A useful alias to use with this\nis ``r=\"fc -s\"'', so that typing ``r cc'' runs the last command beginning with  ``cc''\nand typing ``r'' re-executes the last command.\n\nIf  the  first form is used, the return value is 0 unless an invalid option is encoun‐\ntered or first or last specify history lines out of range.  If the -e option  is  sup‐\nplied, the return value is the value of the last command executed or failure if an er‐\nror occurs with the temporary file of commands.  If the second form is used,  the  re‐\nturn  status  is  that of the command re-executed, unless cmd does not specify a valid\nhistory line, in which case fc returns failure.\n\nfg [jobspec]\nResume jobspec in the foreground, and make it the current  job.   If  jobspec  is  not\npresent,  the  shell's notion of the current job is used.  The return value is that of\nthe command placed into the foreground, or failure if run when job control is disabled\nor, when run with job control enabled, if jobspec does not specify a valid job or job‐\nspec specifies a job that was started without job control.\n\ngetopts optstring name [arg ...]\ngetopts is used by shell procedures to parse positional  parameters.   optstring  con‐\ntains  the  option characters to be recognized; if a character is followed by a colon,\nthe option is expected to have an argument, which should be separated from it by white\nspace.   The  colon and question mark characters may not be used as option characters.\nEach time it is invoked, getopts places the next option in the  shell  variable  name,\ninitializing  name if it does not exist, and the index of the next argument to be pro‐\ncessed into the variable OPTIND.  OPTIND is initialized to 1 each time the shell or  a\nshell script is invoked.  When an option requires an argument, getopts places that ar‐\ngument into the variable OPTARG.  The shell does not reset  OPTIND  automatically;  it\nmust be manually reset between multiple calls to getopts within the same shell invoca‐\ntion if a new set of parameters is to be used.\n\nWhen the end of options is encountered, getopts exits with a return value greater than\nzero.  OPTIND is set to the index of the first non-option argument, and name is set to\n?.\n\ngetopts normally parses the positional parameters, but if more arguments are  supplied\nas arg values, getopts parses those instead.\n\ngetopts  can  report  errors  in  two  ways.  If the first character of optstring is a\ncolon, silent error reporting is used.  In normal operation, diagnostic  messages  are\nprinted  when  invalid  options  or  missing option arguments are encountered.  If the\nvariable OPTERR is set to 0, no error messages will be displayed, even  if  the  first\ncharacter of optstring is not a colon.\n\nIf an invalid option is seen, getopts places ? into name and, if not silent, prints an\nerror message and unsets OPTARG.  If getopts is silent, the option character found  is\nplaced in OPTARG and no diagnostic message is printed.\n\nIf a required argument is not found, and getopts is not silent, a question mark (?) is\nplaced in name, OPTARG is unset, and a diagnostic message is printed.  If  getopts  is\nsilent,  then  a colon (:) is placed in name and OPTARG is set to the option character\nfound.\n\ngetopts returns true if an option, specified or unspecified,  is  found.   It  returns\nfalse if the end of options is encountered or an error occurs.\n\nhash [-lr] [-p filename] [-dt] [name]\nEach  time  hash  is  invoked,  the full pathname of the command name is determined by\nsearching the directories in $PATH and remembered.  Any previously-remembered pathname\nis discarded.  If the -p option is supplied, no path search is performed, and filename\nis used as the full filename of the command.  The -r option causes the shell to forget\nall remembered locations.  The -d option causes the shell to forget the remembered lo‐\ncation of each name.  If the -t option is supplied, the full pathname  to  which  each\nname  corresponds  is  printed.   If multiple name arguments are supplied with -t, the\nname is printed before the hashed full pathname.  The -l option causes  output  to  be\ndisplayed  in  a format that may be reused as input.  If no arguments are given, or if\nonly -l is supplied, information about remembered commands  is  printed.   The  return\nstatus is true unless a name is not found or an invalid option is supplied.\n\nhelp [-dms] [pattern]\nDisplay  helpful  information  about  builtin commands.  If pattern is specified, help\ngives detailed help on all commands matching  pattern;  otherwise  help  for  all  the\nbuiltins and shell control structures is printed.\n-d     Display a short description of each pattern\n-m     Display the description of each pattern in a manpage-like format\n-s     Display only a short usage synopsis for each pattern\n\nThe return status is 0 unless no command matches pattern.\n\nhistory [n]"
                    },
                    {
                        "name": "history -c",
                        "content": "history -d offset\nhistory -d start-end\nhistory -anrw [filename]\nhistory -p arg [arg ...]\nhistory -s arg [arg ...]\nWith  no  options,  display  the command history list with line numbers.  Lines listed\nwith a * have been modified.  An argument of n lists only the last n  lines.   If  the\nshell  variable  HISTTIMEFORMAT is set and not null, it is used as a format string for\nstrftime(3) to display the time stamp associated with each  displayed  history  entry.\nNo intervening blank is printed between the formatted time stamp and the history line.\nIf filename is supplied, it is used as the name of the history file; if not, the value\nof HISTFILE is used.  Options, if supplied, have the following meanings:\n-c     Clear the history list by deleting all the entries.\n-d offset\nDelete  the history entry at position offset.  If offset is negative, it is in‐\nterpreted as relative to one greater than the last history position,  so  nega‐\ntive  indices count back from the end of the history, and an index of -1 refers\nto the current history -d command.\n-d start-end\nDelete the history entries between positions start and end,  inclusive.   Posi‐\ntive and negative values for start and end are interpreted as described above.\n-a     Append  the ``new'' history lines to the history file.  These are history lines\nentered since the beginning of the current bash session, but  not  already  ap‐\npended to the history file.\n-n     Read  the history lines not already read from the history file into the current\nhistory list.  These are lines appended to the history file since the beginning\nof the current bash session.\n-r     Read  the  contents  of the history file and append them to the current history\nlist.\n-w     Write the current history list to the history  file,  overwriting  the  history\nfile's contents.\n-p     Perform  history  substitution  on the following args and display the result on\nthe standard output.  Does not store the results in the history list.  Each arg\nmust be quoted to disable normal history expansion.\n-s     Store  the args in the history list as a single entry.  The last command in the\nhistory list is removed before the args are added.\n\nIf the HISTTIMEFORMAT variable is set, the time stamp information associated with each\nhistory  entry is written to the history file, marked with the history comment charac‐\nter.  When the history file is read, lines beginning with the history comment  charac‐\nter  followed  immediately  by a digit are interpreted as timestamps for the following\nhistory entry.  The return value is 0 unless an invalid option is encountered, an  er‐\nror occurs while reading or writing the history file, an invalid offset is supplied as\nan argument to -d, or the history expansion supplied as an argument to -p fails.\n\njobs [-lnprs] [ jobspec ... ]\njobs -x command [ args ... ]\nThe first form lists the active jobs.  The options have the following meanings:\n-l     List process IDs in addition to the normal information.\n-n     Display information only about jobs that have changed status since the user was\nlast notified of their status.\n-p     List only the process ID of the job's process group leader.\n-r     Display only running jobs.\n-s     Display only stopped jobs.\n\nIf  jobspec  is given, output is restricted to information about that job.  The return\nstatus is 0 unless an invalid option is encountered or an invalid jobspec is supplied.\n\nIf the -x option is supplied, jobs replaces any jobspec found in command or args  with\nthe  corresponding  process  group ID, and executes command passing it args, returning\nits exit status.\n\nkill [-s sigspec | -n signum | -sigspec] [pid | jobspec] ...\nkill -l|-L [sigspec | exitstatus]\nSend the signal named by sigspec or signum to the processes named by pid  or  jobspec.\nsigspec  is either a case-insensitive signal name such as SIGKILL (with or without the\nSIG prefix) or a signal number; signum is a signal number.  If sigspec is not present,\nthen  SIGTERM is assumed.  An argument of -l lists the signal names.  If any arguments\nare supplied when -l is given, the names of the signals corresponding to the arguments\nare  listed,  and  the return status is 0.  The exitstatus argument to -l is a number\nspecifying either a signal number or the exit status of a process terminated by a sig‐\nnal.  The -L option is equivalent to -l.  kill returns true if at least one signal was\nsuccessfully sent, or false if an error occurs or an invalid option is encountered.\n\nlet arg [arg ...]\nEach arg is an arithmetic  expression  to  be  evaluated  (see  ARITHMETIC  EVALUATION\nabove).  If the last arg evaluates to 0, let returns 1; 0 is returned otherwise.\n\nlocal [option] [name[=value] ... | - ]\nFor  each  argument,  a local variable named name is created, and assigned value.  The\noption can be any of the options accepted by declare.  When local  is  used  within  a\nfunction, it causes the variable name to have a visible scope restricted to that func‐\ntion and its children.  If name is -, the set of shell options is made  local  to  the\nfunction in which local is invoked: shell options changed using the set builtin inside\nthe function are restored to their original values when the function returns.  The re‐\nstore  is  effected as if a series of set commands were executed to restore the values\nthat were in place before the function.  With no operands, local writes a list of  lo‐\ncal  variables  to the standard output.  It is an error to use local when not within a\nfunction.  The return status is 0 unless local is used outside a function, an  invalid\nname is supplied, or name is a readonly variable.\n\nlogout Exit a login shell.\n\nmapfile  [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum]\n[array]\nreadarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback]  [-c  quan‐\ntum] [array]\nRead lines from the standard input into the indexed array variable array, or from file\ndescriptor fd if the -u option is supplied.  The variable MAPFILE is the  default  ar‐\nray.  Options, if supplied, have the following meanings:\n-d     The  first character of delim is used to terminate each input line, rather than\nnewline.  If delim is the empty string, mapfile will terminate a line  when  it\nreads a NUL character.\n-n     Copy at most count lines.  If count is 0, all lines are copied.\n-O     Begin assigning to array at index origin.  The default index is 0.\n-s     Discard the first count lines read.\n-t     Remove a trailing delim (default newline) from each line read.\n-u     Read lines from file descriptor fd instead of the standard input.\n-C     Evaluate  callback  each  time quantum lines are read.  The -c option specifies\nquantum.\n-c     Specify the number of lines read between each call to callback.\n\nIf -C is specified without -c, the default quantum is 5000.  When callback  is  evalu‐\nated,  it  is supplied the index of the next array element to be assigned and the line\nto be assigned to that element as additional arguments.  callback is  evaluated  after\nthe line is read but before the array element is assigned.\n\nIf  not supplied with an explicit origin, mapfile will clear array before assigning to\nit.\n\nmapfile returns successfully unless an invalid option or option argument is  supplied,\narray is invalid or unassignable, or if array is not an indexed array.\n\npopd [-n] [+n] [-n]\nRemoves  entries  from the directory stack.  With no arguments, removes the top direc‐\ntory from the stack, and performs a cd to the new top directory.  Arguments,  if  sup‐\nplied, have the following meanings:\n-n     Suppresses  the  normal  change of directory when removing directories from the\nstack, so that only the stack is manipulated.\n+n     Removes the nth entry counting from the left of the list shown by dirs,  start‐\ning  with  zero.   For example: ``popd +0'' removes the first directory, ``popd\n+1'' the second.\n-n     Removes the nth entry counting from the right of the list shown by dirs, start‐\ning  with  zero.   For  example: ``popd -0'' removes the last directory, ``popd\n-1'' the next to last.\n\nIf the popd command is successful, a dirs is performed as well, and the return  status\nis  0.  popd returns false if an invalid option is encountered, the directory stack is\nempty, a non-existent directory stack entry is  specified,  or  the  directory  change\nfails.\n\nprintf [-v var] format [arguments]\nWrite  the formatted arguments to the standard output under the control of the format.\nThe -v option causes the output to be assigned to the variable var rather  than  being\nprinted to the standard output.\n\nThe  format is a character string which contains three types of objects: plain charac‐\nters, which are simply copied to standard output, character  escape  sequences,  which\nare  converted  and  copied to the standard output, and format specifications, each of\nwhich causes printing of the next successive argument.  In addition  to  the  standard\nprintf(1) format specifications, printf interprets the following extensions:\n%b     causes  printf  to expand backslash escape sequences in the corresponding argu‐\nment in the same way as echo -e.\n%q     causes printf to output the corresponding argument in  a  format  that  can  be\nreused as shell input.\n%(datefmt)T\ncauses  printf to output the date-time string resulting from using datefmt as a\nformat string for strftime(3).  The corresponding argument is an integer repre‐\nsenting the number of seconds since the epoch.  Two special argument values may\nbe used: -1 represents the current time, and -2 represents the time  the  shell\nwas invoked.  If no argument is specified, conversion behaves as if -1 had been\ngiven.  This is an exception to the usual printf behavior.\n\nThe %b, %q, and %T directives all use the field width and precision arguments from the\nformat specification and write that many bytes from (or use that wide a field for) the\nexpanded argument, which usually contains more characters than the original.\n\nArguments to non-string format specifiers are treated as C constants,  except  that  a\nleading  plus  or  minus  sign is allowed, and if the leading character is a single or\ndouble quote, the value is the ASCII value of the following character.\n\nThe format is reused as necessary to consume all of the arguments.  If the format  re‐\nquires  more arguments than are supplied, the extra format specifications behave as if\na zero value or null string, as appropriate, had been supplied.  The return  value  is\nzero on success, non-zero on failure.\n\npushd [-n] [+n] [-n]\npushd [-n] [dir]\nAdds  a  directory to the top of the directory stack, or rotates the stack, making the\nnew top of the stack the current working directory.   With  no  arguments,  pushd  ex‐\nchanges  the  top  two directories and returns 0, unless the directory stack is empty.\nArguments, if supplied, have the following meanings:\n-n     Suppresses the normal change of directory when rotating or  adding  directories\nto the stack, so that only the stack is manipulated.\n+n     Rotates the stack so that the nth directory (counting from the left of the list\nshown by dirs, starting with zero) is at the top.\n-n     Rotates the stack so that the nth directory (counting from  the  right  of  the\nlist shown by dirs, starting with zero) is at the top.\ndir    Adds  dir  to the directory stack at the top, making it the new current working\ndirectory as if it had been supplied as the argument to the cd builtin.\n\nIf the pushd command is successful, a dirs is performed as well.  If the first form is\nused, pushd returns 0 unless the cd to dir fails.  With the second form, pushd returns\n0 unless the directory stack is empty, a non-existent directory stack element is spec‐\nified, or the directory change to the specified new current directory fails.\n\npwd [-LP]\nPrint  the  absolute  pathname of the current working directory.  The pathname printed\ncontains no symbolic links if the -P option is supplied or the -o physical  option  to\nthe  set  builtin  command is enabled.  If the -L option is used, the pathname printed\nmay contain symbolic links.  The return status is 0 unless an error occurs while read‐\ning the name of the current directory or an invalid option is supplied.\n\nread  [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout]\n[-u fd] [name ...]\nOne line is read from the standard input, or from the file descriptor fd  supplied  as\nan  argument  to  the -u option, split into words as described above under Word Split‐‐\nting, and the first word is assigned to the first name, the second word to the  second\nname,  and  so  on.  If there are more words than names, the remaining words and their\nintervening delimiters are assigned to the last name.  If there are fewer  words  read\nfrom  the input stream than names, the remaining names are assigned empty values.  The\ncharacters in IFS are used to split the line into words using the same rules the shell\nuses  for  expansion  (described above under Word Splitting).  The backslash character\n(\\) may be used to remove any special meaning for the next character read and for line\ncontinuation.  Options, if supplied, have the following meanings:\n-a aname\nThe  words  are  assigned  to  sequential  indices of the array variable aname,\nstarting at 0.  aname is unset before any new values are assigned.  Other  name\narguments are ignored.\n-d delim\nThe  first  character of delim is used to terminate the input line, rather than\nnewline.  If delim is the empty string, read will  terminate  a  line  when  it\nreads a NUL character.\n-e     If  the standard input is coming from a terminal, readline (see READLINE above)\nis used to obtain the line.  Readline uses the current  (or  default,  if  line\nediting  was  not  previously active) editing settings, but uses Readline's de‐\nfault filename completion.\n-i text\nIf readline is being used to read the line, text is  placed  into  the  editing\nbuffer before editing begins.\n-n nchars\nread returns after reading nchars characters rather than waiting for a complete\nline of input, but honors a delimiter if fewer than nchars characters are  read\nbefore the delimiter.\n-N nchars\nread  returns after reading exactly nchars characters rather than waiting for a\ncomplete line of input, unless EOF is encountered or read times out.  Delimiter\ncharacters  encountered in the input are not treated specially and do not cause\nread to return until nchars characters are read.  The result is  not  split  on\nthe  characters in IFS; the intent is that the variable is assigned exactly the\ncharacters read (with the exception of backslash; see the -r option below).\n-p prompt\nDisplay prompt on standard error, without a trailing newline, before attempting\nto read any input.  The prompt is displayed only if input is coming from a ter‐\nminal.\n-r     Backslash does not act as an escape character.  The backslash is considered  to\nbe  part  of the line.  In particular, a backslash-newline pair may not then be\nused as a line continuation.\n-s     Silent mode.  If input is coming from a terminal, characters are not echoed.\n-t timeout\nCause read to time out and return failure if a complete line  of  input  (or  a\nspecified  number  of  characters) is not read within timeout seconds.  timeout\nmay be a decimal number with a fractional portion following the decimal  point.\nThis  option  is only effective if read is reading input from a terminal, pipe,\nor other special file; it has no effect when reading from  regular  files.   If\nread  times  out, read saves any partial input read into the specified variable\nname.  If timeout is 0, read returns immediately, without trying  to  read  any\ndata.   The  exit  status  is 0 if input is available on the specified file de‐\nscriptor, non-zero otherwise.  The exit status is greater than 128 if the time‐\nout is exceeded.\n-u fd  Read input from file descriptor fd.\n\nIf  no  names  are supplied, the line read, without the ending delimiter but otherwise\nunmodified, is assigned to the variable REPLY.  The exit status is zero,  unless  end-\nof-file is encountered, read times out (in which case the status is greater than 128),\na variable assignment error (such as assigning to a readonly variable) occurs,  or  an\ninvalid file descriptor is supplied as the argument to -u.\n\nreadonly [-aAf] [-p] [name[=word] ...]\nThe  given  names are marked readonly; the values of these names may not be changed by\nsubsequent assignment.  If the -f option is supplied, the functions  corresponding  to\nthe names are so marked.  The -a option restricts the variables to indexed arrays; the\n-A option restricts the variables to associative arrays.  If  both  options  are  sup‐\nplied,  -A  takes  precedence.  If no name arguments are given, or if the -p option is\nsupplied, a list of all readonly names is printed.  The other options may be  used  to\nrestrict  the  output  to a subset of the set of readonly names.  The -p option causes\noutput to be displayed in a format that may be reused as input.  If a variable name is\nfollowed  by  =word, the value of the variable is set to word.  The return status is 0\nunless an invalid option is encountered, one of the names is not a valid  shell  vari‐\nable name, or -f is supplied with a name that is not a function.\n\nreturn [n]\nCauses a function to stop executing and return the value specified by n to its caller.\nIf n is omitted, the return status is that of the last command executed in  the  func‐\ntion  body.   If return is executed by a trap handler, the last command used to deter‐\nmine the status is the last command executed before the trap handler.   If  return  is\nexecuted  during  a  DEBUG  trap, the last command used to determine the status is the\nlast command executed by the trap handler before return was  invoked.   If  return  is\nused  outside a function, but during execution of a script by the .  (source) command,\nit causes the shell to stop executing that script and return either n or the exit sta‐\ntus  of  the last command executed within the script as the exit status of the script.\nIf n is supplied, the return value is its least significant 8 bits.  The return status\nis  non-zero  if return is supplied a non-numeric argument, or is used outside a func‐\ntion and not during execution of a script by . or source.  Any command associated with\nthe RETURN trap is executed before execution resumes after the function or script.\n\nset [--abefhkmnptuvxBCEHPT] [-o option-name] [arg ...]\nset [+abefhkmnptuvxBCEHPT] [+o option-name] [arg ...]\nWithout  options,  the name and value of each shell variable are displayed in a format\nthat can be reused as input for setting  or  resetting  the  currently-set  variables.\nRead-only  variables cannot be reset.  In posix mode, only shell variables are listed.\nThe output is sorted according to the current locale.   When  options  are  specified,\nthey  set  or unset shell attributes.  Any arguments remaining after option processing\nare treated as values for the positional parameters and are assigned, in order, to $1,\n$2, ...  $n.  Options, if specified, have the following meanings:\n-a      Each  variable or function that is created or modified is given the export at‐\ntribute and marked for export to the environment of subsequent commands.\n-b      Report the status of terminated background jobs immediately, rather  than  be‐\nfore  the next primary prompt.  This is effective only when job control is en‐\nabled.\n-e      Exit immediately if a pipeline (which may consist of a single simple command),\na list, or a compound command (see SHELL GRAMMAR above), exits with a non-zero\nstatus.  The shell does not exit if the command that fails is part of the com‐\nmand  list  immediately  following  a while or until keyword, part of the test\nfollowing the if or elif reserved words, part of any command executed in a  &&\nor  ||  list except the command following the final && or ||, any command in a\npipeline but the last, or if the command's return value is being inverted with\n!.   If a compound command other than a subshell returns a non-zero status be‐\ncause a command failed while -e was being ignored, the shell does not exit.  A\ntrap  on ERR, if set, is executed before the shell exits.  This option applies\nto the shell environment and each subshell environment separately (see COMMAND\nEXECUTION ENVIRONMENT above), and may cause subshells to exit before executing\nall the commands in the subshell.\n\nIf a compound command or shell function executes in a context where -e is  be‐\ning  ignored,  none  of  the  commands executed within the compound command or\nfunction body will be affected by the -e setting, even if -e is set and a com‐\nmand  returns  a failure status.  If a compound command or shell function sets\n-e while executing in a context where -e is ignored,  that  setting  will  not\nhave any effect until the compound command or the command containing the func‐\ntion call completes.\n-f      Disable pathname expansion.\n-h      Remember the location of commands as they are looked up for  execution.   This\nis enabled by default.\n-k      All  arguments in the form of assignment statements are placed in the environ‐\nment for a command, not just those that precede the command name.\n-m      Monitor mode.  Job control is enabled.  This option is on by default  for  in‐\nteractive shells on systems that support it (see JOB CONTROL above).  All pro‐\ncesses run in a separate process group.  When a background job completes,  the\nshell prints a line containing its exit status.\n-n      Read  commands  but  do  not  execute them.  This may be used to check a shell\nscript for syntax errors.  This is ignored by interactive shells.\n-o option-name\nThe option-name can be one of the following:\nallexport\nSame as -a.\nbraceexpand\nSame as -B.\nemacs   Use an emacs-style command line editing interface.  This is enabled by\ndefault  when  the  shell  is interactive, unless the shell is started\nwith the --noediting option.  This also affects the editing  interface\nused for read -e.\nerrexit Same as -e.\nerrtrace\nSame as -E.\nfunctrace\nSame as -T.\nhashall Same as -h.\nhistexpand\nSame as -H.\nhistory Enable command history, as described above under HISTORY.  This option\nis on by default in interactive shells.\nignoreeof\nThe effect is as if the shell command ``IGNOREEOF=10'' had  been  exe‐\ncuted (see Shell Variables above).\nkeyword Same as -k.\nmonitor Same as -m.\nnoclobber\nSame as -C.\nnoexec  Same as -n.\nnoglob  Same as -f.\nnolog   Currently ignored.\nnotify  Same as -b.\nnounset Same as -u.\nonecmd  Same as -t.\nphysical\nSame as -P.\npipefail\nIf  set,  the  return  value  of  a  pipeline is the value of the last\n(rightmost) command to exit with a non-zero status,  or  zero  if  all\ncommands  in  the pipeline exit successfully.  This option is disabled\nby default.\nposix   Change the behavior of bash where the default operation  differs  from\nthe  POSIX  standard to match the standard (posix mode).  See SEE ALSO\nbelow for a reference to a document that details how  posix  mode  af‐\nfects bash's behavior.\nprivileged\nSame as -p.\nverbose Same as -v.\nvi      Use  a vi-style command line editing interface.  This also affects the\nediting interface used for read -e.\nxtrace  Same as -x.\nIf -o is supplied with no option-name, the values of the current  options  are\nprinted.   If  +o is supplied with no option-name, a series of set commands to\nrecreate the current option settings is displayed on the standard output.\n-p      Turn on privileged mode.  In this mode, the $ENV and $BASHENV files  are  not\nprocessed,  shell  functions  are  not inherited from the environment, and the\nSHELLOPTS, BASHOPTS, CDPATH, and GLOBIGNORE variables, if they appear  in  the\nenvironment,  are  ignored.   If  the shell is started with the effective user\n(group) id not equal to the real user (group) id, and the  -p  option  is  not\nsupplied, these actions are taken and the effective user id is set to the real\nuser id.  If the -p option is supplied at startup, the effective  user  id  is\nnot reset.  Turning this option off causes the effective user and group ids to\nbe set to the real user and group ids.\n-t      Exit after reading and executing one command.\n-u      Treat unset variables and parameters other than the special parameters \"@\" and\n\"*\"  as  an  error  when  performing parameter expansion.  If expansion is at‐\ntempted on an unset variable or parameter, the shell prints an error  message,\nand, if not interactive, exits with a non-zero status.\n-v      Print shell input lines as they are read.\n-x      After  expanding  each  simple command, for command, case command, select com‐\nmand, or arithmetic for command, display the expanded value of  PS4,  followed\nby the command and its expanded arguments or associated word list.\n-B      The shell performs brace expansion (see Brace Expansion above).  This is on by\ndefault.\n-C      If set, bash does not overwrite an existing file with the >, >&, and <>  redi‐\nrection operators.  This may be overridden when creating output files by using\nthe redirection operator >| instead of >.\n-E      If set, any trap on ERR is inherited by  shell  functions,  command  substitu‐\ntions,  and commands executed in a subshell environment.  The ERR trap is nor‐\nmally not inherited in such cases.\n-H      Enable !  style history substitution.  This option is on by default  when  the\nshell is interactive.\n-P      If set, the shell does not resolve symbolic links when executing commands such\nas cd that change the current working directory.  It uses the physical  direc‐\ntory  structure instead.  By default, bash follows the logical chain of direc‐\ntories when performing commands which change the current directory.\n-T      If set, any traps on DEBUG and RETURN are inherited by shell  functions,  com‐\nmand  substitutions, and commands executed in a subshell environment.  The DE‐‐\nBUG and RETURN traps are normally not inherited in such cases.\n--      If no arguments follow this option, then the positional parameters are  unset.\nOtherwise, the positional parameters are set to the args, even if some of them\nbegin with a -.\n-       Signal the end of options, cause all remaining args to be assigned to the  po‐\nsitional  parameters.   The -x and -v options are turned off.  If there are no\nargs, the positional parameters remain unchanged.\n\nThe options are off by default unless otherwise noted.  Using + rather than  -  causes\nthese  options to be turned off.  The options can also be specified as arguments to an\ninvocation of the shell.  The current set of options may be found in $-.   The  return\nstatus is always true unless an invalid option is encountered.\n\nshift [n]\nThe  positional parameters from n+1 ... are renamed to $1 ....  Parameters represented\nby the numbers $# down to $#-n+1 are unset.  n must be a non-negative number less than\nor  equal  to $#.  If n is 0, no parameters are changed.  If n is not given, it is as‐\nsumed to be 1.  If n is greater than $#, the positional parameters  are  not  changed.\nThe return status is greater than zero if n is greater than $# or less than zero; oth‐\nerwise 0.\n\nshopt [-pqsu] [-o] [optname ...]\nToggle the values of settings controlling optional shell behavior.  The  settings  can\nbe  either  those listed below, or, if the -o option is used, those available with the\n-o option to the set builtin command.  With no options, or with the -p option, a  list\nof  all  settable  options  is displayed, with an indication of whether or not each is\nset; if optnames are supplied, the output is restricted to those options.  The -p  op‐\ntion  causes  output to be displayed in a form that may be reused as input.  Other op‐\ntions have the following meanings:\n-s     Enable (set) each optname.\n-u     Disable (unset) each optname.\n-q     Suppresses normal output (quiet mode); the return status indicates whether  the\noptname  is set or unset.  If multiple optname arguments are given with -q, the\nreturn status is zero if all optnames are enabled; non-zero otherwise.\n-o     Restricts the values of optname to be those defined for the -o  option  to  the\nset builtin.\n\nIf  either  -s or -u is used with no optname arguments, shopt shows only those options\nwhich are set or unset, respectively.  Unless otherwise noted, the shopt  options  are\ndisabled (unset) by default.\n\nThe  return  status when listing options is zero if all optnames are enabled, non-zero\notherwise.  When setting or unsetting options, the return status  is  zero  unless  an\noptname is not a valid shell option.\n\nThe list of shopt options is:\n\nassocexpandonce\nIf  set,  the  shell  suppresses multiple evaluation of associative array sub‐\nscripts during arithmetic expression evaluation, while executing builtins that\ncan  perform  variable  assignments, and while executing builtins that perform\narray dereferencing.\nautocd  If set, a command name that is the name of a directory is executed  as  if  it\nwere  the argument to the cd command.  This option is only used by interactive\nshells.\ncdablevars\nIf set, an argument to the cd builtin command that is not a directory  is  as‐\nsumed to be the name of a variable whose value is the directory to change to.\ncdspell If  set, minor errors in the spelling of a directory component in a cd command\nwill be corrected.  The errors checked for are transposed characters, a  miss‐\ning character, and one character too many.  If a correction is found, the cor‐\nrected filename is printed, and the command proceeds.   This  option  is  only\nused by interactive shells.\ncheckhash\nIf  set, bash checks that a command found in the hash table exists before try‐\ning to execute it.  If a hashed command no longer exists, a normal path search\nis performed.\ncheckjobs\nIf  set,  bash lists the status of any stopped and running jobs before exiting\nan interactive shell.  If any jobs are running, this causes the exit to be de‐\nferred  until  a  second exit is attempted without an intervening command (see\nJOB CONTROL above).  The shell  always  postpones  exiting  if  any  jobs  are\nstopped.\ncheckwinsize\nIf  set, bash checks the window size after each external (non-builtin) command\nand, if necessary, updates the values of LINES and COLUMNS.   This  option  is\nenabled by default.\ncmdhist If set, bash attempts to save all lines of a multiple-line command in the same\nhistory entry.  This allows easy re-editing of multi-line commands.  This  op‐\ntion  is  enabled by default, but only has an effect if command history is en‐\nabled, as described above under HISTORY.\ncompat31\ncompat32\ncompat40\ncompat41\ncompat42\ncompat43\ncompat44\nThese control aspects of the shell's compatibility mode (see SHELL COMPATIBIL‐‐\nITY MODE below).\n\ncompletefullquote\nIf  set, bash quotes all shell metacharacters in filenames and directory names\nwhen performing completion.  If not set, bash removes metacharacters  such  as\nthe  dollar  sign  from the set of characters that will be quoted in completed\nfilenames when these metacharacters appear in  shell  variable  references  in\nwords  to  be  completed.  This means that dollar signs in variable names that\nexpand to directories will not be quoted; however, any dollar signs  appearing\nin filenames will not be quoted, either.  This is active only when bash is us‐\ning backslashes to quote completed filenames.  This variable  is  set  by  de‐\nfault, which is the default bash behavior in versions through 4.2.\n\ndirexpand\nIf  set, bash replaces directory names with the results of word expansion when\nperforming filename completion.  This changes the  contents  of  the  readline\nediting buffer.  If not set, bash attempts to preserve what the user typed.\n\ndirspell\nIf  set, bash attempts spelling correction on directory names during word com‐\npletion if the directory name initially supplied does not exist.\n\ndotglob If set, bash includes filenames beginning with a `.' in the results  of  path‐\nname  expansion.   The filenames ``.''  and ``..''  must always be matched ex‐\nplicitly, even if dotglob is set.\n\nexecfail\nIf set, a non-interactive shell will not exit if it cannot  execute  the  file\nspecified  as  an  argument to the exec builtin command.  An interactive shell\ndoes not exit if exec fails.\n\nexpandaliases\nIf set, aliases are expanded as described above under ALIASES.  This option is\nenabled by default for interactive shells.\n\nextdebug\nIf set at shell invocation, or in a shell startup file, arrange to execute the\ndebugger profile before the shell starts, identical to the --debugger  option.\nIf set after invocation, behavior intended for use by debuggers is enabled:\n\n1.     The  -F option to the declare builtin displays the source file name and\nline number corresponding to each function name supplied  as  an  argu‐\nment.\n\n2.     If the command run by the DEBUG trap returns a non-zero value, the next\ncommand is skipped and not executed.\n\n3.     If the command run by the DEBUG trap returns a  value  of  2,  and  the\nshell  is executing in a subroutine (a shell function or a shell script\nexecuted by the . or source builtins), the shell simulates  a  call  to\nreturn.\n\n4.     BASHARGC  and BASHARGV are updated as described in their descriptions\nabove.\n\n5.     Function tracing is enabled: command substitution, shell functions, and\nsubshells invoked with ( command ) inherit the DEBUG and RETURN traps.\n\n6.     Error  tracing  is  enabled: command substitution, shell functions, and\nsubshells invoked with ( command ) inherit the ERR trap.\n\nextglob If set, the extended pattern matching features described above under  Pathname\nExpansion are enabled.\n\nextquote\nIf  set,  $'string' and $\"string\" quoting is performed within ${parameter} ex‐\npansions enclosed in double quotes.  This option is enabled by default.\n\nfailglob\nIf set, patterns which fail to match filenames during pathname  expansion  re‐\nsult in an expansion error.\n\nforcefignore\nIf set, the suffixes specified by the FIGNORE shell variable cause words to be\nignored when performing word completion even if the ignored words are the only\npossible completions.  See SHELL VARIABLES above for a description of FIGNORE.\nThis option is enabled by default.\n\nglobasciiranges\nIf set, range expressions used in pattern matching  bracket  expressions  (see\nPattern Matching above) behave as if in the traditional C locale when perform‐\ning comparisons.  That is, the current  locale's  collating  sequence  is  not\ntaken  into account, so b will not collate between A and B, and upper-case and\nlower-case ASCII characters will collate together.\n\nglobstar\nIf set, the pattern  used in a pathname expansion  context  will  match  all\nfiles and zero or more directories and subdirectories.  If the pattern is fol‐\nlowed by a /, only directories and subdirectories match.\n\ngnuerrfmt\nIf set, shell error messages are written in the  standard  GNU  error  message\nformat.\n\nhistappend\nIf  set,  the  history  list is appended to the file named by the value of the\nHISTFILE variable when the shell exits, rather than overwriting the file.\n\nhistreedit\nIf set, and readline is being used, a user is given the opportunity to re-edit\na failed history substitution.\n\nhistverify\nIf  set,  and  readline is being used, the results of history substitution are\nnot immediately passed to the shell parser.  Instead, the  resulting  line  is\nloaded into the readline editing buffer, allowing further modification.\n\nhostcomplete\nIf set, and readline is being used, bash will attempt to perform hostname com‐\npletion when a word containing a @ is being completed  (see  Completing  under\nREADLINE above).  This is enabled by default.\n\nhuponexit\nIf  set, bash will send SIGHUP to all jobs when an interactive login shell ex‐\nits.\n\ninheriterrexit\nIf set, command substitution inherits the value of the errexit option, instead\nof  unsetting  it  in  the  subshell environment.  This option is enabled when\nposix mode is enabled.\n\ninteractivecomments\nIf set, allow a word beginning with # to cause that  word  and  all  remaining\ncharacters  on  that  line to be ignored in an interactive shell (see COMMENTS\nabove).  This option is enabled by default.\n\nlastpipe\nIf set, and job control is not active, the shell runs the last  command  of  a\npipeline not executed in the background in the current shell environment.\n\nlithist If  set,  and  the cmdhist option is enabled, multi-line commands are saved to\nthe history with embedded newlines  rather  than  using  semicolon  separators\nwhere possible.\n\nlocalvarinherit\nIf  set, local variables inherit the value and attributes of a variable of the\nsame name that exists at a previous scope before any new  value  is  assigned.\nThe nameref attribute is not inherited.\n\nlocalvarunset\nIf  set,  calling  unset  on local variables in previous function scopes marks\nthem so subsequent lookups find them unset until that function  returns.  This\nis identical to the behavior of unsetting local variables at the current func‐\ntion scope.\n\nloginshell\nThe shell sets this option if it is started as a login shell  (see  INVOCATION\nabove).  The value may not be changed.\n\nmailwarn\nIf  set, and a file that bash is checking for mail has been accessed since the\nlast time it was checked, the message ``The mail in mailfile has  been  read''\nis displayed.\n\nnoemptycmdcompletion\nIf  set,  and readline is being used, bash will not attempt to search the PATH\nfor possible completions when completion is attempted on an empty line.\n\nnocaseglob\nIf set, bash matches filenames in a case-insensitive fashion  when  performing\npathname expansion (see Pathname Expansion above).\n\nnocasematch\nIf  set,  bash  matches patterns in a case-insensitive fashion when performing\nmatching while executing case or [[ conditional commands, when performing pat‐\ntern  substitution  word expansions, or when filtering possible completions as\npart of programmable completion.\n\nnullglob\nIf set, bash allows patterns which match  no  files  (see  Pathname  Expansion\nabove) to expand to a null string, rather than themselves.\n\nprogcomp\nIf  set,  the  programmable completion facilities (see Programmable Completion\nabove) are enabled.  This option is enabled by default.\n\nprogcompalias\nIf set, and programmable completion is enabled, bash  treats  a  command  name\nthat  doesn't  have any completions as a possible alias and attempts alias ex‐\npansion. If it has an alias, bash attempts programmable completion  using  the\ncommand word resulting from the expanded alias.\n\npromptvars\nIf  set,  prompt  strings  undergo  parameter expansion, command substitution,\narithmetic expansion, and quote removal after being expanded as  described  in\nPROMPTING above.  This option is enabled by default.\n\nrestrictedshell\nThe shell sets this option if it is started in restricted mode (see RESTRICTED\nSHELL below).  The value may not be changed.   This  is  not  reset  when  the\nstartup  files are executed, allowing the startup files to discover whether or\nnot a shell is restricted.\n\nshiftverbose\nIf set, the shift builtin prints an error message when the shift count exceeds\nthe number of positional parameters.\n\nsourcepath\nIf  set,  the  source (.) builtin uses the value of PATH to find the directory\ncontaining the file supplied as an argument.  This option is  enabled  by  de‐\nfault.\n\nxpgecho\nIf set, the echo builtin expands backslash-escape sequences by default.\n\nsuspend [-f]\nSuspend the execution of this shell until it receives a SIGCONT signal.  A login shell\ncannot be suspended; the -f option can be used to override this and force the  suspen‐\nsion.   The  return  status  is 0 unless the shell is a login shell and -f is not sup‐\nplied, or if job control is not enabled.\n\ntest expr\n[ expr ]\nReturn a status of 0 (true) or 1 (false) depending on the  evaluation  of  the  condi‐\ntional  expression  expr.  Each operator and operand must be a separate argument.  Ex‐\npressions are composed of the primaries described in the bash manual page under CONDI‐‐\nTIONAL  EXPRESSIONS.   test does not accept any options, nor does it accept and ignore\nan argument of -- as signifying the end of options.\n\nExpressions may be combined using the following operators, listed in decreasing  order\nof  precedence.  The evaluation depends on the number of arguments; see below.  Opera‐\ntor precedence is used when there are five or more arguments.\n! expr True if expr is false.\n( expr )\nReturns the value of expr.  This may be used to override the normal  precedence\nof operators.\nexpr1 -a expr2\nTrue if both expr1 and expr2 are true.\nexpr1 -o expr2\nTrue if either expr1 or expr2 is true.\n\ntest  and  [ evaluate conditional expressions using a set of rules based on the number\nof arguments.\n\n0 arguments\nThe expression is false.\n1 argument\nThe expression is true if and only if the argument is not null.\n2 arguments\nIf the first argument is !, the expression is true if and only  if  the  second\nargument is null.  If the first argument is one of the unary conditional opera‐\ntors listed above under CONDITIONAL EXPRESSIONS, the expression is true if  the\nunary test is true.  If the first argument is not a valid unary conditional op‐\nerator, the expression is false.\n3 arguments\nThe following conditions are applied in the order listed.  If the second  argu‐\nment  is one of the binary conditional operators listed above under CONDITIONAL\nEXPRESSIONS, the result of the expression is the result of the binary test  us‐\ning  the  first  and  third arguments as operands.  The -a and -o operators are\nconsidered binary operators when there are three arguments.  If the first argu‐\nment  is !, the value is the negation of the two-argument test using the second\nand third arguments.  If the first argument is exactly ( and the third argument\nis exactly ), the result is the one-argument test of the second argument.  Oth‐\nerwise, the expression is false.\n4 arguments\nIf the first argument is !, the result is the negation  of  the  three-argument\nexpression  composed  of the remaining arguments.  Otherwise, the expression is\nparsed and evaluated according to precedence using the rules listed above.\n5 or more arguments\nThe expression is parsed and evaluated according to precedence using the  rules\nlisted above.\n\nWhen used with test or [, the < and > operators sort lexicographically using ASCII or‐\ndering.\n\ntimes  Print the accumulated user and system times for the shell and for processes  run  from\nthe shell.  The return status is 0.\n\ntrap [-lp] [[arg] sigspec ...]\nThe  command arg is to be read and executed when the shell receives signal(s) sigspec.\nIf arg is absent (and there is a single sigspec) or -, each specified signal is  reset\nto  its original disposition (the value it had upon entrance to the shell).  If arg is\nthe null string the signal specified by each sigspec is ignored by the  shell  and  by\nthe  commands  it  invokes.   If arg is not present and -p has been supplied, then the\ntrap commands associated with each sigspec are displayed.  If no  arguments  are  sup‐\nplied  or  if  only -p is given, trap prints the list of commands associated with each\nsignal.  The -l option causes the shell to print a list of signal names and their cor‐\nresponding  numbers.  Each sigspec is either a signal name defined in <signal.h>, or a\nsignal number.  Signal names are case insensitive and the SIG prefix is optional.\n\nIf a sigspec is EXIT (0) the command arg is executed on exit from  the  shell.   If  a\nsigspec  is  DEBUG,  the command arg is executed before every simple command, for com‐\nmand, case command, select command, every arithmetic for command, and before the first\ncommand executes in a shell function (see SHELL GRAMMAR above).  Refer to the descrip‐\ntion of the extdebug option to the shopt builtin for details of its effect on the  DE‐‐\nBUG trap.  If a sigspec is RETURN, the command arg is executed each time a shell func‐\ntion or a script executed with the . or source builtins finishes executing.\n\nIf a sigspec is ERR, the command arg is executed whenever a pipeline (which  may  con‐\nsist  of  a  single  simple command), a list, or a compound command returns a non-zero\nexit status, subject to the following conditions.  The ERR trap is not executed if the\nfailed command is part of the command list immediately following a while or until key‐\nword, part of the test in an if statement, part of a command executed in a  &&  or  ||\nlist  except  the  command following the final && or ||, any command in a pipeline but\nthe last, or if the command's return value is being inverted using !.  These  are  the\nsame conditions obeyed by the errexit (-e) option.\n\nSignals  ignored  upon entry to the shell cannot be trapped or reset.  Trapped signals\nthat are not being ignored are reset to their original values in a  subshell  or  sub‐\nshell  environment  when one is created.  The return status is false if any sigspec is\ninvalid; otherwise trap returns true.\n\ntype [-aftpP] name [name ...]\nWith no options, indicate how each name would be interpreted  if  used  as  a  command\nname.   If the -t option is used, type prints a string which is one of alias, keyword,\nfunction, builtin, or file if  name  is  an  alias,  shell  reserved  word,  function,\nbuiltin,  or  disk  file,  respectively.   If  the  name is not found, then nothing is\nprinted, and an exit status of false is returned.  If the -p option is used, type  ei‐\nther  returns  the name of the disk file that would be executed if name were specified\nas a command name, or nothing if ``type -t name'' would not return file.  The  -P  op‐\ntion  forces  a  PATH  search for each name, even if ``type -t name'' would not return\nfile.  If a command is hashed, -p and -P print the hashed value, which is  not  neces‐\nsarily the file that appears first in PATH.  If the -a option is used, type prints all\nof the places that contain an executable named name.  This includes aliases and  func‐\ntions, if and only if the -p option is not also used.  The table of hashed commands is\nnot consulted when using -a.  The -f option suppresses shell function lookup, as  with\nthe  command  builtin.   type returns true if all of the arguments are found, false if\nany are not found.\n\nulimit [-HS] -a\nulimit [-HS] [-bcdefiklmnpqrstuvxPRT [limit]]\nProvides control over the resources available to the shell and to processes started by\nit,  on  systems that allow such control.  The -H and -S options specify that the hard\nor soft limit is set for the given resource.  A hard limit cannot be  increased  by  a\nnon-root  user  once  it  is set; a soft limit may be increased up to the value of the\nhard limit.  If neither -H nor -S is specified, both the soft and hard limits are set.\nThe  value  of  limit can be a number in the unit specified for the resource or one of\nthe special values hard, soft, or unlimited, which stand for the current  hard  limit,\nthe  current soft limit, and no limit, respectively.  If limit is omitted, the current\nvalue of the soft limit of the resource is printed, unless the  -H  option  is  given.\nWhen more than one resource is specified, the limit name and unit, if appropriate, are\nprinted before the value.  Other options are interpreted as follows:\n-a     All current limits are reported; no limits are set\n-b     The maximum socket buffer size\n-c     The maximum size of core files created\n-d     The maximum size of a process's data segment\n-e     The maximum scheduling priority (\"nice\")\n-f     The maximum size of files written by the shell and its children\n-i     The maximum number of pending signals\n-k     The maximum number of kqueues that may be allocated\n-l     The maximum size that may be locked into memory\n-m     The maximum resident set size (many systems do not honor this limit)\n-n     The maximum number of open file descriptors (most systems  do  not  allow  this\nvalue to be set)\n-p     The pipe size in 512-byte blocks (this may not be set)\n-q     The maximum number of bytes in POSIX message queues\n-r     The maximum real-time scheduling priority\n-s     The maximum stack size\n-t     The maximum amount of cpu time in seconds\n-u     The maximum number of processes available to a single user\n-v     The  maximum  amount of virtual memory available to the shell and, on some sys‐\ntems, to its children\n-x     The maximum number of file locks\n-P     The maximum number of pseudoterminals\n-R     The maximum time a real-time process can run before blocking, in microseconds\n-T     The maximum number of threads\n\nIf limit is given, and the -a option is not used, limit is the new value of the speci‐\nfied  resource.   If  no option is given, then -f is assumed.  Values are in 1024-byte\nincrements, except for -t, which is in seconds; -R,  which  is  in  microseconds;  -p,\nwhich  is  in units of 512-byte blocks; -P, -T, -b, -k, -n, and -u, which are unscaled\nvalues; and, when in posix mode, -c and -f, which are in 512-byte increments.  The re‐\nturn  status is 0 unless an invalid option or argument is supplied, or an error occurs\nwhile setting a new limit.\n\numask [-p] [-S] [mode]\nThe user file-creation mask is set to mode.  If mode begins with a digit, it is inter‐\npreted as an octal number; otherwise it is interpreted as a symbolic mode mask similar\nto that accepted by chmod(1).  If mode is omitted, the current value of  the  mask  is\nprinted.   The  -S  option causes the mask to be printed in symbolic form; the default\noutput is an octal number.  If the -p option is supplied, and  mode  is  omitted,  the\noutput  is  in a form that may be reused as input.  The return status is 0 if the mode\nwas successfully changed or if no mode argument was supplied, and false otherwise.\n\nunalias [-a] [name ...]\nRemove each name from the list of defined aliases.  If -a is supplied, all alias defi‐\nnitions are removed.  The return value is true unless a supplied name is not a defined\nalias.\n\nunset [-fv] [-n] [name ...]\nFor each name, remove the corresponding variable or function.  If  the  -v  option  is\ngiven,  each name refers to a shell variable, and that variable is removed.  Read-only\nvariables may not be unset.  If -f is specified, each name refers to a shell function,\nand  the  function definition is removed.  If the -n option is supplied, and name is a\nvariable with the nameref attribute, name will be unset rather than  the  variable  it\nreferences.   -n  has  no effect if the -f option is supplied.  If no options are sup‐\nplied, each name refers to a variable; if there is no variable by that name,  a  func‐\ntion  with  that  name,  if any, is unset.  Each unset variable or function is removed\nfrom  the  environment  passed  to  subsequent  commands.   If  any  of  BASHALIASES,\nBASHARGV0,   BASHCMDS,   BASHCOMMAND,   BASHSUBSHELL,   BASHPID,  COMPWORDBREAKS,\nDIRSTACK, EPOCHREALTIME, EPOCHSECONDS, FUNCNAME, GROUPS, HISTCMD, LINENO, RANDOM, SEC‐‐\nONDS,  or SRANDOM are unset, they lose their special properties, even if they are sub‐\nsequently reset.  The exit status is true unless a name is readonly.\n\nwait [-fn] [-p varname] [id ...]\nWait for each specified child process and return its termination status.  Each id  may\nbe  a process ID or a job specification; if a job spec is given, all processes in that\njob's pipeline are waited for.  If id is not given, wait waits for all  running  back‐\nground  jobs and the last-executed process substitution, if its process id is the same\nas $!, and the return status is zero.  If the -n option is supplied, wait waits for  a\nsingle  job  from the list of ids or, if no ids are supplied, any job, to complete and\nreturns its exit status.  If none of the supplied arguments is a child of  the  shell,\nor  if  no arguments are supplied and the shell has no unwaited-for children, the exit\nstatus is 127.  If the -p option is supplied, the process or job identifier of the job\nfor which the exit status is returned is assigned to the variable varname named by the\noption argument.  The variable will be unset initially, before any  assignment.   This\nis useful only when the -n option is supplied.  Supplying the -f option, when job con‐\ntrol is enabled, forces wait to wait for id to terminate before returning its  status,\ninstead  of  returning when it changes status.  If id specifies a non-existent process\nor job, the return status is 127.  Otherwise, the return status is the exit status  of\nthe last process or job waited for.\n"
                    }
                ]
            },
            "SHELL COMPATIBILITY MODE": {
                "content": "Bash-4.0  introduced  the concept of a `shell compatibility level', specified as a set of op‐\ntions to the shopt builtin compat31, compat32, compat40, compat41, and so on).  There is only\none  current  compatibility  level  --  each option is mutually exclusive.  The compatibility\nlevel is intended to allow users to select behavior from previous versions that is incompati‐\nble with newer versions while they migrate scripts to use current features and behavior. It's\nintended to be a temporary solution.\n\nThis section does not mention behavior that is standard for a particular version (e.g.,  set‐\nting  compat32 means that quoting the rhs of the regexp matching operator quotes special reg‐\nexp characters in the word, which is default behavior in bash-3.2 and above).\n\nIf a user enables, say, compat32, it may affect the behavior of other compatibility levels up\nto  and including the current compatibility level.  The idea is that each compatibility level\ncontrols behavior that changed in that version of bash,  but  that  behavior  may  have  been\npresent  in  earlier versions.  For instance, the change to use locale-based comparisons with\nthe [[ command came in bash-4.1, and earlier versions used ASCII-based  comparisons,  so  en‐\nabling  compat32  will  enable  ASCII-based comparisons as well.  That granularity may not be\nsufficient for all uses, and as a result users should employ compatibility levels  carefully.\nRead the documentation for a particular feature to find out the current behavior.\n\nBash-4.3  introduced  a new shell variable: BASHCOMPAT.  The value assigned to this variable\n(a decimal version number like 4.2, or an integer corresponding to the compatNN option,  like\n42) determines the compatibility level.\n\nStarting  with  bash-4.4, Bash has begun deprecating older compatibility levels.  Eventually,\nthe options will be removed in favor of BASHCOMPAT.\n\nBash-5.0 is the final version for which there will be an individual shopt option for the pre‐\nvious version. Users should use BASHCOMPAT on bash-5.0 and later versions.\n\nThe  following  table  describes  the behavior changes controlled by each compatibility level\nsetting.  The compatNN tag is used as shorthand for setting the compatibility level to NN us‐\ning one of the following mechanisms.  For versions prior to bash-5.0, the compatibility level\nmay be set using the corresponding compatNN shopt option.  For bash-4.3 and  later  versions,\nthe BASHCOMPAT variable is preferred, and it is required for bash-5.1 and later versions.\n",
                "subsections": [
                    {
                        "name": "compat31",
                        "content": "•      quoting  the  rhs of the [[ command's regexp matching operator (=~) has no spe‐\ncial effect\n"
                    },
                    {
                        "name": "compat32",
                        "content": "•      interrupting a command list such as \"a ; b ; c\" causes  the  execution  of  the\nnext  command in the list (in bash-4.0 and later versions, the shell acts as if\nit received the interrupt, so interrupting one command in a list aborts the ex‐\necution of the entire list)\n"
                    },
                    {
                        "name": "compat40",
                        "content": "•      the < and > operators to the [[ command do not consider the current locale when\ncomparing strings; they use ASCII ordering.  Bash versions  prior  to  bash-4.1\nuse  ASCII collation and strcmp(3); bash-4.1 and later use the current locale's\ncollation sequence and strcoll(3).\n"
                    },
                    {
                        "name": "compat41",
                        "content": "•      in posix mode, time may be followed by options and still be recognized as a re‐\nserved word (this is POSIX interpretation 267)\n•      in  posix  mode, the parser requires that an even number of single quotes occur\nin the word portion of a double-quoted parameter expansion and treats them spe‐\ncially, so that characters within the single quotes are considered quoted (this\nis POSIX interpretation 221)\n"
                    },
                    {
                        "name": "compat42",
                        "content": "•      the replacement string in double-quoted pattern substitution does  not  undergo\nquote removal, as it does in versions after bash-4.2\n•      in  posix  mode,  single  quotes are considered special when expanding the word\nportion of a double-quoted parameter expansion and can be used to quote a clos‐\ning  brace  or  other  special  character (this is part of POSIX interpretation\n221); in later versions, single quotes are  not  special  within  double-quoted\nword expansions\n"
                    },
                    {
                        "name": "compat43",
                        "content": "•      the  shell  does  not  print  a  warning message if an attempt is made to use a\nquoted compound assignment as an argument to declare (declare -a foo='(1  2)').\nLater versions warn that this usage is deprecated\n•      word  expansion  errors  are considered non-fatal errors that cause the current\ncommand to fail, even in posix mode (the default behavior is to make them fatal\nerrors that cause the shell to exit)\n•      when  executing a shell function, the loop state (while/until/etc.)  is not re‐\nset, so break or continue in that function will break or continue loops in  the\ncalling context. Bash-4.4 and later reset the loop state to prevent this\n"
                    },
                    {
                        "name": "compat44",
                        "content": "•      the shell sets up the values used by BASHARGV and BASHARGC so they can expand\nto the shell's positional parameters even if extended debugging mode is not en‐\nabled\n•      a  subshell  inherits  loops from its parent context, so break or continue will\ncause the subshell to exit.  Bash-5.0 and later reset the loop state to prevent\nthe exit\n•      variable  assignments  preceding builtins like export and readonly that set at‐\ntributes continue to affect variables with the same name in the  calling  envi‐\nronment even if the shell is not in posix mode\n"
                    },
                    {
                        "name": "compat50",
                        "content": "•      Bash-5.1  changed  the way $RANDOM is generated to introduce slightly more ran‐\ndomness. If the shell compatibility level is set to 50 or lower, it reverts  to\nthe  method  from  bash-5.0 and previous versions, so seeding the random number\ngenerator by assigning a value to RANDOM will produce the same sequence  as  in\nbash-5.0\n•      If  the command hash table is empty, bash versions prior to bash-5.1 printed an\ninformational message to that effect, even when producing output  that  can  be\nreused  as  input.  Bash-5.1 suppresses that message when the -l option is sup‐\nplied.\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "bash(1), sh(1)\n\n\n\nGNU Bash-2.05a                             2001 October 29                          BASH-BUILTINS(7)",
                "subsections": []
            }
        }
    }
}