{"id":280,"date":"2019-10-21T19:30:52","date_gmt":"2019-10-21T17:30:52","guid":{"rendered":"http:\/\/linuxboxen2.dk\/?p=280"},"modified":"2019-10-21T19:30:52","modified_gmt":"2019-10-21T17:30:52","slug":"bash","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=280","title":{"rendered":"BASH"},"content":{"rendered":"<p>BASH(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 General Commands Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 BASH(1)<\/p>\n<p>NAME<\/p>\n<p>bash &#8211; GNU Bourne-Again SHell<\/p>\n<p>SYNOPSIS<\/p>\n<p>bash [options] [command_string | file]<\/p>\n<p>COPYRIGHT<\/p>\n<p>Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc.<\/p>\n<p>DESCRIPTION<\/p>\n<p>Bash is an sh-compatible command language interpreter that executes<br \/>\ncommands read from the standard input or from a file.\u00a0 Bash also<br \/>\nincorporates useful features from the Korn and C shells (ksh and<br \/>\ncsh).<\/p>\n<p>Bash is intended to be a conformant implementation of the Shell and<br \/>\nUtilities portion of the IEEE POSIX specification (IEEE Standard<br \/>\n1003.1).\u00a0 Bash can be configured to be POSIX-conformant by default.<\/p>\n<p>OPTIONS<\/p>\n<p>All of the\u00a0 single-character shell options documented in the<br \/>\ndescription of the set builtin command can be used as options when<br \/>\nthe shell is invoked.\u00a0 In addition, bash interprets the following<br \/>\noptions when it is invoked:<\/p>\n<p>-c\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 If the -c option is present, then commands are read from<br \/>\nthe first non-option argument command_string.\u00a0 If there are<br \/>\narguments after the command_string, they are assigned to<br \/>\nthe positional parameters, starting with $0.<br \/>\n-i\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 If the -i option is present, the shell is interactive.<br \/>\n-l\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Make bash act as if it had been invoked as a login shell<br \/>\n(see INVOCATION below).<br \/>\n-r\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 If the -r option is present, the shell becomes restricted<br \/>\n(see RESTRICTED SHELL below).<br \/>\n-s\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 If the -s option is present, or if no arguments remain<br \/>\nafter option processing, then commands are read from the<br \/>\nstandard input.\u00a0 This option allows the positional<br \/>\nparameters to be set when invoking an interactive shell.<br \/>\n-D\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 A list of all double-quoted strings preceded by $ is<br \/>\nprinted on the standard output.\u00a0 These are the strings that<br \/>\nare subject to language translation when the current locale<br \/>\nis not C or POSIX.\u00a0 This implies the -n option; no commands<br \/>\nwill be executed.<br \/>\n[-+]O [shopt_option]<br \/>\nshopt_option is one of the shell options accepted by the<br \/>\nshopt builtin (see SHELL BUILTIN COMMANDS below).\u00a0 If<br \/>\nshopt_option is present, -O sets the value of that option;<br \/>\n+O unsets it.\u00a0 If shopt_option is not supplied, the names<br \/>\nand values of the shell options accepted by shopt are<br \/>\nprinted on the standard output.\u00a0 If the invocation option<br \/>\nis +O, the output is displayed in a format that may be<br \/>\nreused as input.<br \/>\n&#8212;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 A &#8212; signals the end of options and disables further option<br \/>\nprocessing.\u00a0 Any arguments after the &#8212; are treated as<br \/>\nfilenames and arguments.\u00a0 An argument of &#8211; is equivalent to<br \/>\n&#8211;.<\/p>\n<p>Bash also interprets a number of multi-character options.\u00a0 These<br \/>\noptions must appear on the command line before the single-character<br \/>\noptions to be recognized.<\/p>\n<p>&#8211;debugger<br \/>\nArrange for the debugger profile to be executed before the<br \/>\nshell starts.\u00a0 Turns on extended debugging mode (see the<br \/>\ndescription of the extdebug option to the shopt builtin<br \/>\nbelow).<br \/>\n&#8211;dump-po-strings<br \/>\nEquivalent to -D, but the output is in the GNU gettext po<br \/>\n(portable object) file format.<br \/>\n&#8211;dump-strings<br \/>\nEquivalent to -D.<br \/>\n&#8211;help Display a usage message on standard output and exit<br \/>\nsuccessfully.<br \/>\n&#8211;init-file file<br \/>\n&#8211;rcfile file<br \/>\nExecute commands from file instead of the standard personal<br \/>\ninitialization file ~\/.bashrc if the shell is interactive (see<br \/>\nINVOCATION below).<\/p>\n<p>&#8211;login<br \/>\nEquivalent to -l.<\/p>\n<p>&#8211;noediting<br \/>\nDo not use the GNU readline library to read command lines when<br \/>\nthe shell is interactive.<\/p>\n<p>&#8211;noprofile<br \/>\nDo not read either the system-wide startup file \/etc\/profile<br \/>\nor any of the personal initialization files ~\/.bash_profile,<br \/>\n~\/.bash_login, or ~\/.profile.\u00a0 By default, bash reads these<br \/>\nfiles when it is invoked as a login shell (see INVOCATION<br \/>\nbelow).<\/p>\n<p>&#8211;norc Do not read and execute the personal initialization file<br \/>\n~\/.bashrc if the shell is interactive.\u00a0 This option is on by<br \/>\ndefault if the shell is invoked as sh.<\/p>\n<p>&#8211;posix<br \/>\nChange the behavior of bash where the default operation<br \/>\ndiffers from the POSIX standard to match the standard (posix<br \/>\nmode).\u00a0 See SEE ALSO below for a reference to a document that<br \/>\ndetails how posix mode affects bash&#8217;s behavior.<\/p>\n<p>&#8211;restricted<br \/>\nThe shell becomes restricted (see RESTRICTED SHELL below).<\/p>\n<p>&#8211;verbose<br \/>\nEquivalent to\u00a0 -v.<\/p>\n<p>&#8211;version<br \/>\nShow version information for this instance of bash on the<br \/>\nstandard output and exit successfully.<\/p>\n<p>ARGUMENTS<\/p>\n<p>If arguments remain after option processing, and neither the -c nor<br \/>\nthe -s option has been supplied, the first argument is assumed to be<br \/>\nthe name of a file containing shell commands.\u00a0 If bash is invoked in<br \/>\nthis fashion, $0 is set to the name of the file, and the positional<br \/>\nparameters are set to the remaining arguments.\u00a0 Bash reads and<br \/>\nexecutes commands from this file, then exits.\u00a0 Bash&#8217;s exit status is<br \/>\nthe exit status of the last command executed in the script.\u00a0 If no<br \/>\ncommands are executed, the exit status is 0.\u00a0 An attempt is first<br \/>\nmade to open the file in the current directory, and, if no file is<br \/>\nfound, then the shell searches the directories in PATH for the<br \/>\nscript.<\/p>\n<p>INVOCATION<\/p>\n<p>A login shell is one whose first character of argument zero is a -,<br \/>\nor one started with the &#8211;login option.<\/p>\n<p>An interactive shell is one started without non-option arguments and<br \/>\nwithout the -c option whose standard input and error are both<br \/>\nconnected to terminals (as determined by isatty(3)), or one started<br \/>\nwith the -i option.\u00a0 PS1 is set and $- includes i if bash is<br \/>\ninteractive, allowing a shell script or a startup file to test this<br \/>\nstate.<\/p>\n<p>The following paragraphs describe how bash executes its startup<br \/>\nfiles.\u00a0 If any of the files exist but cannot be read, bash reports an<br \/>\nerror.\u00a0 Tildes are expanded in filenames as described below under<br \/>\nTilde Expansion in the EXPANSION section.<\/p>\n<p>When bash is invoked as an interactive login shell, or as a non-<br \/>\ninteractive shell with the &#8211;login option, it first reads and<br \/>\nexecutes commands from the file \/etc\/profile, if that file exists.<br \/>\nAfter reading that file, it looks for ~\/.bash_profile, ~\/.bash_login,<br \/>\nand ~\/.profile, in that order, and reads and executes commands from<br \/>\nthe first one that exists and is readable.\u00a0 The &#8211;noprofile option<br \/>\nmay be used when the shell is started to inhibit this behavior.<\/p>\n<p>When a login shell exits, bash reads and executes commands from the<br \/>\nfile ~\/.bash_logout, if it exists.<\/p>\n<p>When an interactive shell that is not a login shell is started, bash<br \/>\nreads and executes commands from ~\/.bashrc, if that file exists.<br \/>\nThis may be inhibited by using the &#8211;norc option.\u00a0 The &#8211;rcfile file<br \/>\noption will force bash to read and execute commands from file instead<br \/>\nof ~\/.bashrc.<\/p>\n<p>When bash is started non-interactively, to run a shell script, for<br \/>\nexample, it looks for the variable BASH_ENV in the environment,<br \/>\nexpands its value if it appears there, and uses the expanded value as<br \/>\nthe name of a file to read and execute.\u00a0 Bash behaves as if the<br \/>\nfollowing command were executed:<br \/>\nif [ -n &#8220;$BASH_ENV&#8221; ]; then . &#8220;$BASH_ENV&#8221;; fi<br \/>\nbut the value of the PATH variable is not used to search for the<br \/>\nfilename.<\/p>\n<p>If bash is invoked with the name sh, it tries to mimic the startup<br \/>\nbehavior of historical versions of sh as closely as possible, while<br \/>\nconforming to the POSIX standard as well.\u00a0 When invoked as an<br \/>\ninteractive login shell, or a non-interactive shell with the &#8211;login<br \/>\noption, it first attempts to read and execute commands from<br \/>\n\/etc\/profile and ~\/.profile, in that order.\u00a0 The &#8211;noprofile option<br \/>\nmay be used to inhibit this behavior.\u00a0 When invoked as an interactive<br \/>\nshell with the name sh, bash looks for the variable ENV, expands its<br \/>\nvalue if it is defined, and uses the expanded value as the name of a<br \/>\nfile to read and execute.\u00a0 Since a shell invoked as sh does not<br \/>\nattempt to read and execute commands from any other startup files,<br \/>\nthe &#8211;rcfile option has no effect.\u00a0 A non-interactive shell invoked<br \/>\nwith the name sh does not attempt to read any other startup files.<br \/>\nWhen invoked as sh, bash enters posix mode after the startup files<br \/>\nare read.<\/p>\n<p>When bash is started in posix mode, as with the &#8211;posix command line<br \/>\noption, it follows the POSIX standard for startup files.\u00a0 In this<br \/>\nmode, interactive shells expand the ENV variable and commands are<br \/>\nread and executed from the file whose name is the expanded value.\u00a0 No<br \/>\nother startup files are read.<\/p>\n<p>Bash attempts to determine when it is being run with its standard<br \/>\ninput connected to a network connection, as when executed by the<br \/>\nremote shell daemon, usually rshd, or the secure shell daemon sshd.<br \/>\nIf bash determines it is being run in this fashion, it reads and<br \/>\nexecutes commands from ~\/.bashrc, if that file exists and is<br \/>\nreadable.\u00a0 It will not do this if invoked as sh.\u00a0 The &#8211;norc option<br \/>\nmay be used to inhibit this behavior, and the &#8211;rcfile option may be<br \/>\nused to force another file to be read, but neither rshd nor sshd<br \/>\ngenerally invoke the shell with those options or allow them to be<br \/>\nspecified.<\/p>\n<p>If the shell is started with the effective user (group) id not equal<br \/>\nto the real user (group) id, and the -p option is not supplied, no<br \/>\nstartup files are read, shell functions are not inherited from the<br \/>\nenvironment, the SHELLOPTS, BASHOPTS, CDPATH, and GLOBIGNORE<br \/>\nvariables, if they appear in the environment, are ignored, and the<br \/>\neffective user id is set to the real user id.\u00a0 If the -p option is<br \/>\nsupplied at invocation, the startup behavior is the same, but the<br \/>\neffective user id is not reset.<\/p>\n<p>DEFINITIONS<\/p>\n<p>The following definitions are used throughout the rest of this<br \/>\ndocument.<br \/>\nblank\u00a0 A space or tab.<br \/>\nword\u00a0\u00a0 A sequence of characters considered as a single unit by the<br \/>\nshell.\u00a0 Also known as a token.<br \/>\nname\u00a0\u00a0 A word consisting only of alphanumeric characters and<br \/>\nunderscores, and beginning with an alphabetic character or an<br \/>\nunderscore.\u00a0 Also referred to as an identifier.<br \/>\nmetacharacter<br \/>\nA character that, when unquoted, separates words.\u00a0 One of the<br \/>\nfollowing:<br \/>\n|\u00a0 &amp; ; ( ) &lt; &gt; space tab<br \/>\ncontrol operator<br \/>\nA token that performs a control function.\u00a0 It is one of the<br \/>\nfollowing symbols:<br \/>\n|| &amp; &amp;&amp; ; ;; ( ) | |&amp; &lt;newline&gt;<\/p>\n<p>RESERVED WORDS<\/p>\n<p>Reserved words are words that have a special meaning to the shell.<br \/>\nThe following words are recognized as reserved when unquoted and<br \/>\neither the first word of a simple command (see SHELL GRAMMAR below)<br \/>\nor the third word of a case or for command:<\/p>\n<p>! case\u00a0 coproc\u00a0 do done elif else esac fi for function if in select<br \/>\nthen until while { } time [[ ]]<\/p>\n<p>SHELL GRAMMAR<\/p>\n<p>Simple Commands<br \/>\nA simple command is a sequence of optional variable assignments<br \/>\nfollowed by blank-separated words and redirections, and terminated by<br \/>\na control operator.\u00a0 The first word specifies the command to be<br \/>\nexecuted, and is passed as argument zero.\u00a0 The remaining words are<br \/>\npassed as arguments to the invoked command.<\/p>\n<p>The return value of a simple command is its exit status, or 128+n if<br \/>\nthe command is terminated by signal n.<\/p>\n<p>Pipelines<br \/>\nA pipeline is a sequence of one or more commands separated by one of<br \/>\nthe control operators | or |&amp;.\u00a0 The format for a pipeline is:<\/p>\n<p>[time [-p]] [ ! ] command [ [|\u23aa|&amp;] command2 &#8230; ]<\/p>\n<p>The standard output of command is connected via a pipe to the<br \/>\nstandard input of command2.\u00a0 This connection is performed before any<br \/>\nredirections specified by the command (see REDIRECTION below).\u00a0 If |&amp;<br \/>\nis used, command&#8217;s standard error, in addition to its standard<br \/>\noutput, is connected to command2&#8217;s standard input through the pipe;<br \/>\nit is shorthand for 2&gt;&amp;1 |.\u00a0 This implicit redirection of the<br \/>\nstandard error to the standard output is performed after any<br \/>\nredirections specified by the command.<\/p>\n<p>The return status of a pipeline is the exit status of the last<br \/>\ncommand, unless the pipefail option is enabled.\u00a0 If pipefail is<br \/>\nenabled, the pipeline&#8217;s return status is the value of the last<br \/>\n(rightmost) command to exit with a non-zero status, or zero if all<br \/>\ncommands exit successfully.\u00a0 If the reserved word !\u00a0 precedes a<br \/>\npipeline, the exit status of that pipeline is the logical negation of<br \/>\nthe exit status as described above.\u00a0 The shell waits for all commands<br \/>\nin the pipeline to terminate before returning a value.<\/p>\n<p>If the time reserved word precedes a pipeline, the elapsed as well as<br \/>\nuser and system time consumed by its execution are reported when the<br \/>\npipeline terminates.\u00a0 The -p option changes the output format to that<br \/>\nspecified by POSIX.\u00a0 When the shell is in posix mode, it does not<br \/>\nrecognize time as a reserved word if the next token begins with a<br \/>\n`-&#8216;.\u00a0 The TIMEFORMAT variable may be set to a format string that<br \/>\nspecifies how the timing information should be displayed; see the<br \/>\ndescription of TIMEFORMAT under Shell Variables below.<\/p>\n<p>When the shell is in posix mode, time may be followed by a newline.<br \/>\nIn this case, the shell displays the total user and system time<br \/>\nconsumed by the shell and its children.\u00a0 The TIMEFORMAT variable may<br \/>\nbe used to specify the format of the time information.<\/p>\n<p>Each command in a pipeline is executed as a separate process (i.e.,<br \/>\nin a subshell).<\/p>\n<p>Lists<br \/>\nA list is a sequence of one or more pipelines separated by one of the<br \/>\noperators ;, &amp;, &amp;&amp;, or ||, and optionally terminated by one of ;, &amp;,<br \/>\nor &lt;newline&gt;.<\/p>\n<p>Of these list operators, &amp;&amp; and || have equal precedence, followed by<br \/>\n; and &amp;, which have equal precedence.<\/p>\n<p>A sequence of one or more newlines may appear in a list instead of a<br \/>\nsemicolon to delimit commands.<\/p>\n<p>If a command is terminated by the control operator &amp;, the shell<br \/>\nexecutes the command in the background in a subshell.\u00a0 The shell does<br \/>\nnot wait for the command to finish, and the return status is 0.<br \/>\nCommands separated by a ; are executed sequentially; the shell waits<br \/>\nfor each command to terminate in turn.\u00a0 The return status is the exit<br \/>\nstatus of the last command executed.<\/p>\n<p>AND and OR lists are sequences of one of more pipelines separated by<br \/>\nthe &amp;&amp; and || control operators, respectively.\u00a0 AND and OR lists are<br \/>\nexecuted with left associativity.\u00a0 An AND list has the form<\/p>\n<p>command1 &amp;&amp; command2<\/p>\n<p>command2 is executed if, and only if, command1 returns an exit status<br \/>\nof zero.<\/p>\n<p>An OR list has the form<\/p>\n<p>command1 || command2<\/p>\n<p>command2 is executed if and only if command1 returns a non-zero exit<br \/>\nstatus.\u00a0 The return status of AND and OR lists is the exit status of<br \/>\nthe last command executed in the list.<\/p>\n<p>Compound Commands<br \/>\nA compound command is one of the following.\u00a0 In most cases a list in<br \/>\na command&#8217;s description may be separated from the rest of the command<br \/>\nby one or more newlines, and may be followed by a newline in place of<br \/>\na semicolon.<\/p>\n<p>(list) list is executed in a subshell environment (see COMMAND<br \/>\nEXECUTION ENVIRONMENT below).\u00a0 Variable assignments and<br \/>\nbuiltin commands that affect the shell&#8217;s environment do not<br \/>\nremain in effect after the command completes.\u00a0 The return<br \/>\nstatus is the exit status of list.<\/p>\n<p>{ list; }<br \/>\nlist is simply executed in the current shell environment.<br \/>\nlist must be terminated with a newline or semicolon.\u00a0 This is<br \/>\nknown as a group command.\u00a0 The return status is the exit<br \/>\nstatus of list.\u00a0 Note that unlike the metacharacters ( and ),<br \/>\n{ and } are reserved words and must occur where a reserved<br \/>\nword is permitted to be recognized.\u00a0 Since they do not cause a<br \/>\nword break, they must be separated from list by whitespace or<br \/>\nanother shell metacharacter.<\/p>\n<p>((expression))<br \/>\nThe expression is evaluated according to the rules described<br \/>\nbelow under ARITHMETIC EVALUATION.\u00a0 If the value of the<br \/>\nexpression is non-zero, the return status is 0; otherwise the<br \/>\nreturn status is 1.\u00a0 This is exactly equivalent to let<br \/>\n&#8220;expression&#8221;.<\/p>\n<p>[[ expression ]]<br \/>\nReturn a status of 0 or 1 depending on the evaluation of the<br \/>\nconditional expression expression.\u00a0 Expressions are composed<br \/>\nof the primaries described below under CONDITIONAL<br \/>\nEXPRESSIONS.\u00a0 Word splitting and pathname expansion are not<br \/>\nperformed on the words between the [[ and ]]; tilde expansion,<br \/>\nparameter and variable expansion, arithmetic expansion,<br \/>\ncommand substitution, process substitution, and quote removal<br \/>\nare performed.\u00a0 Conditional operators such as -f must be<br \/>\nunquoted to be recognized as primaries.<\/p>\n<p>When used with [[, the &lt; and &gt; operators sort<br \/>\nlexicographically using the current locale.<\/p>\n<p>When the == and != operators are used, the string to the right<br \/>\nof the operator is considered a pattern and matched according<br \/>\nto the rules described below under Pattern Matching, as if the<br \/>\nextglob shell option were enabled.\u00a0 The = operator is<br \/>\nequivalent to ==.\u00a0 If the shell option nocasematch is enabled,<br \/>\nthe match is performed without regard to the case of<br \/>\nalphabetic characters.\u00a0 The return value is 0 if the string<br \/>\nmatches (==) or does not match (!=) the pattern, and 1<br \/>\notherwise.\u00a0 Any part of the pattern may be quoted to force the<br \/>\nquoted portion to be matched as a string.<\/p>\n<p>An additional binary operator, =~, is available, with the same<br \/>\nprecedence as == and !=.\u00a0 When it is used, the string to the<br \/>\nright of the operator is considered an extended regular<br \/>\nexpression and matched accordingly (as in regex(3)).\u00a0 The<br \/>\nreturn value is 0 if the string matches the pattern, and 1<br \/>\notherwise.\u00a0 If the regular expression is syntactically<br \/>\nincorrect, the conditional expression&#8217;s return value is 2.\u00a0 If<br \/>\nthe shell option nocasematch is enabled, the match is<br \/>\nperformed without regard to the case of alphabetic characters.<br \/>\nAny part of the pattern may be quoted to force the quoted<br \/>\nportion to be matched as a string.\u00a0 Bracket expressions in<br \/>\nregular expressions must be treated carefully, since normal<br \/>\nquoting characters lose their meanings between brackets.\u00a0 If<br \/>\nthe pattern is stored in a shell variable, quoting the<br \/>\nvariable expansion forces the entire pattern to be matched as<br \/>\na string.\u00a0 Substrings matched by parenthesized subexpressions<br \/>\nwithin the regular expression are saved in the array variable<br \/>\nBASH_REMATCH.\u00a0 The element of BASH_REMATCH with index 0 is the<br \/>\nportion of the string matching the entire regular expression.<br \/>\nThe element of BASH_REMATCH with index n is the portion of the<br \/>\nstring matching the nth parenthesized subexpression.<\/p>\n<p>Expressions may be combined using the following operators,<br \/>\nlisted in decreasing order of precedence:<\/p>\n<p>( expression )<br \/>\nReturns the value of expression.\u00a0 This may be used to<br \/>\noverride the normal precedence of operators.<br \/>\n! expression<br \/>\nTrue if expression is false.<br \/>\nexpression1 &amp;&amp; expression2<br \/>\nTrue if both expression1 and expression2 are true.<br \/>\nexpression1 || expression2<br \/>\nTrue if either expression1 or expression2 is true.<\/p>\n<p>The &amp;&amp; and || operators do not evaluate expression2 if the<br \/>\nvalue of expression1 is sufficient to determine the return<br \/>\nvalue of the entire conditional expression.<\/p>\n<p>for name [ [ in [ word &#8230; ] ] ; ] do list ; done<br \/>\nThe list of words following in is expanded, generating a list<br \/>\nof items.\u00a0 The variable name is set to each element of this<br \/>\nlist in turn, and list is executed each time.\u00a0 If the in word<br \/>\nis omitted, the for command executes list once for each<br \/>\npositional parameter that is set (see PARAMETERS below).\u00a0 The<br \/>\nreturn status is the exit status of the last command that<br \/>\nexecutes.\u00a0 If the expansion of the items following in results<br \/>\nin an empty list, no commands are executed, and the return<br \/>\nstatus is 0.<\/p>\n<p>for (( expr1 ; expr2 ; expr3 )) ; do list ; done<br \/>\nFirst, the arithmetic expression expr1 is evaluated according<br \/>\nto the rules described below under ARITHMETIC EVALUATION.\u00a0 The<br \/>\narithmetic expression expr2 is then evaluated repeatedly until<br \/>\nit evaluates to zero.\u00a0 Each time expr2 evaluates to a non-zero<br \/>\nvalue, list is executed and the arithmetic expression expr3 is<br \/>\nevaluated.\u00a0 If any expression is omitted, it behaves as if it<br \/>\nevaluates to 1.\u00a0 The return value is the exit status of the<br \/>\nlast command in list that is executed, or false if any of the<br \/>\nexpressions is invalid.<\/p>\n<p>select name [ in word ] ; do list ; done<br \/>\nThe list of words following in is expanded, generating a list<br \/>\nof items.\u00a0 The set of expanded words is printed on the<br \/>\nstandard error, each preceded by a number.\u00a0 If the in word is<br \/>\nomitted, the positional parameters are printed (see PARAMETERS<br \/>\nbelow).\u00a0 The PS3 prompt is then displayed and a line read from<br \/>\nthe standard input.\u00a0 If the line consists of a number<br \/>\ncorresponding to one of the displayed words, then the value of<br \/>\nname is set to that word.\u00a0 If the line is empty, the words and<br \/>\nprompt are displayed again.\u00a0 If EOF is read, the command<br \/>\ncompletes.\u00a0 Any other value read causes name to be set to<br \/>\nnull.\u00a0 The line read is saved in the variable REPLY.\u00a0 The list<br \/>\nis executed after each selection until a break command is<br \/>\nexecuted.\u00a0 The exit status of select is the exit status of the<br \/>\nlast command executed in list, or zero if no commands were<br \/>\nexecuted.<\/p>\n<p>case word in [ [(] pattern [ | pattern ] &#8230; ) list ;; ] &#8230; esac<br \/>\nA case command first expands word, and tries to match it<br \/>\nagainst each pattern in turn, using the same matching rules as<br \/>\nfor pathname expansion (see Pathname Expansion below).\u00a0 The<br \/>\nword is expanded using tilde expansion, parameter and variable<br \/>\nexpansion, arithmetic substitution, command substitution,<br \/>\nprocess substitution and quote removal.\u00a0 Each pattern examined<br \/>\nis expanded using tilde expansion, parameter and variable<br \/>\nexpansion, arithmetic substitution, command substitution, and<br \/>\nprocess substitution.\u00a0 If the shell option nocasematch is<br \/>\nenabled, the match is performed without regard to the case of<br \/>\nalphabetic characters.\u00a0 When a match is found, the<br \/>\ncorresponding list is executed.\u00a0 If the ;; operator is used,<br \/>\nno subsequent matches are attempted after the first pattern<br \/>\nmatch.\u00a0 Using ;&amp; in place of ;; causes execution to continue<br \/>\nwith the list associated with the next set of patterns.\u00a0 Using<br \/>\n;;&amp; in place of ;; causes the shell to test the next pattern<br \/>\nlist in the statement, if any, and execute any associated list<br \/>\non a successful match.\u00a0 The exit status is zero if no pattern<br \/>\nmatches.\u00a0 Otherwise, it is the exit status of the last command<br \/>\nexecuted in list.<\/p>\n<p>if list; then list; [ elif list; then list; ] &#8230; [ else list; ] fi<br \/>\nThe if list is executed.\u00a0 If its exit status is zero, the then<br \/>\nlist is executed.\u00a0 Otherwise, each elif list is executed in<br \/>\nturn, and if its exit status is zero, the corresponding then<br \/>\nlist is executed and the command completes.\u00a0 Otherwise, the<br \/>\nelse list is executed, if present.\u00a0 The exit status is the<br \/>\nexit status of the last command executed, or zero if no<br \/>\ncondition tested true.<\/p>\n<p>while list-1; do list-2; done<br \/>\nuntil list-1; do list-2; done<br \/>\nThe while command continuously executes the list list-2 as<br \/>\nlong as the last command in the list list-1 returns an exit<br \/>\nstatus of zero.\u00a0 The until command is identical to the while<br \/>\ncommand, except that the test is negated; list-2 is executed<br \/>\nas long as the last command in list-1 returns a non-zero exit<br \/>\nstatus.\u00a0 The exit status of the while and until commands is<br \/>\nthe exit status of the last command executed in list-2, or<br \/>\nzero if none was executed.<\/p>\n<p>Coprocesses<br \/>\nA coprocess is a shell command preceded by the coproc reserved word.<br \/>\nA coprocess is executed asynchronously in a subshell, as if the<br \/>\ncommand had been terminated with the &amp; control operator, with a two-<br \/>\nway pipe established between the executing shell and the coprocess.<\/p>\n<p>The format for a coprocess is:<\/p>\n<p>coproc [NAME] command [redirections]<\/p>\n<p>This creates a coprocess named NAME.\u00a0 If NAME is not supplied, the<br \/>\ndefault name is COPROC.\u00a0 NAME must not be supplied if command is a<br \/>\nsimple command (see above); otherwise, it is interpreted as the first<br \/>\nword of the simple command.\u00a0 When the coprocess is executed, the<br \/>\nshell creates an array variable (see Arrays below) named NAME in the<br \/>\ncontext of the executing shell.\u00a0 The standard output of command is<br \/>\nconnected via a pipe to a file descriptor in the executing shell, and<br \/>\nthat file descriptor is assigned to NAME[0].\u00a0 The standard input of<br \/>\ncommand is connected via a pipe to a file descriptor in the executing<br \/>\nshell, and that file descriptor is assigned to NAME[1].\u00a0 This pipe is<br \/>\nestablished before any redirections specified by the command (see<br \/>\nREDIRECTION below).\u00a0 The file descriptors can be utilized as<br \/>\narguments to shell commands and redirections using standard word<br \/>\nexpansions.\u00a0 The file descriptors are not available in subshells.<br \/>\nThe process ID of the shell spawned to execute the coprocess is<br \/>\navailable as the value of the variable NAME_PID.\u00a0 The wait builtin<br \/>\ncommand may be used to wait for the coprocess to terminate.<\/p>\n<p>Since the coprocess is created as an asynchronous command, the coproc<br \/>\ncommand always returns success.\u00a0 The return status of a coprocess is<br \/>\nthe exit status of command.<\/p>\n<p>Shell Function Definitions<br \/>\nA shell function is an object that is called like a simple command<br \/>\nand executes a compound command with a new set of positional<br \/>\nparameters.\u00a0 Shell functions are declared as follows:<\/p>\n<p>name () compound-command [redirection]<br \/>\nfunction name [()] compound-command [redirection]<br \/>\nThis defines a function named name.\u00a0 The reserved word<br \/>\nfunction is optional.\u00a0 If the function reserved word is<br \/>\nsupplied, the parentheses are optional.\u00a0 The body of the<br \/>\nfunction is the compound command compound-command (see<br \/>\nCompound Commands above).\u00a0 That command is usually a list of<br \/>\ncommands between { and }, but may be any command listed under<br \/>\nCompound Commands above.\u00a0 compound-command is executed<br \/>\nwhenever name is specified as the name of a simple command.<br \/>\nWhen in posix mode, name may not be the name of one of the<br \/>\nPOSIX special builtins.\u00a0 Any redirections (see REDIRECTION<br \/>\nbelow) specified when a function is defined are performed when<br \/>\nthe function is executed.\u00a0 The exit status of a function<br \/>\ndefinition is zero unless a syntax error occurs or a readonly<br \/>\nfunction with the same name already exists.\u00a0 When executed,<br \/>\nthe exit status of a function is the exit status of the last<br \/>\ncommand executed in the body.\u00a0 (See FUNCTIONS below.)<\/p>\n<p>COMMENTS<\/p>\n<p>In a non-interactive shell, or an interactive shell in which the<br \/>\ninteractive_comments option to the shopt builtin is enabled (see<br \/>\nSHELL BUILTIN COMMANDS below), a word beginning with # causes that<br \/>\nword and all remaining characters on that line to be ignored.\u00a0 An<br \/>\ninteractive shell without the interactive_comments option enabled<br \/>\ndoes not allow comments.\u00a0 The interactive_comments option is on by<br \/>\ndefault in interactive shells.<\/p>\n<p>QUOTING<\/p>\n<p>Quoting is used to remove the special meaning of certain characters<br \/>\nor words to the shell.\u00a0 Quoting can be used to disable special<br \/>\ntreatment for special characters, to prevent reserved words from<br \/>\nbeing recognized as such, and to prevent parameter expansion.<\/p>\n<p>Each of the metacharacters listed above under DEFINITIONS has special<br \/>\nmeaning to the shell and must be quoted if it is to represent itself.<\/p>\n<p>When the command history expansion facilities are being used (see<br \/>\nHISTORY EXPANSION below), the history expansion character, usually !,<br \/>\nmust be quoted to prevent history expansion.<\/p>\n<p>There are three quoting mechanisms: the escape character, single<br \/>\nquotes, and double quotes.<\/p>\n<p>A non-quoted backslash (\\) is the escape character.\u00a0 It preserves the<br \/>\nliteral value of the next character that follows, with the exception<br \/>\nof &lt;newline&gt;.\u00a0 If a \\&lt;newline&gt; pair appears, and the backslash is not<br \/>\nitself quoted, the \\&lt;newline&gt; is treated as a line continuation (that<br \/>\nis, it is removed from the input stream and effectively ignored).<\/p>\n<p>Enclosing characters in single quotes preserves the literal value of<br \/>\neach character within the quotes.\u00a0 A single quote may not occur<br \/>\nbetween single quotes, even when preceded by a backslash.<\/p>\n<p>Enclosing characters in double quotes preserves the literal value of<br \/>\nall characters within the quotes, with the exception of $, `, \\, and,<br \/>\nwhen history expansion is enabled, !.\u00a0 The characters $ and ` retain<br \/>\ntheir special meaning within double quotes.\u00a0 The backslash retains<br \/>\nits special meaning only when followed by one of the following<br \/>\ncharacters: $, `, &#8220;, \\, or &lt;newline&gt;.\u00a0 A double quote may be quoted<br \/>\nwithin double quotes by preceding it with a backslash.\u00a0 If enabled,<br \/>\nhistory expansion will be performed unless an !\u00a0 appearing in double<br \/>\nquotes is escaped using a backslash.\u00a0 The backslash preceding the !<br \/>\nis not removed.<\/p>\n<p>The special parameters * and @ have special meaning when in double<br \/>\nquotes (see PARAMETERS below).<\/p>\n<p>Words of the form $&#8217;string&#8217; are treated specially.\u00a0 The word expands<br \/>\nto string, with backslash-escaped characters replaced as specified by<br \/>\nthe ANSI C standard.\u00a0 Backslash escape sequences, if present, are<br \/>\ndecoded as follows:<br \/>\n\\a\u00a0\u00a0\u00a0\u00a0 alert (bell)<br \/>\n\\b\u00a0\u00a0\u00a0\u00a0 backspace<br \/>\n\\e<br \/>\n\\E\u00a0\u00a0\u00a0\u00a0 an escape character<br \/>\n\\f\u00a0\u00a0\u00a0\u00a0 form feed<br \/>\n\\n\u00a0\u00a0\u00a0\u00a0 new line<br \/>\n\\r\u00a0\u00a0\u00a0\u00a0 carriage return<br \/>\n\\t\u00a0\u00a0\u00a0\u00a0 horizontal tab<br \/>\n\\v\u00a0\u00a0\u00a0\u00a0 vertical tab<br \/>\n\\\\\u00a0\u00a0\u00a0\u00a0 backslash<br \/>\n\\&#8217;\u00a0\u00a0\u00a0\u00a0 single quote<br \/>\n\\&#8221;\u00a0\u00a0\u00a0\u00a0 double quote<br \/>\n\\nnn\u00a0\u00a0 the eight-bit character whose value is the octal value<br \/>\nnnn (one to three digits)<br \/>\n\\xHH\u00a0\u00a0 the eight-bit character whose value is the hexadecimal<br \/>\nvalue HH (one or two hex digits)<br \/>\n\\uHHHH the Unicode (ISO\/IEC 10646) character whose value is<br \/>\nthe hexadecimal value HHHH (one to four hex digits)<br \/>\n\\UHHHHHHHH<br \/>\nthe Unicode (ISO\/IEC 10646) character whose value is<br \/>\nthe hexadecimal value HHHHHHHH (one to eight hex<br \/>\ndigits)<br \/>\n\\cx\u00a0\u00a0\u00a0 a control-x character<\/p>\n<p>The expanded result is single-quoted, as if the dollar sign had not<br \/>\nbeen present.<\/p>\n<p>A double-quoted string preceded by a dollar sign ($&#8221;string&#8221;) will<br \/>\ncause the string to be translated according to the current locale.<br \/>\nIf the current locale is C or POSIX, the dollar sign is ignored.\u00a0 If<br \/>\nthe string is translated and replaced, the replacement is double-<br \/>\nquoted.<\/p>\n<p>PARAMETERS<\/p>\n<p>A parameter is an entity that stores values.\u00a0 It can be a name, a<br \/>\nnumber, or one of the special characters listed below under Special<br \/>\nParameters.\u00a0 A variable is a parameter denoted by a name.\u00a0 A variable<br \/>\nhas a value and zero or more attributes.\u00a0 Attributes are assigned<br \/>\nusing the declare builtin command (see declare below in SHELL BUILTIN<br \/>\nCOMMANDS).<\/p>\n<p>A parameter is set if it has been assigned a value.\u00a0 The null string<br \/>\nis a valid value.\u00a0 Once a variable is set, it may be unset only by<br \/>\nusing the unset builtin command (see SHELL BUILTIN COMMANDS below).<\/p>\n<p>A variable may be assigned to by a statement of the form<\/p>\n<p>name=[value]<\/p>\n<p>If value is not given, the variable is assigned the null string.\u00a0 All<br \/>\nvalues undergo tilde expansion, parameter and variable expansion,<br \/>\ncommand substitution, arithmetic expansion, and quote removal (see<br \/>\nEXPANSION below).\u00a0 If the variable has its integer attribute set,<br \/>\nthen value is evaluated as an arithmetic expression even if the<br \/>\n$((&#8230;)) expansion is not used (see Arithmetic Expansion below).<br \/>\nWord splitting is not performed, with the exception of &#8220;$@&#8221; as<br \/>\nexplained below under Special Parameters.\u00a0 Pathname expansion is not<br \/>\nperformed.\u00a0 Assignment statements may also appear as arguments to the<br \/>\nalias, declare, typeset, export, readonly, and local builtin<br \/>\ncommands.\u00a0 When in posix mode, these builtins may appear in a command<br \/>\nafter one or more instances of the command builtin and retain these<br \/>\nassignment statement properties.<\/p>\n<p>In the context where an assignment statement is assigning a value to<br \/>\na shell variable or array index, the += operator can be used to<br \/>\nappend to or add to the variable&#8217;s previous value.\u00a0 When += is<br \/>\napplied to a variable for which the integer attribute has been set,<br \/>\nvalue is evaluated as an arithmetic expression and added to the<br \/>\nvariable&#8217;s current value, which is also evaluated.\u00a0 When += is<br \/>\napplied to an array variable using compound assignment (see Arrays<br \/>\nbelow), the variable&#8217;s value is not unset (as it is when using =),<br \/>\nand new values are appended to the array beginning at one greater<br \/>\nthan the array&#8217;s maximum index (for indexed arrays) or added as<br \/>\nadditional key-value pairs in an associative array.\u00a0 When applied to<br \/>\na string-valued variable, value is expanded and appended to the<br \/>\nvariable&#8217;s value.<\/p>\n<p>A variable can be assigned the nameref attribute using the -n option<br \/>\nto the declare or local builtin commands (see the descriptions of<br \/>\ndeclare and local below) to create a nameref, or a reference to<br \/>\nanother variable.\u00a0 This allows variables to be manipulated<br \/>\nindirectly.\u00a0 Whenever the nameref variable is referenced or assigned<br \/>\nto, the operation is actually performed on the variable specified by<br \/>\nthe nameref variable&#8217;s value.\u00a0 A nameref is commonly used within<br \/>\nshell functions to refer to a variable whose name is passed as an<br \/>\nargument to the function.\u00a0 For instance, if a variable name is passed<br \/>\nto a shell function as its first argument, running<br \/>\ndeclare -n ref=$1<br \/>\ninside the function creates a nameref variable ref whose value is the<br \/>\nvariable name passed as the first argument.\u00a0 References and<br \/>\nassignments to ref are treated as references and assignments to the<br \/>\nvariable whose name was passed as $1.\u00a0 If the control variable in a<br \/>\nfor loop has the nameref attribute, the list of words can be a list<br \/>\nof shell variables, and a name reference will be established for each<br \/>\nword in the list, in turn, when the loop is executed.\u00a0 Array<br \/>\nvariables cannot be given the -n attribute.\u00a0 However, nameref<br \/>\nvariables can reference array variables and subscripted array<br \/>\nvariables.\u00a0 Namerefs can be unset using the -n option to the unset<br \/>\nbuiltin.\u00a0 Otherwise, if unset is executed with the name of a nameref<br \/>\nvariable as an argument, the variable referenced by the nameref<br \/>\nvariable will be unset.<\/p>\n<p>Positional Parameters<br \/>\nA positional parameter is a parameter denoted by one or more digits,<br \/>\nother than the single digit 0.\u00a0 Positional parameters are assigned<br \/>\nfrom the shell&#8217;s arguments when it is invoked, and may be reassigned<br \/>\nusing the set builtin command.\u00a0 Positional parameters may not be<br \/>\nassigned to with assignment statements.\u00a0 The positional parameters<br \/>\nare temporarily replaced when a shell function is executed (see<br \/>\nFUNCTIONS below).<\/p>\n<p>When a positional parameter consisting of more than a single digit is<br \/>\nexpanded, it must be enclosed in braces (see EXPANSION below).<\/p>\n<p>Special Parameters<br \/>\nThe shell treats several parameters specially.\u00a0 These parameters may<br \/>\nonly be referenced; assignment to them is not allowed.<br \/>\n*\u00a0\u00a0\u00a0\u00a0\u00a0 Expands to the positional parameters, starting from one.\u00a0 When<br \/>\nthe expansion is not within double quotes, each positional<br \/>\nparameter expands to a separate word.\u00a0 In contexts where it is<br \/>\nperformed, those words are subject to further word splitting<br \/>\nand pathname expansion.\u00a0 When the expansion occurs within<br \/>\ndouble quotes, it expands to a single word with the value of<br \/>\neach parameter separated by the first character of the IFS<br \/>\nspecial variable.\u00a0 That is, &#8220;$*&#8221; is equivalent to &#8220;$1c$2c&#8230;&#8221;,<br \/>\nwhere c is the first character of the value of the IFS<br \/>\nvariable.\u00a0 If IFS is unset, the parameters are separated by<br \/>\nspaces.\u00a0 If IFS is null, the parameters are joined without<br \/>\nintervening separators.<br \/>\n@\u00a0\u00a0\u00a0\u00a0\u00a0 Expands to the positional parameters, starting from one.\u00a0 When<br \/>\nthe expansion occurs within double quotes, each parameter<br \/>\nexpands to a separate word.\u00a0 That is, &#8220;$@&#8221; is equivalent to<br \/>\n&#8220;$1&#8221; &#8220;$2&#8221; &#8230;\u00a0 If the double-quoted expansion occurs within a<br \/>\nword, the expansion of the first parameter is joined with the<br \/>\nbeginning part of the original word, and the expansion of the<br \/>\nlast parameter is joined with the last part of the original<br \/>\nword.\u00a0 When there are no positional parameters, &#8220;$@&#8221; and\u00a0$@<br \/>\nexpand to nothing (i.e., they are removed).<br \/>\n#\u00a0\u00a0\u00a0\u00a0\u00a0 Expands to the number of positional parameters in decimal.<br \/>\n?\u00a0\u00a0\u00a0\u00a0\u00a0 Expands to the exit status of the most recently executed<br \/>\nforeground pipeline.<br \/>\n&#8211;\u00a0\u00a0\u00a0\u00a0\u00a0 Expands to the current option flags as specified upon<br \/>\ninvocation, by the set builtin command, or those set by the<br \/>\nshell itself (such as the -i option).<br \/>\n$\u00a0\u00a0\u00a0\u00a0\u00a0 Expands to the process ID of the shell.\u00a0 In a () subshell, it<br \/>\nexpands to the process ID of the current shell, not the<br \/>\nsubshell.<br \/>\n!\u00a0\u00a0\u00a0\u00a0\u00a0 Expands to the process ID of the job most recently placed into<br \/>\nthe background, whether executed as an asynchronous command or<br \/>\nusing the bg builtin (see JOB CONTROL below).<br \/>\n0\u00a0\u00a0\u00a0\u00a0\u00a0 Expands to the name of the shell or shell script.\u00a0 This is set<br \/>\nat shell initialization.\u00a0 If bash is invoked with a file of<br \/>\ncommands, $0 is set to the name of that file.\u00a0 If bash is<br \/>\nstarted with the -c option, then $0 is set to the first<br \/>\nargument after the string to be executed, if one is present.<br \/>\nOtherwise, it is set to the filename used to invoke bash, as<br \/>\ngiven by argument zero.<br \/>\n_\u00a0\u00a0\u00a0\u00a0\u00a0 At shell startup, set to the absolute pathname used to invoke<br \/>\nthe shell or shell script being executed as passed in the<br \/>\nenvironment or argument list.\u00a0 Subsequently, expands to the<br \/>\nlast argument to the previous command, after expansion.\u00a0 Also<br \/>\nset to the full pathname used to invoke each command executed<br \/>\nand placed in the environment exported to that command.\u00a0 When<br \/>\nchecking mail, this parameter holds the name of the mail file<br \/>\ncurrently being checked.<\/p>\n<p>Shell Variables<br \/>\nThe following variables are set by the shell:<\/p>\n<p>BASH\u00a0\u00a0 Expands to the full filename used to invoke this instance of<br \/>\nbash.<br \/>\nBASHOPTS<br \/>\nA colon-separated list of enabled shell options.\u00a0 Each word in<br \/>\nthe list is a valid argument for the -s option to the shopt<br \/>\nbuiltin command (see SHELL BUILTIN COMMANDS below).\u00a0 The<br \/>\noptions appearing in BASHOPTS are those reported as on by<br \/>\nshopt.\u00a0 If this variable is in the environment when bash<br \/>\nstarts up, each shell option in the list will be enabled<br \/>\nbefore reading any startup files.\u00a0 This variable is read-only.<br \/>\nBASHPID<br \/>\nExpands to the process ID of the current bash process.\u00a0 This<br \/>\ndiffers from $$ under certain circumstances, such as subshells<br \/>\nthat do not require bash to be re-initialized.<br \/>\nBASH_ALIASES<br \/>\nAn associative array variable whose members correspond to the<br \/>\ninternal list of aliases as maintained by the alias builtin.<br \/>\nElements added to this array appear in the alias list;<br \/>\nunsetting array elements cause aliases to be removed from the<br \/>\nalias list.<br \/>\nBASH_ARGC<br \/>\nAn array variable whose values are the number of parameters in<br \/>\neach frame of the current bash execution call stack.\u00a0 The<br \/>\nnumber of parameters to the current subroutine (shell function<br \/>\nor script executed with . or source) is at the top of the<br \/>\nstack.\u00a0 When a subroutine is executed, the number of<br \/>\nparameters passed is pushed onto BASH_ARGC.\u00a0 The shell sets<br \/>\nBASH_ARGC only when in extended debugging mode (see the<br \/>\ndescription of the extdebug option to the shopt builtin below)<br \/>\nBASH_ARGV<br \/>\nAn array variable containing all of the parameters in the<br \/>\ncurrent bash execution call stack.\u00a0 The final parameter of the<br \/>\nlast subroutine call is at the top of the stack; the first<br \/>\nparameter of the initial call is at the bottom.\u00a0 When a<br \/>\nsubroutine is executed, the parameters supplied are pushed<br \/>\nonto BASH_ARGV.\u00a0 The shell sets BASH_ARGV only when in<br \/>\nextended debugging mode (see the description of the extdebug<br \/>\noption to the shopt builtin below)<br \/>\nBASH_CMDS<br \/>\nAn associative array variable whose members correspond to the<br \/>\ninternal hash table of commands as maintained by the hash<br \/>\nbuiltin.\u00a0 Elements added to this array appear in the hash<br \/>\ntable; unsetting array elements cause commands to be removed<br \/>\nfrom the hash table.<br \/>\nBASH_COMMAND<br \/>\nThe command currently being executed or about to be executed,<br \/>\nunless the shell is executing a command as the result of a<br \/>\ntrap, in which case it is the command executing at the time of<br \/>\nthe trap.<br \/>\nBASH_EXECUTION_STRING<br \/>\nThe command argument to the -c invocation option.<br \/>\nBASH_LINENO<br \/>\nAn array variable whose members are the line numbers in source<br \/>\nfiles where each corresponding member of FUNCNAME was invoked.<br \/>\n${BASH_LINENO[$i]} is the line number in the source file<br \/>\n(${BASH_SOURCE[$i+1]}) where ${FUNCNAME[$i]} was called (or<br \/>\n${BASH_LINENO[$i-1]} if referenced within another shell<br \/>\nfunction).\u00a0 Use LINENO to obtain the current line number.<br \/>\nBASH_REMATCH<br \/>\nAn array variable whose members are assigned by the =~ binary<br \/>\noperator to the [[ conditional command.\u00a0 The element with<br \/>\nindex 0 is the portion of the string matching the entire<br \/>\nregular expression.\u00a0 The element with index n is the portion<br \/>\nof the string matching the nth parenthesized subexpression.<br \/>\nThis variable is read-only.<br \/>\nBASH_SOURCE<br \/>\nAn array variable whose members are the source filenames where<br \/>\nthe corresponding shell function names in the FUNCNAME array<br \/>\nvariable are defined.\u00a0 The shell function ${FUNCNAME[$i]} is<br \/>\ndefined in the file ${BASH_SOURCE[$i]} and called from<br \/>\n${BASH_SOURCE[$i+1]}.<br \/>\nBASH_SUBSHELL<br \/>\nIncremented by one within each subshell or subshell<br \/>\nenvironment when the shell begins executing in that<br \/>\nenvironment.\u00a0 The initial value is 0.<br \/>\nBASH_VERSINFO<br \/>\nA readonly array variable whose members hold version<br \/>\ninformation for this instance of bash.\u00a0 The values assigned to<br \/>\nthe array members are as follows:<br \/>\nBASH_VERSINFO[0]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 The major version number (the<br \/>\nrelease).<br \/>\nBASH_VERSINFO[1]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 The minor version number (the<br \/>\nversion).<br \/>\nBASH_VERSINFO[2]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 The patch level.<br \/>\nBASH_VERSINFO[3]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 The build version.<br \/>\nBASH_VERSINFO[4]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 The release status (e.g., beta1).<br \/>\nBASH_VERSINFO[5]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 The value of MACHTYPE.<br \/>\nBASH_VERSION<br \/>\nExpands to a string describing the version of this instance of<br \/>\nbash.<br \/>\nCOMP_CWORD<br \/>\nAn index into ${COMP_WORDS} of the word containing the current<br \/>\ncursor position.\u00a0 This variable is available only in shell<br \/>\nfunctions invoked by the programmable completion facilities<br \/>\n(see Programmable Completion below).<br \/>\nCOMP_KEY<br \/>\nThe key (or final key of a key sequence) used to invoke the<br \/>\ncurrent completion function.<br \/>\nCOMP_LINE<br \/>\nThe current command line.\u00a0 This variable is available only in<br \/>\nshell functions and external commands invoked by the<br \/>\nprogrammable completion facilities (see Programmable<br \/>\nCompletion below).<br \/>\nCOMP_POINT<br \/>\nThe index of the current cursor position relative to the<br \/>\nbeginning of the current command.\u00a0 If the current cursor<br \/>\nposition is at the end of the current command, the value of<br \/>\nthis variable is equal to ${#COMP_LINE}.\u00a0 This variable is<br \/>\navailable only in shell functions and external commands<br \/>\ninvoked by the programmable completion facilities (see<br \/>\nProgrammable Completion below).<br \/>\nCOMP_TYPE<br \/>\nSet to an integer value corresponding to the type of<br \/>\ncompletion attempted that caused a completion function to be<br \/>\ncalled: TAB, for normal completion, ?, for listing completions<br \/>\nafter successive tabs, !, for listing alternatives on partial<br \/>\nword completion, @, to list completions if the word is not<br \/>\nunmodified, or %, for menu completion.\u00a0 This variable is<br \/>\navailable only in shell functions and external commands<br \/>\ninvoked by the programmable completion facilities (see<br \/>\nProgrammable Completion below).<br \/>\nCOMP_WORDBREAKS<br \/>\nThe set of characters that the readline library treats as word<br \/>\nseparators when performing word completion.\u00a0 If<br \/>\nCOMP_WORDBREAKS is unset, it loses its special properties,<br \/>\neven if it is subsequently reset.<br \/>\nCOMP_WORDS<br \/>\nAn array variable (see Arrays below) consisting of the<br \/>\nindividual words in the current command line.\u00a0 The line is<br \/>\nsplit into words as readline would split it, using<br \/>\nCOMP_WORDBREAKS as described above.\u00a0 This variable is<br \/>\navailable only in shell functions invoked by the programmable<br \/>\ncompletion facilities (see Programmable Completion below).<br \/>\nCOPROC An array variable (see Arrays below) created to hold the file<br \/>\ndescriptors for output from and input to an unnamed coprocess<br \/>\n(see Coprocesses above).<br \/>\nDIRSTACK<br \/>\nAn array variable (see Arrays below) containing the current<br \/>\ncontents of the directory stack.\u00a0 Directories appear in the<br \/>\nstack in the order they are displayed by the dirs builtin.<br \/>\nAssigning to members of this array variable may be used to<br \/>\nmodify directories already in the stack, but the pushd and<br \/>\npopd builtins must be used to add and remove directories.<br \/>\nAssignment to this variable will not change the current<br \/>\ndirectory.\u00a0 If DIRSTACK is unset, it loses its special<br \/>\nproperties, even if it is subsequently reset.<br \/>\nEUID\u00a0\u00a0 Expands to the effective user ID of the current user,<br \/>\ninitialized at shell startup.\u00a0 This variable is readonly.<br \/>\nFUNCNAME<br \/>\nAn array variable containing the names of all shell functions<br \/>\ncurrently in the execution call stack.\u00a0 The element with index<br \/>\n0 is the name of any currently-executing shell function.\u00a0 The<br \/>\nbottom-most element (the one with the highest index) is<br \/>\n&#8220;main&#8221;.\u00a0 This variable exists only when a shell function is<br \/>\nexecuting.\u00a0 Assignments to FUNCNAME have no effect and return<br \/>\nan error status.\u00a0 If FUNCNAME is unset, it loses its special<br \/>\nproperties, even if it is subsequently reset.<\/p>\n<p>This variable can be used with BASH_LINENO and BASH_SOURCE.<br \/>\nEach element of FUNCNAME has corresponding elements in<br \/>\nBASH_LINENO and BASH_SOURCE to describe the call stack.\u00a0 For<br \/>\ninstance, ${FUNCNAME[$i]} was called from the file<br \/>\n${BASH_SOURCE[$i+1]} at line number ${BASH_LINENO[$i]}.\u00a0 The<br \/>\ncaller builtin displays the current call stack using this<br \/>\ninformation.<br \/>\nGROUPS An array variable containing the list of groups of which the<br \/>\ncurrent user is a member.\u00a0 Assignments to GROUPS have no<br \/>\neffect and return an error status.\u00a0 If GROUPS is unset, it<br \/>\nloses its special properties, even if it is subsequently<br \/>\nreset.<br \/>\nHISTCMD<br \/>\nThe history number, or index in the history list, of the<br \/>\ncurrent command.\u00a0 If HISTCMD is unset, it loses its special<br \/>\nproperties, even if it is subsequently reset.<br \/>\nHOSTNAME<br \/>\nAutomatically set to the name of the current host.<br \/>\nHOSTTYPE<br \/>\nAutomatically set to a string that uniquely describes the type<br \/>\nof machine on which bash is executing.\u00a0 The default is system-<br \/>\ndependent.<br \/>\nLINENO Each time this parameter is referenced, the shell substitutes<br \/>\na decimal number representing the current sequential line<br \/>\nnumber (starting with 1) within a script or function.\u00a0 When<br \/>\nnot in a script or function, the value substituted is not<br \/>\nguaranteed to be meaningful.\u00a0 If LINENO is unset, it loses its<br \/>\nspecial properties, even if it is subsequently reset.<br \/>\nMACHTYPE<br \/>\nAutomatically set to a string that fully describes the system<br \/>\ntype on which bash is executing, in the standard GNU cpu-<br \/>\ncompany-system format.\u00a0 The default is system-dependent.<br \/>\nMAPFILE<br \/>\nAn array variable (see Arrays below) created to hold the text<br \/>\nread by the mapfile builtin when no variable name is supplied.<br \/>\nOLDPWD The previous working directory as set by the cd command.<br \/>\nOPTARG The value of the last option argument processed by the getopts<br \/>\nbuiltin command (see SHELL BUILTIN COMMANDS below).<br \/>\nOPTIND The index of the next argument to be processed by the getopts<br \/>\nbuiltin command (see SHELL BUILTIN COMMANDS below).<br \/>\nOSTYPE Automatically set to a string that describes the operating<br \/>\nsystem on which bash is executing.\u00a0 The default is system-<br \/>\ndependent.<br \/>\nPIPESTATUS<br \/>\nAn array variable (see Arrays below) containing a list of exit<br \/>\nstatus values from the processes in the most-recently-executed<br \/>\nforeground pipeline (which may contain only a single command).<br \/>\nPPID\u00a0\u00a0 The process ID of the shell&#8217;s parent.\u00a0 This variable is<br \/>\nreadonly.<br \/>\nPWD\u00a0\u00a0\u00a0 The current working directory as set by the cd command.<br \/>\nRANDOM Each time this parameter is referenced, a random integer<br \/>\nbetween 0 and 32767 is generated.\u00a0 The sequence of random<br \/>\nnumbers may be initialized by assigning a value to RANDOM.\u00a0 If<br \/>\nRANDOM is unset, it loses its special properties, even if it<br \/>\nis subsequently reset.<br \/>\nREADLINE_LINE<br \/>\nThe contents of the readline line buffer, for use with &#8220;bind<br \/>\n-x&#8221; (see SHELL BUILTIN COMMANDS below).<br \/>\nREADLINE_POINT<br \/>\nThe position of the insertion point in the readline line<br \/>\nbuffer, for use with &#8220;bind -x&#8221; (see SHELL BUILTIN COMMANDS<br \/>\nbelow).<br \/>\nREPLY\u00a0 Set to the line of input read by the read builtin command when<br \/>\nno arguments are supplied.<br \/>\nSECONDS<br \/>\nEach time this parameter is referenced, the number of seconds<br \/>\nsince shell invocation is returned.\u00a0 If a value is assigned to<br \/>\nSECONDS, the value returned upon subsequent references is the<br \/>\nnumber of seconds since the assignment plus the value<br \/>\nassigned.\u00a0 If SECONDS is unset, it loses its special<br \/>\nproperties, even if it is subsequently reset.<br \/>\nSHELLOPTS<br \/>\nA colon-separated list of enabled shell options.\u00a0 Each word in<br \/>\nthe list is a valid argument for the -o option to the set<br \/>\nbuiltin command (see SHELL BUILTIN COMMANDS below).\u00a0 The<br \/>\noptions appearing in SHELLOPTS are those reported as on by set<br \/>\n-o.\u00a0 If this variable is in the environment when bash starts<br \/>\nup, each shell option in the list will be enabled before<br \/>\nreading any startup files.\u00a0 This variable is read-only.<br \/>\nSHLVL\u00a0 Incremented by one each time an instance of bash is started.<br \/>\nUID\u00a0\u00a0\u00a0 Expands to the user ID of the current user, initialized at<br \/>\nshell startup.\u00a0 This variable is readonly.<\/p>\n<p>The following variables are used by the shell.\u00a0 In some cases, bash<br \/>\nassigns a default value to a variable; these cases are noted below.<\/p>\n<p>BASH_COMPAT<br \/>\nThe value is used to set the shell&#8217;s compatibility level.\u00a0 See<br \/>\nthe description of the shopt builtin below under SHELL BUILTIN<br \/>\nCOMMANDS for a description of the various compatibility levels<br \/>\nand their effects.\u00a0 The value may be a decimal number (e.g.,<br \/>\n4.2) or an integer (e.g., 42) corresponding to the desired<br \/>\ncompatibility level.\u00a0 If BASH_COMPAT is unset or set to the<br \/>\nempty string, the compatibility level is set to the default<br \/>\nfor the current version.\u00a0 If BASH_COMPAT is set to a value<br \/>\nthat is not one of the valid compatibility levels, the shell<br \/>\nprints an error message and sets the compatibility level to<br \/>\nthe default for the current version.\u00a0 The valid compatibility<br \/>\nlevels correspond to the compatibility options accepted by the<br \/>\nshopt builtin described below (for example, compat42 means<br \/>\nthat 4.2 and 42 are valid values).\u00a0 The current version is<br \/>\nalso a valid value.<br \/>\nBASH_ENV<br \/>\nIf this parameter is set when bash is executing a shell<br \/>\nscript, its value is interpreted as a filename containing<br \/>\ncommands to initialize the shell, as in ~\/.bashrc.\u00a0 The value<br \/>\nof BASH_ENV is subjected to parameter expansion, command<br \/>\nsubstitution, and arithmetic expansion before being<br \/>\ninterpreted as a filename.\u00a0 PATH is not used to search for the<br \/>\nresultant filename.<br \/>\nBASH_XTRACEFD<br \/>\nIf set to an integer corresponding to a valid file descriptor,<br \/>\nbash will write the trace output generated when set -x is<br \/>\nenabled to that file descriptor.\u00a0 The file descriptor is<br \/>\nclosed when BASH_XTRACEFD is unset or assigned a new value.<br \/>\nUnsetting BASH_XTRACEFD or assigning it the empty string<br \/>\ncauses the trace output to be sent to the standard error.<br \/>\nNote that setting BASH_XTRACEFD to 2 (the standard error file<br \/>\ndescriptor) and then unsetting it will result in the standard<br \/>\nerror being closed.<br \/>\nCDPATH The search path for the cd command.\u00a0 This is a colon-separated<br \/>\nlist of directories in which the shell looks for destination<br \/>\ndirectories specified by the cd command.\u00a0 A sample value is<br \/>\n&#8220;.:~:\/usr&#8221;.<br \/>\nCHILD_MAX<br \/>\nSet the number of exited child status values for the shell to<br \/>\nremember.\u00a0 Bash will not allow this value to be decreased<br \/>\nbelow a POSIX-mandated minimum, and there is a maximum value<br \/>\n(currently 8192) that this may not exceed.\u00a0 The minimum value<br \/>\nis system-dependent.<br \/>\nCOLUMNS<br \/>\nUsed by the select compound command to determine the terminal<br \/>\nwidth when printing selection lists.\u00a0 Automatically set if the<br \/>\ncheckwinsize option is enabled or in an interactive shell upon<br \/>\nreceipt of a SIGWINCH.<br \/>\nCOMPREPLY<br \/>\nAn array variable from which bash reads the possible<br \/>\ncompletions generated by a shell function invoked by the<br \/>\nprogrammable completion facility (see Programmable Completion<br \/>\nbelow).\u00a0 Each array element contains one possible completion.<br \/>\nEMACS\u00a0 If bash finds this variable in the environment when the shell<br \/>\nstarts with value &#8220;t&#8221;, it assumes that the shell is running in<br \/>\nan Emacs shell buffer and disables line editing.<br \/>\nENV\u00a0\u00a0\u00a0 Similar to BASH_ENV; used when the shell is invoked in POSIX<br \/>\nmode.<br \/>\nFCEDIT The default editor for the fc builtin command.<br \/>\nFIGNORE<br \/>\nA colon-separated list of suffixes to ignore when performing<br \/>\nfilename completion (see READLINE below).\u00a0 A filename whose<br \/>\nsuffix matches one of the entries in FIGNORE is excluded from<br \/>\nthe list of matched filenames.\u00a0 A sample value is &#8220;.o:~&#8221;.<br \/>\nFUNCNEST<br \/>\nIf set to a numeric value greater than 0, defines a maximum<br \/>\nfunction nesting level.\u00a0 Function invocations that exceed this<br \/>\nnesting level will cause the current command to abort.<br \/>\nGLOBIGNORE<br \/>\nA colon-separated list of patterns defining the set of<br \/>\nfilenames to be ignored by pathname expansion.\u00a0 If a filename<br \/>\nmatched by a pathname expansion pattern also matches one of<br \/>\nthe patterns in GLOBIGNORE, it is removed from the list of<br \/>\nmatches.<br \/>\nHISTCONTROL<br \/>\nA colon-separated list of values controlling how commands are<br \/>\nsaved on the history list.\u00a0 If the list of values includes<br \/>\nignorespace, lines which begin with a space character are not<br \/>\nsaved in the history list.\u00a0 A value of ignoredups causes lines<br \/>\nmatching the previous history entry to not be saved.\u00a0 A value<br \/>\nof ignoreboth is shorthand for ignorespace and ignoredups.\u00a0 A<br \/>\nvalue of erasedups causes all previous lines matching the<br \/>\ncurrent line to be removed from the history list before that<br \/>\nline is saved.\u00a0 Any value not in the above list is ignored.<br \/>\nIf HISTCONTROL is unset, or does not include a valid value,<br \/>\nall lines read by the shell parser are saved on the history<br \/>\nlist, subject to the value of HISTIGNORE.\u00a0 The second and<br \/>\nsubsequent lines of a multi-line compound command are not<br \/>\ntested, and are added to the history regardless of the value<br \/>\nof HISTCONTROL.<br \/>\nHISTFILE<br \/>\nThe name of the file in which command history is saved (see<br \/>\nHISTORY below).\u00a0 The default value is ~\/.bash_history.\u00a0 If<br \/>\nunset, the command history is not saved when a shell exits.<br \/>\nHISTFILESIZE<br \/>\nThe maximum number of lines contained in the history file.<br \/>\nWhen this variable is assigned a value, the history file is<br \/>\ntruncated, if necessary, to contain no more than that number<br \/>\nof lines by removing the oldest entries.\u00a0 The history file is<br \/>\nalso truncated to this size after writing it when a shell<br \/>\nexits.\u00a0 If the value is 0, the history file is truncated to<br \/>\nzero size.\u00a0 Non-numeric values and numeric values less than<br \/>\nzero inhibit truncation.\u00a0 The shell sets the default value to<br \/>\nthe value of HISTSIZE after reading any startup files.<br \/>\nHISTIGNORE<br \/>\nA colon-separated list of patterns used to decide which<br \/>\ncommand lines should be saved on the history list.\u00a0 Each<br \/>\npattern is anchored at the beginning of the line and must<br \/>\nmatch the complete line (no implicit `*&#8217; is appended).\u00a0 Each<br \/>\npattern is tested against the line after the checks specified<br \/>\nby HISTCONTROL are applied.\u00a0 In addition to the normal shell<br \/>\npattern matching characters, `&amp;&#8217; matches the previous history<br \/>\nline.\u00a0 `&amp;&#8217; may be escaped using a backslash; the backslash is<br \/>\nremoved before attempting a match.\u00a0 The second and subsequent<br \/>\nlines of a multi-line compound command are not tested, and are<br \/>\nadded to the history regardless of the value of HISTIGNORE.<br \/>\nHISTSIZE<br \/>\nThe number of commands to remember in the command history (see<br \/>\nHISTORY below).\u00a0 If the value is 0, commands are not saved in<br \/>\nthe history list.\u00a0 Numeric values less than zero result in<br \/>\nevery command being saved on the history list (there is no<br \/>\nlimit).\u00a0 The shell sets the default value to 500 after reading<br \/>\nany startup files.<br \/>\nHISTTIMEFORMAT<br \/>\nIf this variable is set and not null, its value is used as a<br \/>\nformat string for strftime(3) to print the time stamp<br \/>\nassociated with each history entry displayed by the history<br \/>\nbuiltin.\u00a0 If this variable is set, time stamps are written to<br \/>\nthe history file so they may be preserved across shell<br \/>\nsessions.\u00a0 This uses the history comment character to<br \/>\ndistinguish timestamps from other history lines.<br \/>\nHOME\u00a0\u00a0 The home directory of the current user; the default argument<br \/>\nfor the cd builtin command.\u00a0 The value of this variable is<br \/>\nalso used when performing tilde expansion.<br \/>\nHOSTFILE<br \/>\nContains the name of a file in the same format as \/etc\/hosts<br \/>\nthat should be read when the shell needs to complete a<br \/>\nhostname.\u00a0 The list of possible hostname completions may be<br \/>\nchanged while the shell is running; the next time hostname<br \/>\ncompletion is attempted after the value is changed, bash adds<br \/>\nthe contents of the new file to the existing list.\u00a0 If<br \/>\nHOSTFILE is set, but has no value, or does not name a readable<br \/>\nfile, bash attempts to read \/etc\/hosts to obtain the list of<br \/>\npossible hostname completions.\u00a0 When HOSTFILE is unset, the<br \/>\nhostname list is cleared.<br \/>\nIFS\u00a0\u00a0\u00a0 The Internal Field Separator that is used for word splitting<br \/>\nafter expansion and to split lines into words with the read<br \/>\nbuiltin command.\u00a0 The default value is<br \/>\n&#8220;&lt;space&gt;&lt;tab&gt;&lt;newline&gt;&#8221;.<br \/>\nIGNOREEOF<br \/>\nControls the action of an interactive shell on receipt of an<br \/>\nEOF character as the sole input.\u00a0 If set, the value is the<br \/>\nnumber of consecutive EOF characters which must be typed as<br \/>\nthe first characters on an input line before bash exits.\u00a0 If<br \/>\nthe variable exists but does not have a numeric value, or has<br \/>\nno value, the default value is 10.\u00a0 If it does not exist, EOF<br \/>\nsignifies the end of input to the shell.<br \/>\nINPUTRC<br \/>\nThe filename for the readline startup file, overriding the<br \/>\ndefault of ~\/.inputrc (see READLINE below).<br \/>\nLANG\u00a0\u00a0 Used to determine the locale category for any category not<br \/>\nspecifically selected with a variable starting with LC_.<br \/>\nLC_ALL This variable overrides the value of LANG and any other LC_<br \/>\nvariable specifying a locale category.<br \/>\nLC_COLLATE<br \/>\nThis variable determines the collation order used when sorting<br \/>\nthe results of pathname expansion, and determines the behavior<br \/>\nof range expressions, equivalence classes, and collating<br \/>\nsequences within pathname expansion and pattern matching.<br \/>\nLC_CTYPE<br \/>\nThis variable determines the interpretation of characters and<br \/>\nthe behavior of character classes within pathname expansion<br \/>\nand pattern matching.<br \/>\nLC_MESSAGES<br \/>\nThis variable determines the locale used to translate double-<br \/>\nquoted strings preceded by a $.<br \/>\nLC_NUMERIC<br \/>\nThis variable determines the locale category used for number<br \/>\nformatting.<br \/>\nLINES\u00a0 Used by the select compound command to determine the column<br \/>\nlength for printing selection lists.\u00a0 Automatically set if the<br \/>\ncheckwinsize option is enabled or in an interactive shell upon<br \/>\nreceipt of a SIGWINCH.<br \/>\nMAIL\u00a0\u00a0 If this parameter is set to a file or directory name and the<br \/>\nMAILPATH variable is not set, bash informs the user of the<br \/>\narrival of mail in the specified file or Maildir-format<br \/>\ndirectory.<br \/>\nMAILCHECK<br \/>\nSpecifies how often (in seconds) bash checks for mail.\u00a0 The<br \/>\ndefault is 60 seconds.\u00a0 When it is time to check for mail, the<br \/>\nshell does so before displaying the primary prompt.\u00a0 If this<br \/>\nvariable is unset, or set to a value that is not a number<br \/>\ngreater than or equal to zero, the shell disables mail<br \/>\nchecking.<br \/>\nMAILPATH<br \/>\nA colon-separated list of filenames to be checked for mail.<br \/>\nThe message to be printed when mail arrives in a particular<br \/>\nfile may be specified by separating the filename from the<br \/>\nmessage with a `?&#8217;.\u00a0 When used in the text of the message, $_<br \/>\nexpands to the name of the current mailfile.\u00a0 Example:<br \/>\nMAILPATH=&#8217;\/var\/mail\/bfox?&#8221;You have mail&#8221;:~\/shell-mail?&#8221;$_ has<br \/>\nmail!&#8221;&#8216;<br \/>\nBash supplies a default value for this variable, but the<br \/>\nlocation of the user mail files that it uses is system<br \/>\ndependent (e.g., \/var\/mail\/$USER).<br \/>\nOPTERR If set to the value 1, bash displays error messages generated<br \/>\nby the getopts builtin command (see SHELL BUILTIN COMMANDS<br \/>\nbelow).\u00a0 OPTERR is initialized to 1 each time the shell is<br \/>\ninvoked or a shell script is executed.<br \/>\nPATH\u00a0\u00a0 The search path for commands.\u00a0 It is a colon-separated list of<br \/>\ndirectories in which the shell looks for commands (see COMMAND<br \/>\nEXECUTION below).\u00a0 A zero-length (null) directory name in the<br \/>\nvalue of PATH indicates the current directory.\u00a0 A null<br \/>\ndirectory name may appear as two adjacent colons, or as an<br \/>\ninitial or trailing colon.\u00a0 The default path is system-<br \/>\ndependent, and is set by the administrator who installs bash.<br \/>\nA common value is<br \/>\n&#8220;\/usr\/local\/bin:\/usr\/local\/sbin:\/usr\/bin:\/usr\/sbin:\/bin:\/sbin&#8221;.<br \/>\nPOSIXLY_CORRECT<br \/>\nIf this variable is in the environment when bash starts, the<br \/>\nshell enters posix mode before reading the startup files, as<br \/>\nif the &#8211;posix invocation option had been supplied.\u00a0 If it is<br \/>\nset while the shell is running, bash enables posix mode, as if<br \/>\nthe command set -o posix had been executed.<br \/>\nPROMPT_COMMAND<br \/>\nIf set, the value is executed as a command prior to issuing<br \/>\neach primary prompt.<br \/>\nPROMPT_DIRTRIM<br \/>\nIf set to a number greater than zero, the value is used as the<br \/>\nnumber of trailing directory components to retain when<br \/>\nexpanding the \\w and \\W prompt string escapes (see PROMPTING<br \/>\nbelow).\u00a0 Characters removed are replaced with an ellipsis.<br \/>\nPS1\u00a0\u00a0\u00a0 The value of this parameter is expanded (see PROMPTING below)<br \/>\nand used as the primary prompt string.\u00a0 The default value is<br \/>\n&#8220;\\s-\\v\\$ &#8221;.<br \/>\nPS2\u00a0\u00a0\u00a0 The value of this parameter is expanded as with PS1 and used<br \/>\nas the secondary prompt string.\u00a0 The default is &#8220;&gt; &#8221;.<br \/>\nPS3\u00a0\u00a0\u00a0 The value of this parameter is used as the prompt for the<br \/>\nselect command (see SHELL GRAMMAR above).<br \/>\nPS4\u00a0\u00a0\u00a0 The value of this parameter is expanded as with PS1 and the<br \/>\nvalue is printed before each command bash displays during an<br \/>\nexecution trace.\u00a0 The first character of PS4 is replicated<br \/>\nmultiple times, as necessary, to indicate multiple levels of<br \/>\nindirection.\u00a0 The default is &#8220;+ &#8221;.<br \/>\nSHELL\u00a0 The full pathname to the shell is kept in this environment<br \/>\nvariable.\u00a0 If it is not set when the shell starts, bash<br \/>\nassigns to it the full pathname of the current user&#8217;s login<br \/>\nshell.<br \/>\nTIMEFORMAT<br \/>\nThe value of this parameter is used as a format string<br \/>\nspecifying how the timing information for pipelines prefixed<br \/>\nwith the time reserved word should be displayed.\u00a0 The %<br \/>\ncharacter introduces an escape sequence that is expanded to a<br \/>\ntime value or other information.\u00a0 The escape sequences and<br \/>\ntheir meanings are as follows; the braces denote optional<br \/>\nportions.<br \/>\n%%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 A literal %.<br \/>\n%[p][l]R\u00a0 The elapsed time in seconds.<br \/>\n%[p][l]U\u00a0 The number of CPU seconds spent in user mode.<br \/>\n%[p][l]S\u00a0 The number of CPU seconds spent in system mode.<br \/>\n%P\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 The CPU percentage, computed as (%U + %S) \/ %R.<\/p>\n<p>The optional p is a digit specifying the precision, the number<br \/>\nof fractional digits after a decimal point.\u00a0 A value of 0<br \/>\ncauses no decimal point or fraction to be output.\u00a0 At most<br \/>\nthree places after the decimal point may be specified; values<br \/>\nof p greater than 3 are changed to 3.\u00a0 If p is not specified,<br \/>\nthe value 3 is used.<\/p>\n<p>The optional l specifies a longer format, including minutes,<br \/>\nof the form MMmSS.FFs.\u00a0 The value of p determines whether or<br \/>\nnot the fraction is included.<\/p>\n<p>If this variable is not set, bash acts as if it had the value<br \/>\n$&#8217;\\nreal\\t%3lR\\nuser\\t%3lU\\nsys\\t%3lS&#8217;.\u00a0 If the value is null,<br \/>\nno timing information is displayed.\u00a0 A trailing newline is<br \/>\nadded when the format string is displayed.<br \/>\nTMOUT\u00a0 If set to a value greater than zero, TMOUT is treated as the<br \/>\ndefault timeout for the read builtin.\u00a0 The select command<br \/>\nterminates if input does not arrive after TMOUT seconds when<br \/>\ninput is coming from a terminal.\u00a0 In an interactive shell, the<br \/>\nvalue is interpreted as the number of seconds to wait for a<br \/>\nline of input after issuing the primary prompt.\u00a0 Bash<br \/>\nterminates after waiting for that number of seconds if a<br \/>\ncomplete line of input does not arrive.<br \/>\nTMPDIR If set, bash uses its value as the name of a directory in<br \/>\nwhich bash creates temporary files for the shell&#8217;s use.<br \/>\nauto_resume<br \/>\nThis variable controls how the shell interacts with the user<br \/>\nand job control.\u00a0 If this variable is set, single word simple<br \/>\ncommands without redirections are treated as candidates for<br \/>\nresumption of an existing stopped job.\u00a0 There is no ambiguity<br \/>\nallowed; if there is more than one job beginning with the<br \/>\nstring typed, the job most recently accessed is selected.\u00a0 The<br \/>\nname of a stopped job, in this context, is the command line<br \/>\nused to start it.\u00a0 If set to the value exact, the string<br \/>\nsupplied must match the name of a stopped job exactly; if set<br \/>\nto substring, the string supplied needs to match a substring<br \/>\nof the name of a stopped job.\u00a0 The substring value provides<br \/>\nfunctionality analogous to the %?\u00a0 job identifier (see JOB<br \/>\nCONTROL below).\u00a0 If set to any other value, the supplied<br \/>\nstring must be a prefix of a stopped job&#8217;s name; this provides<br \/>\nfunctionality analogous to the %string job identifier.<br \/>\nhistchars<br \/>\nThe two or three characters which control history expansion<br \/>\nand tokenization (see HISTORY EXPANSION below).\u00a0 The first<br \/>\ncharacter is the history expansion character, the character<br \/>\nwhich signals the start of a history expansion, normally `!&#8217;.<br \/>\nThe second character is the quick substitution character,<br \/>\nwhich is used as shorthand for re-running the previous command<br \/>\nentered, substituting one string for another in the command.<br \/>\nThe default is `^&#8217;.\u00a0 The optional third character is the<br \/>\ncharacter which indicates that the remainder of the line is a<br \/>\ncomment when found as the first character of a word, normally<br \/>\n`#&#8217;.\u00a0 The history comment character causes history<br \/>\nsubstitution to be skipped for the remaining words on the<br \/>\nline.\u00a0 It does not necessarily cause the shell parser to treat<br \/>\nthe rest of the line as a comment.<\/p>\n<p>Arrays<br \/>\nBash provides one-dimensional indexed and associative array<br \/>\nvariables.\u00a0 Any variable may be used as an indexed array; the declare<br \/>\nbuiltin will explicitly declare an array.\u00a0 There is no maximum limit<br \/>\non the size of an array, nor any requirement that members be indexed<br \/>\nor assigned contiguously.\u00a0 Indexed arrays are referenced using<br \/>\nintegers (including arithmetic expressions)\u00a0 and are zero-based;<br \/>\nassociative arrays are referenced using arbitrary strings.\u00a0 Unless<br \/>\notherwise noted, indexed array indices must be non-negative integers.<\/p>\n<p>An indexed array is created automatically if any variable is assigned<br \/>\nto using the syntax name[subscript]=value.\u00a0 The subscript is treated<br \/>\nas an arithmetic expression that must evaluate to a number.\u00a0 To<br \/>\nexplicitly declare an indexed array, use declare -a name (see SHELL<br \/>\nBUILTIN COMMANDS below).\u00a0 declare -a name[subscript] is also<br \/>\naccepted; the subscript is ignored.<\/p>\n<p>Associative arrays are created using declare -A name.<\/p>\n<p>Attributes may be specified for an array variable using the declare<br \/>\nand readonly builtins.\u00a0 Each attribute applies to all members of an<br \/>\narray.<\/p>\n<p>Arrays are assigned to using compound assignments of the form<br \/>\nname=(value1 &#8230; valuen), where each value is of the form<br \/>\n[subscript]=string.\u00a0 Indexed array assignments do not require<br \/>\nanything but string.\u00a0 When assigning to indexed arrays, if the<br \/>\noptional brackets and subscript are supplied, that index is assigned<br \/>\nto; otherwise the index of the element assigned is the last index<br \/>\nassigned to by the statement plus one.\u00a0 Indexing starts at zero.<\/p>\n<p>When assigning to an associative array, the subscript is required.<\/p>\n<p>This syntax is also accepted by the declare builtin.\u00a0 Individual<br \/>\narray elements may be assigned to using the name[subscript]=value<br \/>\nsyntax introduced above.\u00a0 When assigning to an indexed array, if name<br \/>\nis subscripted by a negative number, that number is interpreted as<br \/>\nrelative to one greater than the maximum index of name, so negative<br \/>\nindices count back from the end of the array, and an index of -1<br \/>\nreferences the last element.<\/p>\n<p>Any element of an array may be referenced using ${name[subscript]}.<br \/>\nThe braces are required to avoid conflicts with pathname expansion.<br \/>\nIf subscript is @ or *, the word expands to all members of name.<br \/>\nThese subscripts differ only when the word appears within double<br \/>\nquotes.\u00a0 If the word is double-quoted, ${name[*]} expands to a single<br \/>\nword with the value of each array member separated by the first<br \/>\ncharacter of the IFS special variable, and ${name[@]} expands each<br \/>\nelement of name to a separate word.\u00a0 When there are no array members,<br \/>\n${name[@]} expands to nothing.\u00a0 If the double-quoted expansion occurs<br \/>\nwithin a word, the expansion of the first parameter is joined with<br \/>\nthe beginning part of the original word, and the expansion of the<br \/>\nlast parameter is joined with the last part of the original word.<br \/>\nThis is analogous to the expansion of the special parameters * and @<br \/>\n(see Special Parameters above).\u00a0 ${#name[subscript]} expands to the<br \/>\nlength of ${name[subscript]}.\u00a0 If subscript is * or @, the expansion<br \/>\nis the number of elements in the array.\u00a0 Referencing an array<br \/>\nvariable without a subscript is equivalent to referencing the array<br \/>\nwith a subscript of 0.\u00a0 If the subscript used to reference an element<br \/>\nof an indexed array evaluates to a number less than zero, it is<br \/>\ninterpreted as relative to one greater than the maximum index of the<br \/>\narray, so negative indices count back from the end of the array, and<br \/>\nan index of -1 references the last element.<\/p>\n<p>An array variable is considered set if a subscript has been assigned<br \/>\na value.\u00a0 The null string is a valid value.<\/p>\n<p>It is possible to obtain the keys (indices) of an array as well as<br \/>\nthe values.\u00a0 ${!name[@]} and ${!name[*]} expand to the indices<br \/>\nassigned in array variable name.\u00a0 The treatment when in double quotes<br \/>\nis similar to the expansion of the special parameters @ and * within<br \/>\ndouble quotes.<\/p>\n<p>The unset builtin is used to destroy arrays.\u00a0 unset name[subscript]<br \/>\ndestroys the array element at index subscript.\u00a0 Negative subscripts<br \/>\nto indexed arrays are interpreted as described above.\u00a0 Care must be<br \/>\ntaken to avoid unwanted side effects caused by pathname expansion.<br \/>\nunset name, where name is an array, or unset name[subscript], where<br \/>\nsubscript is * or @, removes the entire array.<\/p>\n<p>The declare, local, and readonly builtins each accept a -a option to<br \/>\nspecify an indexed array and a -A option to specify an associative<br \/>\narray.\u00a0 If both options are supplied, -A takes precedence.\u00a0 The read<br \/>\nbuiltin accepts a -a option to assign a list of words read from the<br \/>\nstandard input to an array.\u00a0 The set and declare builtins display<br \/>\narray values in a way that allows them to be reused as assignments.<\/p>\n<p>EXPANSION<\/p>\n<p>Expansion is performed on the command line after it has been split<br \/>\ninto words.\u00a0 There are seven kinds of expansion performed: brace<br \/>\nexpansion, tilde expansion, parameter and variable expansion, command<br \/>\nsubstitution, arithmetic expansion, word splitting, and pathname<br \/>\nexpansion.<\/p>\n<p>The order of expansions is: brace expansion; tilde expansion,<br \/>\nparameter and variable expansion, arithmetic expansion, and command<br \/>\nsubstitution (done in a left-to-right fashion); word splitting; and<br \/>\npathname expansion.<\/p>\n<p>On systems that can support it, there is an additional expansion<br \/>\navailable: process substitution.\u00a0 This is performed at the same time<br \/>\nas tilde, parameter, variable, and arithmetic expansion and command<br \/>\nsubstitution.<\/p>\n<p>Only brace expansion, word splitting, and pathname expansion can<br \/>\nchange the number of words of the expansion; other expansions expand<br \/>\na single word to a single word.\u00a0 The only exceptions to this are the<br \/>\nexpansions of &#8220;$@&#8221; and &#8220;${name[@]}&#8221; as explained above (see<br \/>\nPARAMETERS).<\/p>\n<p>Brace Expansion<br \/>\nBrace expansion is a mechanism by which arbitrary strings may be<br \/>\ngenerated.\u00a0 This mechanism is similar to pathname expansion, but the<br \/>\nfilenames generated need not exist.\u00a0 Patterns to be brace expanded<br \/>\ntake the form of an optional preamble, followed by either a series of<br \/>\ncomma-separated strings or a sequence expression between a pair of<br \/>\nbraces, followed by an optional postscript.\u00a0 The preamble is prefixed<br \/>\nto each string contained within the braces, and the postscript is<br \/>\nthen appended to each resulting string, expanding left to right.<\/p>\n<p>Brace expansions may be nested.\u00a0 The results of each expanded string<br \/>\nare not sorted; left to right order is preserved.\u00a0 For example,<br \/>\na{d,c,b}e expands into `ade ace abe&#8217;.<\/p>\n<p>A sequence expression takes the form {x..y[..incr]}, where x and y<br \/>\nare either integers or single characters, and incr, an optional<br \/>\nincrement, is an integer.\u00a0 When integers are supplied, the expression<br \/>\nexpands to each number between x and y, inclusive.\u00a0 Supplied integers<br \/>\nmay be prefixed with 0 to force each term to have the same width.<br \/>\nWhen either x or y begins with a zero, the shell attempts to force<br \/>\nall generated terms to contain the same number of digits, zero-<br \/>\npadding where necessary.\u00a0 When characters are supplied, the<br \/>\nexpression expands to each character lexicographically between x and<br \/>\ny, inclusive, using the default C locale.\u00a0 Note that both x and y<br \/>\nmust be of the same type.\u00a0 When the increment is supplied, it is used<br \/>\nas the difference between each term.\u00a0 The default increment is 1 or<br \/>\n-1 as appropriate.<\/p>\n<p>Brace expansion is performed before any other expansions, and any<br \/>\ncharacters special to other expansions are preserved in the result.<br \/>\nIt is strictly textual.\u00a0 Bash does not apply any syntactic<br \/>\ninterpretation to the context of the expansion or the text between<br \/>\nthe braces.<\/p>\n<p>A correctly-formed brace expansion must contain unquoted opening and<br \/>\nclosing braces, and at least one unquoted comma or a valid sequence<br \/>\nexpression.\u00a0 Any incorrectly formed brace expansion is left<br \/>\nunchanged.\u00a0 A { or , may be quoted with a backslash to prevent its<br \/>\nbeing considered part of a brace expression.\u00a0 To avoid conflicts with<br \/>\nparameter expansion, the string ${ is not considered eligible for<br \/>\nbrace expansion.<\/p>\n<p>This construct is typically used as shorthand when the common prefix<br \/>\nof the strings to be generated is longer than in the above example:<\/p>\n<p>mkdir \/usr\/local\/src\/bash\/{old,new,dist,bugs}<br \/>\nor<br \/>\nchown root \/usr\/{ucb\/{ex,edit},lib\/{ex?.?*,how_ex}}<\/p>\n<p>Brace expansion introduces a slight incompatibility with historical<br \/>\nversions of sh.\u00a0 sh does not treat opening or closing braces<br \/>\nspecially when they appear as part of a word, and preserves them in<br \/>\nthe output.\u00a0 Bash removes braces from words as a consequence of brace<br \/>\nexpansion.\u00a0 For example, a word entered to sh as file{1,2} appears<br \/>\nidentically in the output.\u00a0 The same word is output as file1 file2<br \/>\nafter expansion by bash.\u00a0 If strict compatibility with sh is desired,<br \/>\nstart bash with the +B option or disable brace expansion with the +B<br \/>\noption to the set command (see SHELL BUILTIN COMMANDS below).<\/p>\n<p>Tilde Expansion<br \/>\nIf a word begins with an unquoted tilde character (`~&#8217;), all of the<br \/>\ncharacters preceding the first unquoted slash (or all characters, if<br \/>\nthere is no unquoted slash) are considered a tilde-prefix.\u00a0 If none<br \/>\nof the characters in the tilde-prefix are quoted, the characters in<br \/>\nthe tilde-prefix following the tilde are treated as a possible login<br \/>\nname.\u00a0 If this login name is the null string, the tilde is replaced<br \/>\nwith the value of the shell parameter HOME.\u00a0 If HOME is unset, the<br \/>\nhome directory of the user executing the shell is substituted<br \/>\ninstead.\u00a0 Otherwise, the tilde-prefix is replaced with the home<br \/>\ndirectory associated with the specified login name.<\/p>\n<p>If the tilde-prefix is a `~+&#8217;, the value of the shell variable PWD<br \/>\nreplaces the tilde-prefix.\u00a0 If the tilde-prefix is a `~-&#8216;, the value<br \/>\nof the shell variable OLDPWD, if it is set, is substituted.\u00a0 If the<br \/>\ncharacters following the tilde in the tilde-prefix consist of a<br \/>\nnumber N, optionally prefixed by a `+&#8217; or a `-&#8216;, the tilde-prefix is<br \/>\nreplaced with the corresponding element from the directory stack, as<br \/>\nit would be displayed by the dirs builtin invoked with the tilde-<br \/>\nprefix as an argument.\u00a0 If the characters following the tilde in the<br \/>\ntilde-prefix consist of a number without a leading `+&#8217; or `-&#8216;, `+&#8217; is<br \/>\nassumed.<\/p>\n<p>If the login name is invalid, or the tilde expansion fails, the word<br \/>\nis unchanged.<\/p>\n<p>Each variable assignment is checked for unquoted tilde-prefixes<br \/>\nimmediately following a : or the first =.\u00a0 In these cases, tilde<br \/>\nexpansion is also performed.\u00a0 Consequently, one may use filenames<br \/>\nwith tildes in assignments to PATH, MAILPATH, and CDPATH, and the<br \/>\nshell assigns the expanded value.<\/p>\n<p>Parameter Expansion<br \/>\nThe `$&#8217; character introduces parameter expansion, command<br \/>\nsubstitution, or arithmetic expansion.\u00a0 The parameter name or symbol<br \/>\nto be expanded may be enclosed in braces, which are optional but<br \/>\nserve to protect the variable to be expanded from characters<br \/>\nimmediately following it which could be interpreted as part of the<br \/>\nname.<\/p>\n<p>When braces are used, the matching ending brace is the first `}&#8217; not<br \/>\nescaped by a backslash or within a quoted string, and not within an<br \/>\nembedded arithmetic expansion, command substitution, or parameter<br \/>\nexpansion.<\/p>\n<p>${parameter}<br \/>\nThe value of parameter is substituted.\u00a0 The braces are<br \/>\nrequired when parameter is a positional parameter with more<br \/>\nthan one digit, or when parameter is followed by a character<br \/>\nwhich is not to be interpreted as part of its name.\u00a0 The<br \/>\nparameter is a shell parameter as described above PARAMETERS)<br \/>\nor an array reference (Arrays).<\/p>\n<p>If the first character of parameter is an exclamation point (!), it<br \/>\nintroduces a level of variable indirection.\u00a0 Bash uses the value of<br \/>\nthe variable formed from the rest of parameter as the name of the<br \/>\nvariable; this variable is then expanded and that value is used in<br \/>\nthe rest of the substitution, rather than the value of parameter<br \/>\nitself.\u00a0 This is known as indirect expansion.\u00a0 The exceptions to this<br \/>\nare the expansions of ${!prefix*} and ${!name[@]} described below.<br \/>\nThe exclamation point must immediately follow the left brace in order<br \/>\nto introduce indirection.<\/p>\n<p>In each of the cases below, word is subject to tilde expansion,<br \/>\nparameter expansion, command substitution, and arithmetic expansion.<\/p>\n<p>When not performing substring expansion, using the forms documented<br \/>\nbelow (e.g., :-), bash tests for a parameter that is unset or null.<br \/>\nOmitting the colon results in a test only for a parameter that is<br \/>\nunset.<\/p>\n<p>${parameter:-word}<br \/>\nUse Default Values.\u00a0 If parameter is unset or null, the<br \/>\nexpansion of word is substituted.\u00a0 Otherwise, the value of<br \/>\nparameter is substituted.<br \/>\n${parameter:=word}<br \/>\nAssign Default Values.\u00a0 If parameter is unset or null, the<br \/>\nexpansion of word is assigned to parameter.\u00a0 The value of<br \/>\nparameter is then substituted.\u00a0 Positional parameters and<br \/>\nspecial parameters may not be assigned to in this way.<br \/>\n${parameter:?word}<br \/>\nDisplay Error if Null or Unset.\u00a0 If parameter is null or<br \/>\nunset, the expansion of word (or a message to that effect if<br \/>\nword is not present) is written to the standard error and the<br \/>\nshell, if it is not interactive, exits.\u00a0 Otherwise, the value<br \/>\nof parameter is substituted.<br \/>\n${parameter:+word}<br \/>\nUse Alternate Value.\u00a0 If parameter is null or unset, nothing<br \/>\nis substituted, otherwise the expansion of word is<br \/>\nsubstituted.<br \/>\n${parameter:offset}<br \/>\n${parameter:offset:length}<br \/>\nSubstring Expansion.\u00a0 Expands to up to length characters of<br \/>\nthe value of parameter starting at the character specified by<br \/>\noffset.\u00a0 If parameter is @, an indexed array subscripted by @<br \/>\nor *, or an associative array name, the results differ as<br \/>\ndescribed below.\u00a0 If length is omitted, expands to the<br \/>\nsubstring of the value of parameter starting at the character<br \/>\nspecified by offset and extending to the end of the value.<br \/>\nlength and offset are arithmetic expressions (see ARITHMETIC<br \/>\nEVALUATION below).<\/p>\n<p>If offset evaluates to a number less than zero, the value is<br \/>\nused as an offset in characters from the end of the value of<br \/>\nparameter.\u00a0 If length evaluates to a number less than zero, it<br \/>\nis interpreted as an offset in characters from the end of the<br \/>\nvalue of parameter rather than a number of characters, and the<br \/>\nexpansion is the characters between offset and that result.<br \/>\nNote that a negative offset must be separated from the colon<br \/>\nby at least one space to avoid being confused with the :-<br \/>\nexpansion.<\/p>\n<p>If parameter is @, the result is length positional parameters<br \/>\nbeginning at offset.\u00a0 A negative offset is taken relative to<br \/>\none greater than the greatest positional parameter, so an<br \/>\noffset of -1 evaluates to the last positional parameter.\u00a0 It<br \/>\nis an expansion error if length evaluates to a number less<br \/>\nthan zero.<\/p>\n<p>If parameter is an indexed array name subscripted by @ or *,<br \/>\nthe result is the length members of the array beginning with<br \/>\n${parameter[offset]}.\u00a0 A negative offset is taken relative to<br \/>\none greater than the maximum index of the specified array.\u00a0 It<br \/>\nis an expansion error if length evaluates to a number less<br \/>\nthan zero.<\/p>\n<p>Substring expansion applied to an associative array produces<br \/>\nundefined results.<\/p>\n<p>Substring indexing is zero-based unless the positional<br \/>\nparameters are used, in which case the indexing starts at 1 by<br \/>\ndefault.\u00a0 If offset is 0, and the positional parameters are<br \/>\nused, $0 is prefixed to the list.<\/p>\n<p>${!prefix*}<br \/>\n${!prefix@}<br \/>\nNames matching prefix.\u00a0 Expands to the names of variables<br \/>\nwhose names begin with prefix, separated by the first<br \/>\ncharacter of the IFS special variable.\u00a0 When @ is used and the<br \/>\nexpansion appears within double quotes, each variable name<br \/>\nexpands to a separate word.<\/p>\n<p>${!name[@]}<br \/>\n${!name[*]}<br \/>\nList of array keys.\u00a0 If name is an array variable, expands to<br \/>\nthe list of array indices (keys) assigned in name.\u00a0 If name is<br \/>\nnot an array, expands to 0 if name is set and null otherwise.<br \/>\nWhen @ is used and the expansion appears within double quotes,<br \/>\neach key expands to a separate word.<\/p>\n<p>${#parameter}<br \/>\nParameter length.\u00a0 The length in characters of the value of<br \/>\nparameter is substituted.\u00a0 If parameter is * or @, the value<br \/>\nsubstituted is the number of positional parameters.\u00a0 If<br \/>\nparameter is an array name subscripted by * or @, the value<br \/>\nsubstituted is the number of elements in the array.\u00a0 If<br \/>\nparameter is an indexed array name subscripted by a negative<br \/>\nnumber, that number is interpreted as relative to one greater<br \/>\nthan the maximum index of parameter, so negative indices count<br \/>\nback from the end of the array, and an index of -1 references<br \/>\nthe last element.<\/p>\n<p>${parameter#word}<br \/>\n${parameter##word}<br \/>\nRemove matching prefix pattern.\u00a0 The word is expanded to<br \/>\nproduce a pattern just as in pathname expansion.\u00a0 If the<br \/>\npattern matches the beginning of the value of parameter, then<br \/>\nthe result of the expansion is the expanded value of parameter<br \/>\nwith the shortest matching pattern (the &#8220;#&#8221; case) or the<br \/>\nlongest matching pattern (the &#8220;##&#8221; case) deleted.\u00a0 If<br \/>\nparameter is @ or *, the pattern removal operation is applied<br \/>\nto each positional parameter in turn, and the expansion is the<br \/>\nresultant list.\u00a0 If parameter is an array variable subscripted<br \/>\nwith @ or *, the pattern removal operation is applied to each<br \/>\nmember of the array in turn, and the expansion is the<br \/>\nresultant list.<\/p>\n<p>${parameter%word}<br \/>\n${parameter%%word}<br \/>\nRemove matching suffix pattern.\u00a0 The word is expanded to<br \/>\nproduce a pattern just as in pathname expansion.\u00a0 If the<br \/>\npattern matches a trailing portion of the expanded value of<br \/>\nparameter, then the result of the expansion is the expanded<br \/>\nvalue of parameter with the shortest matching pattern (the<br \/>\n&#8220;%&#8221; case) or the longest matching pattern (the &#8220;%%&#8221; case)<br \/>\ndeleted.\u00a0 If parameter is @ or *, the pattern removal<br \/>\noperation is applied to each positional parameter in turn, and<br \/>\nthe expansion is the resultant list.\u00a0 If parameter is an array<br \/>\nvariable subscripted with @ or *, the pattern removal<br \/>\noperation is applied to each member of the array in turn, and<br \/>\nthe expansion is the resultant list.<\/p>\n<p>${parameter\/pattern\/string}<br \/>\nPattern substitution.\u00a0 The pattern is expanded to produce a<br \/>\npattern just as in pathname expansion.\u00a0 Parameter is expanded<br \/>\nand the longest match of pattern against its value is replaced<br \/>\nwith string.\u00a0 If pattern begins with \/, all matches of pattern<br \/>\nare replaced with string.\u00a0 Normally only the first match is<br \/>\nreplaced.\u00a0 If pattern begins with #, it must match at the<br \/>\nbeginning of the expanded value of parameter.\u00a0 If pattern<br \/>\nbegins with %, it must match at the end of the expanded value<br \/>\nof parameter.\u00a0 If string is null, matches of pattern are<br \/>\ndeleted and the \/ following pattern may be omitted.\u00a0 If<br \/>\nparameter is @ or *, the substitution operation is applied to<br \/>\neach positional parameter in turn, and the expansion is the<br \/>\nresultant list.\u00a0 If parameter is an array variable subscripted<br \/>\nwith @ or *, the substitution operation is applied to each<br \/>\nmember of the array in turn, and the expansion is the<br \/>\nresultant list.<\/p>\n<p>${parameter^pattern}<br \/>\n${parameter^^pattern}<br \/>\n${parameter,pattern}<br \/>\n${parameter,,pattern}<br \/>\nCase modification.\u00a0 This expansion modifies the case of<br \/>\nalphabetic characters in parameter.\u00a0 The pattern is expanded<br \/>\nto produce a pattern just as in pathname expansion.\u00a0 Each<br \/>\ncharacter in the expanded value of parameter is tested against<br \/>\npattern, and, if it matches the pattern, its case is<br \/>\nconverted.\u00a0 The pattern should not attempt to match more than<br \/>\none character.\u00a0 The ^ operator converts lowercase letters<br \/>\nmatching pattern to uppercase; the , operator converts<br \/>\nmatching uppercase letters to lowercase.\u00a0 The ^^ and ,,<br \/>\nexpansions convert each matched character in the expanded<br \/>\nvalue; the ^ and , expansions match and convert only the first<br \/>\ncharacter in the expanded value.\u00a0 If pattern is omitted, it is<br \/>\ntreated like a ?, which matches every character.\u00a0 If parameter<br \/>\nis @ or *, the case modification operation is applied to each<br \/>\npositional parameter in turn, and the expansion is the<br \/>\nresultant list.\u00a0 If parameter is an array variable subscripted<br \/>\nwith @ or *, the case modification operation is applied to<br \/>\neach member of the array in turn, and the expansion is the<br \/>\nresultant list.<\/p>\n<p>Command Substitution<br \/>\nCommand substitution allows the output of a command to replace the<br \/>\ncommand name.\u00a0 There are two forms:<\/p>\n<p>$(command)<br \/>\nor<br \/>\n`command`<\/p>\n<p>Bash performs the expansion by executing command and replacing the<br \/>\ncommand substitution with the standard output of the command, with<br \/>\nany trailing newlines deleted.\u00a0 Embedded newlines are not deleted,<br \/>\nbut they may be removed during word splitting.\u00a0 The command<br \/>\nsubstitution $(cat file) can be replaced by the equivalent but faster<br \/>\n$(&lt; file).<\/p>\n<p>When the old-style backquote form of substitution is used, backslash<br \/>\nretains its literal meaning except when followed by $, `, or \\.\u00a0 The<br \/>\nfirst backquote not preceded by a backslash terminates the command<br \/>\nsubstitution.\u00a0 When using the $(command) form, all characters between<br \/>\nthe parentheses make up the command; none are treated specially.<\/p>\n<p>Command substitutions may be nested.\u00a0 To nest when using the<br \/>\nbackquoted form, escape the inner backquotes with backslashes.<\/p>\n<p>If the substitution appears within double quotes, word splitting and<br \/>\npathname expansion are not performed on the results.<\/p>\n<p>Arithmetic Expansion<br \/>\nArithmetic expansion allows the evaluation of an arithmetic<br \/>\nexpression and the substitution of the result.\u00a0 The format for<br \/>\narithmetic expansion is:<\/p>\n<p>$((expression))<\/p>\n<p>The expression is treated as if it were within double quotes, but a<br \/>\ndouble quote inside the parentheses is not treated specially.\u00a0 All<br \/>\ntokens in the expression undergo parameter and variable expansion,<br \/>\ncommand substitution, and quote removal.\u00a0 The result is treated as<br \/>\nthe arithmetic expression to be evaluated.\u00a0 Arithmetic expansions may<br \/>\nbe nested.<\/p>\n<p>The evaluation is performed according to the rules listed below under<br \/>\nARITHMETIC EVALUATION.\u00a0 If expression is invalid, bash prints a<br \/>\nmessage indicating failure and no substitution occurs.<\/p>\n<p>Process Substitution<br \/>\nProcess substitution is supported on systems that support named pipes<br \/>\n(FIFOs) or the \/dev\/fd method of naming open files.\u00a0 It takes the<br \/>\nform of &lt;(list) or &gt;(list).\u00a0 The process list is run with its input<br \/>\nor output connected to a FIFO or some file in \/dev\/fd.\u00a0 The name of<br \/>\nthis file is passed as an argument to the current command as the<br \/>\nresult of the expansion.\u00a0 If the &gt;(list) form is used, writing to the<br \/>\nfile will provide input for list.\u00a0 If the &lt;(list) form is used, the<br \/>\nfile passed as an argument should be read to obtain the output of<br \/>\nlist.<\/p>\n<p>When available, process substitution is performed simultaneously with<br \/>\nparameter and variable expansion, command substitution, and<br \/>\narithmetic expansion.<\/p>\n<p>Word Splitting<br \/>\nThe shell scans the results of parameter expansion, command<br \/>\nsubstitution, and arithmetic expansion that did not occur within<br \/>\ndouble quotes for word splitting.<\/p>\n<p>The shell treats each character of IFS as a delimiter, and splits the<br \/>\nresults of the other expansions into words using these characters as<br \/>\nfield terminators.\u00a0 If IFS is unset, or its value is exactly<br \/>\n&lt;space&gt;&lt;tab&gt;&lt;newline&gt;, the default, then sequences of &lt;space&gt;, &lt;tab&gt;,<br \/>\nand &lt;newline&gt; at the beginning and end of the results of the previous<br \/>\nexpansions are ignored, and any sequence of IFS characters not at the<br \/>\nbeginning or end serves to delimit words.\u00a0 If IFS has a value other<br \/>\nthan the default, then sequences of the whitespace characters space<br \/>\nand tab are ignored at the beginning and end of the word, as long as<br \/>\nthe whitespace character is in the value of IFS (an IFS whitespace<br \/>\ncharacter).\u00a0 Any character in IFS that is not IFS whitespace, along<br \/>\nwith any adjacent IFS whitespace characters, delimits a field.\u00a0 A<br \/>\nsequence of IFS whitespace characters is also treated as a delimiter.<br \/>\nIf the value of IFS is null, no word splitting occurs.<\/p>\n<p>Explicit null arguments (&#8220;&#8221; or &#8221;) are retained.\u00a0 Unquoted implicit<br \/>\nnull arguments, resulting from the expansion of parameters that have<br \/>\nno values, are removed.\u00a0 If a parameter with no value is expanded<br \/>\nwithin double quotes, a null argument results and is retained.<\/p>\n<p>Note that if no expansion occurs, no splitting is performed.<\/p>\n<p>Pathname Expansion<br \/>\nAfter word splitting, unless the -f option has been set, bash scans<br \/>\neach word for the characters *, ?, and [.\u00a0 If one of these characters<br \/>\nappears, then the word is regarded as a pattern, and replaced with an<br \/>\nalphabetically sorted list of filenames matching the pattern (see<br \/>\nPattern Matching below).\u00a0 If no matching filenames are found, and the<br \/>\nshell option nullglob is not enabled, the word is left unchanged.\u00a0 If<br \/>\nthe nullglob option is set, and no matches are found, the word is<br \/>\nremoved.\u00a0 If the failglob shell option is set, and no matches are<br \/>\nfound, an error message is printed and the command is not executed.<br \/>\nIf the shell option nocaseglob is enabled, the match is performed<br \/>\nwithout regard to the case of alphabetic characters.\u00a0 When a pattern<br \/>\nis used for pathname expansion, the character &#8220;.&#8221;\u00a0 at the start of<br \/>\na name or immediately following a slash must be matched explicitly,<br \/>\nunless the shell option dotglob is set.\u00a0 When matching a pathname,<br \/>\nthe slash character must always be matched explicitly.\u00a0 In other<br \/>\ncases, the &#8220;.&#8221;\u00a0 character is not treated specially.\u00a0 See the<br \/>\ndescription of shopt below under SHELL BUILTIN COMMANDS for a<br \/>\ndescription of the nocaseglob, nullglob, failglob, and dotglob shell<br \/>\noptions.<\/p>\n<p>The GLOBIGNORE shell variable may be used to restrict the set of<br \/>\nfilenames matching a pattern.\u00a0 If GLOBIGNORE is set, each matching<br \/>\nfilename that also matches one of the patterns in GLOBIGNORE is<br \/>\nremoved from the list of matches.\u00a0 The filenames &#8220;.&#8221;\u00a0 and &#8220;..&#8221;<br \/>\nare always ignored when GLOBIGNORE is set and not null.\u00a0 However,<br \/>\nsetting GLOBIGNORE to a non-null value has the effect of enabling the<br \/>\ndotglob shell option, so all other filenames beginning with a &#8220;.&#8221;<br \/>\nwill match.\u00a0 To get the old behavior of ignoring filenames beginning<br \/>\nwith a &#8220;.&#8221;, make &#8220;.*&#8221;\u00a0 one of the patterns in GLOBIGNORE.\u00a0 The<br \/>\ndotglob option is disabled when GLOBIGNORE is unset.<\/p>\n<p>Pattern Matching<\/p>\n<p>Any character that appears in a pattern, other than the special<br \/>\npattern characters described below, matches itself.\u00a0 The NUL<br \/>\ncharacter may not occur in a pattern.\u00a0 A backslash escapes the<br \/>\nfollowing character; the escaping backslash is discarded when<br \/>\nmatching.\u00a0 The special pattern characters must be quoted if they are<br \/>\nto be matched literally.<\/p>\n<p>The special pattern characters have the following meanings:<\/p>\n<p>*\u00a0\u00a0\u00a0\u00a0\u00a0 Matches any string, including the null string.\u00a0 When<br \/>\nthe globstar shell option is enabled, and * is used in<br \/>\na pathname expansion context, two adjacent *s used as a<br \/>\nsingle pattern will match all files and zero or more<br \/>\ndirectories and subdirectories.\u00a0 If followed by a \/,<br \/>\ntwo adjacent *s will match only directories and<br \/>\nsubdirectories.<br \/>\n?\u00a0\u00a0\u00a0\u00a0\u00a0 Matches any single character.<br \/>\n[&#8230;]\u00a0 Matches any one of the enclosed characters.\u00a0 A pair of<br \/>\ncharacters separated by a hyphen denotes a range<br \/>\nexpression; any character that falls between those two<br \/>\ncharacters, inclusive, using the current locale&#8217;s<br \/>\ncollating sequence and character set, is matched.\u00a0 If<br \/>\nthe first character following the [ is a !\u00a0 or a ^ then<br \/>\nany character not enclosed is matched.\u00a0 The sorting<br \/>\norder of characters in range expressions is determined<br \/>\nby the current locale and the values of the LC_COLLATE<br \/>\nor LC_ALL shell variables, if set.\u00a0 To obtain the<br \/>\ntraditional interpretation of range expressions, where<br \/>\n[a-d] is equivalent to [abcd], set value of the LC_ALL<br \/>\nshell variable to C, or enable the globasciiranges<br \/>\nshell option.\u00a0 A &#8211; may be matched by including it as<br \/>\nthe first or last character in the set.\u00a0 A ] may be<br \/>\nmatched by including it as the first character in the<br \/>\nset.<\/p>\n<p>Within [ and ], character classes can be specified<br \/>\nusing the syntax [:class:], where class is one of the<br \/>\nfollowing classes defined in the POSIX standard:<br \/>\nalnum alpha ascii blank cntrl digit graph lower print<br \/>\npunct space upper word xdigit<br \/>\nA character class matches any character belonging to<br \/>\nthat class.\u00a0 The word character class matches letters,<br \/>\ndigits, and the character _.<\/p>\n<p>Within [ and ], an equivalence class can be specified<br \/>\nusing the syntax [=c=], which matches all characters<br \/>\nwith the same collation weight (as defined by the<br \/>\ncurrent locale) as the character c.<\/p>\n<p>Within [ and ], the syntax [.symbol.] matches the<br \/>\ncollating symbol symbol.<\/p>\n<p>If the extglob shell option is enabled using the shopt builtin,<br \/>\nseveral extended pattern matching operators are recognized.\u00a0 In the<br \/>\nfollowing description, a pattern-list is a list of one or more<br \/>\npatterns separated by a |.\u00a0 Composite patterns may be formed using<br \/>\none or more of the following sub-patterns:<\/p>\n<p>?(pattern-list)<br \/>\nMatches zero or one occurrence of the given patterns<br \/>\n*(pattern-list)<br \/>\nMatches zero or more occurrences of the given patterns<br \/>\n+(pattern-list)<br \/>\nMatches one or more occurrences of the given patterns<br \/>\n@(pattern-list)<br \/>\nMatches one of the given patterns<br \/>\n!(pattern-list)<br \/>\nMatches anything except one of the given patterns<\/p>\n<p>Quote Removal<br \/>\nAfter the preceding expansions, all unquoted occurrences of the<br \/>\ncharacters \\, &#8216;, and &#8221; that did not result from one of the above<br \/>\nexpansions are removed.<\/p>\n<p>REDIRECTION<\/p>\n<p>Before a command is executed, its input and output may be redirected<br \/>\nusing a special notation interpreted by the shell.\u00a0 Redirection<br \/>\nallows commands&#8217; file handles to be duplicated, opened, closed, made<br \/>\nto refer to different files, and can change the files the command<br \/>\nreads from and writes to.\u00a0 Redirection may also be used to modify<br \/>\nfile handles in the current shell execution environment.\u00a0 The<br \/>\nfollowing redirection operators may precede or appear anywhere within<br \/>\na simple command or may follow a command.\u00a0 Redirections are processed<br \/>\nin the order they appear, from left to right.<\/p>\n<p>Each redirection that may be preceded by a file descriptor number may<br \/>\ninstead be preceded by a word of the form {varname}.\u00a0 In this case,<br \/>\nfor each redirection operator except &gt;&amp;- and &lt;&amp;-, the shell will<br \/>\nallocate a file descriptor greater than or equal to 10 and assign it<br \/>\nto varname.\u00a0 If &gt;&amp;- or &lt;&amp;- is preceded by {varname}, the value of<br \/>\nvarname defines the file descriptor to close.<\/p>\n<p>In the following descriptions, if the file descriptor number is<br \/>\nomitted, and the first character of the redirection operator is &lt;,<br \/>\nthe redirection refers to the standard input (file descriptor 0).\u00a0 If<br \/>\nthe first character of the redirection operator is &gt;, the redirection<br \/>\nrefers to the standard output (file descriptor 1).<\/p>\n<p>The word following the redirection operator in the following<br \/>\ndescriptions, unless otherwise noted, is subjected to brace<br \/>\nexpansion, tilde expansion, parameter and variable expansion, command<br \/>\nsubstitution, arithmetic expansion, quote removal, pathname<br \/>\nexpansion, and word splitting.\u00a0 If it expands to more than one word,<br \/>\nbash reports an error.<\/p>\n<p>Note that the order of redirections is significant.\u00a0 For example, the<br \/>\ncommand<\/p>\n<p>ls &gt; dirlist 2&gt;&amp;1<\/p>\n<p>directs both standard output and standard error to the file dirlist,<br \/>\nwhile the command<\/p>\n<p>ls 2&gt;&amp;1 &gt; dirlist<\/p>\n<p>directs only the standard output to file dirlist, because the<br \/>\nstandard error was duplicated from the standard output before the<br \/>\nstandard output was redirected to dirlist.<\/p>\n<p>Bash handles several filenames specially when they are used in<br \/>\nredirections, as described in the following table:<\/p>\n<p>\/dev\/fd\/fd<br \/>\nIf fd is a valid integer, file descriptor fd is<br \/>\nduplicated.<br \/>\n\/dev\/stdin<br \/>\nFile descriptor 0 is duplicated.<br \/>\n\/dev\/stdout<br \/>\nFile descriptor 1 is duplicated.<br \/>\n\/dev\/stderr<br \/>\nFile descriptor 2 is duplicated.<br \/>\n\/dev\/tcp\/host\/port<br \/>\nIf host is a valid hostname or Internet address, and<br \/>\nport is an integer port number or service name, bash<br \/>\nattempts to open the corresponding TCP socket.<br \/>\n\/dev\/udp\/host\/port<br \/>\nIf host is a valid hostname or Internet address, and<br \/>\nport is an integer port number or service name, bash<br \/>\nattempts to open the corresponding UDP socket.<\/p>\n<p>A failure to open or create a file causes the redirection to fail.<\/p>\n<p>Redirections using file descriptors greater than 9 should be used<br \/>\nwith care, as they may conflict with file descriptors the shell uses<br \/>\ninternally.<\/p>\n<p>Redirecting Input<br \/>\nRedirection of input causes the file whose name results from the<br \/>\nexpansion of word to be opened for reading on file descriptor n, or<br \/>\nthe standard input (file descriptor 0) if n is not specified.<\/p>\n<p>The general format for redirecting input is:<\/p>\n<p>[n]&lt;word<\/p>\n<p>Redirecting Output<br \/>\nRedirection of output causes the file whose name results from the<br \/>\nexpansion of word to be opened for writing on file descriptor n, or<br \/>\nthe standard output (file descriptor 1) if n is not specified.\u00a0 If<br \/>\nthe file does not exist it is created; if it does exist it is<br \/>\ntruncated to zero size.<\/p>\n<p>The general format for redirecting output is:<\/p>\n<p>[n]&gt;word<\/p>\n<p>If the redirection operator is &gt;, and the noclobber option to the set<br \/>\nbuiltin has been enabled, the redirection will fail if the file whose<br \/>\nname results from the expansion of word exists and is a regular file.<br \/>\nIf the redirection operator is &gt;|, or the redirection operator is &gt;<br \/>\nand the noclobber option to the set builtin command is not enabled,<br \/>\nthe redirection is attempted even if the file named by word exists.<\/p>\n<p>Appending Redirected Output<br \/>\nRedirection of output in this fashion causes the file whose name<br \/>\nresults from the expansion of word to be opened for appending on file<br \/>\ndescriptor n, or the standard output (file descriptor 1) if n is not<br \/>\nspecified.\u00a0 If the file does not exist it is created.<\/p>\n<p>The general format for appending output is:<\/p>\n<p>[n]&gt;&gt;word<\/p>\n<p>Redirecting Standard Output and Standard Error<br \/>\nThis construct allows both the standard output (file descriptor 1)<br \/>\nand the standard error output (file descriptor 2) to be redirected to<br \/>\nthe file whose name is the expansion of word.<\/p>\n<p>There are two formats for redirecting standard output and standard<br \/>\nerror:<\/p>\n<p>&amp;&gt;word<br \/>\nand<br \/>\n&gt;&amp;word<\/p>\n<p>Of the two forms, the first is preferred.\u00a0 This is semantically<br \/>\nequivalent to<\/p>\n<p>&gt;word 2&gt;&amp;1<\/p>\n<p>When using the second form, word may not expand to a number or -.\u00a0 If<br \/>\nit does, other redirection operators apply (see Duplicating File<br \/>\nDescriptors below) for compatibility reasons.<\/p>\n<p>Appending Standard Output and Standard Error<br \/>\nThis construct allows both the standard output (file descriptor 1)<br \/>\nand the standard error output (file descriptor 2) to be appended to<br \/>\nthe file whose name is the expansion of word.<\/p>\n<p>The format for appending standard output and standard error is:<\/p>\n<p>&amp;&gt;&gt;word<\/p>\n<p>This is semantically equivalent to<\/p>\n<p>&gt;&gt;word 2&gt;&amp;1<\/p>\n<p>(see Duplicating File Descriptors below).<\/p>\n<p>Here Documents<br \/>\nThis type of redirection instructs the shell to read input from the<br \/>\ncurrent source until a line containing only delimiter (with no<br \/>\ntrailing blanks) is seen.\u00a0 All of the lines read up to that point are<br \/>\nthen used as the standard input for a command.<\/p>\n<p>The format of here-documents is:<\/p>\n<p>&lt;&lt;[-]word<br \/>\nhere-document<br \/>\ndelimiter<\/p>\n<p>No parameter and variable expansion, command substitution, arithmetic<br \/>\nexpansion, or pathname expansion is performed on word.\u00a0 If any<br \/>\ncharacters in word are quoted, the delimiter is the result of quote<br \/>\nremoval on word, and the lines in the here-document are not expanded.<br \/>\nIf word is unquoted, all lines of the here-document are subjected to<br \/>\nparameter expansion, command substitution, and arithmetic expansion,<br \/>\nthe character sequence \\&lt;newline&gt; is ignored, and \\ must be used to<br \/>\nquote the characters \\, $, and `.<\/p>\n<p>If the redirection operator is &lt;&lt;-, then all leading tab characters<br \/>\nare stripped from input lines and the line containing delimiter.<br \/>\nThis allows here-documents within shell scripts to be indented in a<br \/>\nnatural fashion.<\/p>\n<p>Here Strings<br \/>\nA variant of here documents, the format is:<\/p>\n<p>&lt;&lt;&lt;word<\/p>\n<p>The word undergoes brace expansion, tilde expansion, parameter and<br \/>\nvariable expansion, command substitution, arithmetic expansion, and<br \/>\nquote removal.\u00a0 Pathname expansion and word splitting are not<br \/>\nperformed.\u00a0 The result is supplied as a single string to the command<br \/>\non its standard input.<\/p>\n<p>Duplicating File Descriptors<br \/>\nThe redirection operator<\/p>\n<p>[n]&lt;&amp;word<\/p>\n<p>is used to duplicate input file descriptors.\u00a0 If word expands to one<br \/>\nor more digits, the file descriptor denoted by n is made to be a copy<br \/>\nof that file descriptor.\u00a0 If the digits in word do not specify a file<br \/>\ndescriptor open for input, a redirection error occurs.\u00a0 If word<br \/>\nevaluates to -, file descriptor n is closed.\u00a0 If n is not specified,<br \/>\nthe standard input (file descriptor 0) is used.<\/p>\n<p>The operator<\/p>\n<p>[n]&gt;&amp;word<\/p>\n<p>is used similarly to duplicate output file descriptors.\u00a0 If n is not<br \/>\nspecified, the standard output (file descriptor 1) is used.\u00a0 If the<br \/>\ndigits in word do not specify a file descriptor open for output, a<br \/>\nredirection error occurs.\u00a0 If word evaluates to -, file descriptor n<br \/>\nis closed.\u00a0 As a special case, if n is omitted, and word does not<br \/>\nexpand to one or more digits or -, the standard output and standard<br \/>\nerror are redirected as described previously.<\/p>\n<p>Moving File Descriptors<br \/>\nThe redirection operator<\/p>\n<p>[n]&lt;&amp;digit-<\/p>\n<p>moves the file descriptor digit to file descriptor n, or the standard<br \/>\ninput (file descriptor 0) if n is not specified.\u00a0 digit is closed<br \/>\nafter being duplicated to n.<\/p>\n<p>Similarly, the redirection operator<\/p>\n<p>[n]&gt;&amp;digit-<\/p>\n<p>moves the file descriptor digit to file descriptor n, or the standard<br \/>\noutput (file descriptor 1) if n is not specified.<\/p>\n<p>Opening File Descriptors for Reading and Writing<br \/>\nThe redirection operator<\/p>\n<p>[n]&lt;&gt;word<\/p>\n<p>causes the file whose name is the expansion of word to be opened for<br \/>\nboth reading and writing on file descriptor n, or on file descriptor<br \/>\n0 if n is not specified.\u00a0 If the file does not exist, it is created.<\/p>\n<p>ALIASES<\/p>\n<p>Aliases allow a string to be substituted for a word when it is used<br \/>\nas the first word of a simple command.\u00a0 The shell maintains a list of<br \/>\naliases that may be set and unset with the alias and unalias builtin<br \/>\ncommands (see SHELL BUILTIN COMMANDS below).\u00a0 The first word of each<br \/>\nsimple command, if unquoted, is checked to see if it has an alias.<br \/>\nIf so, that word is replaced by the text of the alias.\u00a0 The<br \/>\ncharacters \/, $, `, and = and any of the shell metacharacters or<br \/>\nquoting characters listed above may not appear in an alias name.\u00a0 The<br \/>\nreplacement text may contain any valid shell input, including shell<br \/>\nmetacharacters.\u00a0 The first word of the replacement text is tested for<br \/>\naliases, but a word that is identical to an alias being expanded is<br \/>\nnot expanded a second time.\u00a0 This means that one may alias ls to ls<br \/>\n-F, for instance, and bash does not try to recursively expand the<br \/>\nreplacement text.\u00a0 If the last character of the alias value is a<br \/>\nblank, then the next command word following the alias is also checked<br \/>\nfor alias expansion.<\/p>\n<p>Aliases are created and listed with the alias command, and removed<br \/>\nwith the unalias command.<\/p>\n<p>There is no mechanism for using arguments in the replacement text.<br \/>\nIf arguments are needed, a shell function should be used (see<br \/>\nFUNCTIONS below).<\/p>\n<p>Aliases are not expanded when the shell is not interactive, unless<br \/>\nthe expand_aliases shell option is set using shopt (see the<br \/>\ndescription of shopt under SHELL BUILTIN COMMANDS below).<\/p>\n<p>The rules concerning the definition and use of aliases are somewhat<br \/>\nconfusing.\u00a0 Bash always reads at least one complete line of input<br \/>\nbefore executing any of the commands on that line.\u00a0 Aliases are<br \/>\nexpanded when a command is read, not when it is executed.\u00a0 Therefore,<br \/>\nan alias definition appearing on the same line as another command<br \/>\ndoes not take effect until the next line of input is read.\u00a0 The<br \/>\ncommands following the alias definition on that line are not affected<br \/>\nby the new alias.\u00a0 This behavior is also an issue when functions are<br \/>\nexecuted.\u00a0 Aliases are expanded when a function definition is read,<br \/>\nnot when the function is executed, because a function definition is<br \/>\nitself a compound command.\u00a0 As a consequence, aliases defined in a<br \/>\nfunction are not available until after that function is executed.\u00a0 To<br \/>\nbe safe, always put alias definitions on a separate line, and do not<br \/>\nuse alias in compound commands.<\/p>\n<p>For almost every purpose, aliases are superseded by shell functions.<\/p>\n<p>FUNCTIONS<\/p>\n<p>A shell function, defined as described above under SHELL GRAMMAR,<br \/>\nstores a series of commands for later execution.\u00a0 When the name of a<br \/>\nshell function is used as a simple command name, the list of commands<br \/>\nassociated with that function name is executed.\u00a0 Functions are<br \/>\nexecuted in the context of the current shell; no new process is<br \/>\ncreated to interpret them (contrast this with the execution of a<br \/>\nshell script).\u00a0 When a function is executed, the arguments to the<br \/>\nfunction become the positional parameters during its execution.\u00a0 The<br \/>\nspecial parameter # is updated to reflect the change.\u00a0 Special<br \/>\nparameter 0 is unchanged.\u00a0 The first element of the FUNCNAME variable<br \/>\nis set to the name of the function while the function is executing.<\/p>\n<p>All other aspects of the shell execution environment are identical<br \/>\nbetween a function and its caller with these exceptions:\u00a0 the DEBUG<br \/>\nand RETURN traps (see the description of the trap builtin under SHELL<br \/>\nBUILTIN COMMANDS below) are not inherited unless the function has<br \/>\nbeen given the trace attribute (see the description of the declare<br \/>\nbuiltin below) or the -o functrace shell option has been enabled with<br \/>\nthe set builtin (in which case all functions inherit the DEBUG and<br \/>\nRETURN traps), and the ERR trap is not inherited unless the -o<br \/>\nerrtrace shell option has been enabled.<\/p>\n<p>Variables local to the function may be declared with the local<br \/>\nbuiltin command.\u00a0 Ordinarily, variables and their values are shared<br \/>\nbetween the function and its caller.<\/p>\n<p>The FUNCNEST variable, if set to a numeric value greater than 0,<br \/>\ndefines a maximum function nesting level.\u00a0 Function invocations that<br \/>\nexceed the limit cause the entire command to abort.<\/p>\n<p>If the builtin command return is executed in a function, the function<br \/>\ncompletes and execution resumes with the next command after the<br \/>\nfunction call.\u00a0 Any command associated with the RETURN trap is<br \/>\nexecuted before execution resumes.\u00a0 When a function completes, the<br \/>\nvalues of the positional parameters and the special parameter # are<br \/>\nrestored to the values they had prior to the function&#8217;s execution.<\/p>\n<p>Function names and definitions may be listed with the -f option to<br \/>\nthe declare or typeset builtin commands.\u00a0 The -F option to declare or<br \/>\ntypeset will list the function names only (and optionally the source<br \/>\nfile and line number, if the extdebug shell option is enabled).<br \/>\nFunctions may be exported so that subshells automatically have them<br \/>\ndefined with the -f option to the export builtin.\u00a0 A function<br \/>\ndefinition may be deleted using the -f option to the unset builtin.<br \/>\nNote that shell functions and variables with the same name may result<br \/>\nin multiple identically-named entries in the environment passed to<br \/>\nthe shell&#8217;s children.\u00a0 Care should be taken in cases where this may<br \/>\ncause a problem.<\/p>\n<p>Functions may be recursive.\u00a0 The FUNCNEST variable may be used to<br \/>\nlimit the depth of the function call stack and restrict the number of<br \/>\nfunction invocations.\u00a0 By default, no limit is imposed on the number<br \/>\nof recursive calls.<\/p>\n<p>ARITHMETIC EVALUATION<\/p>\n<p>The shell allows arithmetic expressions to be evaluated, under<br \/>\ncertain circumstances (see the let and declare builtin commands and<br \/>\nArithmetic Expansion).\u00a0 Evaluation is done in fixed-width integers<br \/>\nwith no check for overflow, though division by 0 is trapped and<br \/>\nflagged as an error.\u00a0 The operators and their precedence,<br \/>\nassociativity, and values are the same as in the C language.\u00a0 The<br \/>\nfollowing list of operators is grouped into levels of equal-<br \/>\nprecedence operators.\u00a0 The levels are listed in order of decreasing<br \/>\nprecedence.<\/p>\n<p>id++ id&#8211;<br \/>\nvariable post-increment and post-decrement<br \/>\n++id &#8211;id<br \/>\nvariable pre-increment and pre-decrement<br \/>\n&#8211; +\u00a0\u00a0\u00a0 unary minus and plus<br \/>\n! ~\u00a0\u00a0\u00a0 logical and bitwise negation<br \/>\n**\u00a0\u00a0\u00a0\u00a0 exponentiation<br \/>\n* \/ %\u00a0 multiplication, division, remainder<br \/>\n+ &#8211;\u00a0\u00a0\u00a0 addition, subtraction<br \/>\n&lt;&lt; &gt;&gt;\u00a0 left and right bitwise shifts<br \/>\n&lt;= &gt;= &lt; &gt;<br \/>\ncomparison<br \/>\n== !=\u00a0 equality and inequality<br \/>\n&amp;\u00a0\u00a0\u00a0\u00a0\u00a0 bitwise AND<br \/>\n^\u00a0\u00a0\u00a0\u00a0\u00a0 bitwise exclusive OR<br \/>\n|\u00a0\u00a0\u00a0\u00a0\u00a0 bitwise OR<br \/>\n&amp;&amp;\u00a0\u00a0\u00a0\u00a0 logical AND<br \/>\n||\u00a0\u00a0\u00a0\u00a0 logical OR<br \/>\nexpr?expr:expr<br \/>\nconditional operator<br \/>\n= *= \/= %= += -= &lt;&lt;= &gt;&gt;= &amp;= ^= |=<br \/>\nassignment<br \/>\nexpr1 , expr2<br \/>\ncomma<\/p>\n<p>Shell variables are allowed as operands; parameter expansion is<br \/>\nperformed before the expression is evaluated.\u00a0 Within an expression,<br \/>\nshell variables may also be referenced by name without using the<br \/>\nparameter expansion syntax.\u00a0 A shell variable that is null or unset<br \/>\nevaluates to 0 when referenced by name without using the parameter<br \/>\nexpansion syntax.\u00a0 The value of a variable is evaluated as an<br \/>\narithmetic expression when it is referenced, or when a variable which<br \/>\nhas been given the integer attribute using declare -i is assigned a<br \/>\nvalue.\u00a0 A null value evaluates to 0.\u00a0 A shell variable need not have<br \/>\nits integer attribute turned on to be used in an expression.<\/p>\n<p>Constants with a leading 0 are interpreted as octal numbers.\u00a0 A<br \/>\nleading 0x or 0X denotes hexadecimal.\u00a0 Otherwise, numbers take the<br \/>\nform [base#]n, where the optional base is a decimal number between 2<br \/>\nand 64 representing the arithmetic base, and n is a number in that<br \/>\nbase.\u00a0 If base# is omitted, then base 10 is used.\u00a0 When specifying n,<br \/>\nthe digits greater&lt; than 9 are represented by the lowercase letters,<br \/>\nthe uppercase letters, @, and _, in that order.\u00a0 If base is less than<br \/>\nor equal to 36, lowercase and uppercase letters may be used<br \/>\ninterchangeably to represent numbers between 10 and 35.<\/p>\n<p>Operators are evaluated in order of precedence.\u00a0 Sub-expressions in<br \/>\nparentheses are evaluated first and may override the precedence rules<br \/>\nabove.<\/p>\n<p>CONDITIONAL EXPRESSIONS<\/p>\n<p>Conditional expressions are used by the [[ compound command and the<br \/>\ntest and [ builtin commands to test file attributes and perform<br \/>\nstring and arithmetic comparisons.\u00a0 Expressions are formed from the<br \/>\nfollowing unary or binary primaries.\u00a0 If any file argument to one of<br \/>\nthe primaries is of the form \/dev\/fd\/n, then file descriptor n is<br \/>\nchecked.\u00a0 If the file argument to one of the primaries is one of<br \/>\n\/dev\/stdin, \/dev\/stdout, or \/dev\/stderr, file descriptor 0, 1, or 2,<br \/>\nrespectively, is checked.<\/p>\n<p>Unless otherwise specified, primaries that operate on files follow<br \/>\nsymbolic links and operate on the target of the link, rather than the<br \/>\nlink itself.<\/p>\n<p>When used with [[, the &lt; and &gt; operators sort lexicographically using<br \/>\nthe current locale.\u00a0 The test command sorts using ASCII ordering.<\/p>\n<p>-a file<br \/>\nTrue if file exists.<br \/>\n-b file<br \/>\nTrue if file exists and is a block special file.<br \/>\n-c file<br \/>\nTrue if file exists and is a character special file.<br \/>\n-d file<br \/>\nTrue if file exists and is a directory.<br \/>\n-e file<br \/>\nTrue if file exists.<br \/>\n-f file<br \/>\nTrue if file exists and is a regular file.<br \/>\n-g file<br \/>\nTrue if file exists and is set-group-id.<br \/>\n-h file<br \/>\nTrue if file exists and is a symbolic link.<br \/>\n-k file<br \/>\nTrue if file exists and its &#8220;sticky&#8221; bit is set.<br \/>\n-p file<br \/>\nTrue if file exists and is a named pipe (FIFO).<br \/>\n-r file<br \/>\nTrue if file exists and is readable.<br \/>\n-s file<br \/>\nTrue if file exists and has a size greater than zero.<br \/>\n-t fd\u00a0 True if file descriptor fd is open and refers to a terminal.<br \/>\n-u file<br \/>\nTrue if file exists and its set-user-id bit is set.<br \/>\n-w file<br \/>\nTrue if file exists and is writable.<br \/>\n-x file<br \/>\nTrue if file exists and is executable.<br \/>\n-G file<br \/>\nTrue if file exists and is owned by the effective group id.<br \/>\n-L file<br \/>\nTrue if file exists and is a symbolic link.<br \/>\n-N file<br \/>\nTrue if file exists and has been modified since it was last<br \/>\nread.<br \/>\n-O file<br \/>\nTrue if file exists and is owned by the effective user id.<br \/>\n-S file<br \/>\nTrue if file exists and is a socket.<br \/>\nfile1 -ef file2<br \/>\nTrue if file1 and file2 refer to the same device and inode<br \/>\nnumbers.<br \/>\nfile1 -nt file2<br \/>\nTrue if file1 is newer (according to modification date) than<br \/>\nfile2, or if file1 exists and file2 does not.<br \/>\nfile1 -ot file2<br \/>\nTrue if file1 is older than file2, or if file2 exists and<br \/>\nfile1 does not.<br \/>\n-o optname<br \/>\nTrue if the shell option optname is enabled.\u00a0 See the list of<br \/>\noptions under the description of the -o option to the set<br \/>\nbuiltin below.<br \/>\n-v varname<br \/>\nTrue if the shell variable varname is set (has been assigned a<br \/>\nvalue).<br \/>\n-R varname<br \/>\nTrue if the shell variable varname is set and is a name<br \/>\nreference.<br \/>\n-z string<br \/>\nTrue if the length of string is zero.<br \/>\nstring<br \/>\n-n string<br \/>\nTrue if the length of string is non-zero.<\/p>\n<p>string1 == string2<br \/>\nstring1 = string2<br \/>\nTrue if the strings are equal.\u00a0 = should be used with the test<br \/>\ncommand for POSIX conformance.\u00a0 When used with the [[ command,<br \/>\nthis performs pattern matching as described above (Compound<br \/>\nCommands).<\/p>\n<p>string1 != string2<br \/>\nTrue if the strings are not equal.<\/p>\n<p>string1 &lt; string2<br \/>\nTrue if string1 sorts before string2 lexicographically.<\/p>\n<p>string1 &gt; string2<br \/>\nTrue if string1 sorts after string2 lexicographically.<\/p>\n<p>arg1 OP arg2<br \/>\nOP is one of -eq, -ne, -lt, -le, -gt, or -ge.\u00a0 These<br \/>\narithmetic binary operators return true if arg1 is equal to,<br \/>\nnot equal to, less than, less than or equal to, greater than,<br \/>\nor greater than or equal to arg2, respectively.\u00a0 Arg1 and arg2<br \/>\nmay be positive or negative integers.<\/p>\n<p>SIMPLE COMMAND EXPANSION<\/p>\n<p>When a simple command is executed, the shell performs the following<br \/>\nexpansions, assignments, and redirections, from left to right.<\/p>\n<p>1.\u00a0\u00a0\u00a0\u00a0 The words that the parser has marked as variable assignments<br \/>\n(those preceding the command name) and redirections are saved<br \/>\nfor later processing.<\/p>\n<p>2.\u00a0\u00a0\u00a0\u00a0 The words that are not variable assignments or redirections<br \/>\nare expanded.\u00a0 If any words remain after expansion, the first<br \/>\nword is taken to be the name of the command and the remaining<br \/>\nwords are the arguments.<\/p>\n<p>3.\u00a0\u00a0\u00a0\u00a0 Redirections are performed as described above under<br \/>\nREDIRECTION.<\/p>\n<p>4.\u00a0\u00a0\u00a0\u00a0 The text after the = in each variable assignment undergoes<br \/>\ntilde expansion, parameter expansion, command substitution,<br \/>\narithmetic expansion, and quote removal before being assigned<br \/>\nto the variable.<\/p>\n<p>If no command name results, the variable assignments affect the<br \/>\ncurrent shell environment.\u00a0 Otherwise, the variables are added to the<br \/>\nenvironment of the executed command and do not affect the current<br \/>\nshell environment.\u00a0 If any of the assignments attempts to assign a<br \/>\nvalue to a readonly variable, an error occurs, and the command exits<br \/>\nwith a non-zero status.<\/p>\n<p>If no command name results, redirections are performed, but do not<br \/>\naffect the current shell environment.\u00a0 A redirection error causes the<br \/>\ncommand to exit with a non-zero status.<\/p>\n<p>If there is a command name left after expansion, execution proceeds<br \/>\nas described below.\u00a0 Otherwise, the command exits.\u00a0 If one of the<br \/>\nexpansions contained a command substitution, the exit status of the<br \/>\ncommand is the exit status of the last command substitution<br \/>\nperformed.\u00a0 If there were no command substitutions, the command exits<br \/>\nwith a status of zero.<\/p>\n<p>COMMAND EXECUTION<\/p>\n<p>After a command has been split into words, if it results in a simple<br \/>\ncommand and an optional list of arguments, the following actions are<br \/>\ntaken.<\/p>\n<p>If the command name contains no slashes, the shell attempts to locate<br \/>\nit.\u00a0 If there exists a shell function by that name, that function is<br \/>\ninvoked as described above in FUNCTIONS.\u00a0 If the name does not match<br \/>\na function, the shell searches for it in the list of shell builtins.<br \/>\nIf a match is found, that builtin is invoked.<\/p>\n<p>If the name is neither a shell function nor a builtin, and contains<br \/>\nno slashes, bash searches each element of the PATH for a directory<br \/>\ncontaining an executable file by that name.\u00a0 Bash uses a hash table<br \/>\nto remember the full pathnames of executable files (see hash under<br \/>\nSHELL BUILTIN COMMANDS below).\u00a0 A full search of the directories in<br \/>\nPATH is performed only if the command is not found in the hash table.<br \/>\nIf the search is unsuccessful, the shell searches for a defined shell<br \/>\nfunction named command_not_found_handle.\u00a0 If that function exists, it<br \/>\nis invoked with the original command and the original command&#8217;s<br \/>\narguments as its arguments, and the function&#8217;s exit status becomes<br \/>\nthe exit status of the shell.\u00a0 If that function is not defined, the<br \/>\nshell prints an error message and returns an exit status of 127.<\/p>\n<p>If the search is successful, or if the command name contains one or<br \/>\nmore slashes, the shell executes the named program in a separate<br \/>\nexecution environment.\u00a0 Argument 0 is set to the name given, and the<br \/>\nremaining arguments to the command are set to the arguments given, if<br \/>\nany.<\/p>\n<p>If this execution fails because the file is not in executable format,<br \/>\nand the file is not a directory, it is assumed to be a shell script,<br \/>\na file containing shell commands.\u00a0 A subshell is spawned to execute<br \/>\nit.\u00a0 This subshell reinitializes itself, so that the effect is as if<br \/>\na new shell had been invoked to handle the script, with the exception<br \/>\nthat the locations of commands remembered by the parent (see hash<br \/>\nbelow under SHELL BUILTIN COMMANDS) are retained by the child.<\/p>\n<p>If the program is a file beginning with #!, the remainder of the<br \/>\nfirst line specifies an interpreter for the program.\u00a0 The shell<br \/>\nexecutes the specified interpreter on operating systems that do not<br \/>\nhandle this executable format themselves.\u00a0 The arguments to the<br \/>\ninterpreter consist of a single optional argument following the<br \/>\ninterpreter name on the first line of the program, followed by the<br \/>\nname of the program, followed by the command arguments, if any.<\/p>\n<p>COMMAND EXECUTION ENVIRONMENT<\/p>\n<p>The shell has an execution environment, which consists of the<br \/>\nfollowing:<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 open files inherited by the shell at invocation, as modified<br \/>\nby redirections supplied to the exec builtin<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 the current working directory as set by cd, pushd, or popd, or<br \/>\ninherited by the shell at invocation<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 the file creation mode mask as set by umask or inherited from<br \/>\nthe shell&#8217;s parent<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 current traps set by trap<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 shell parameters that are set by variable assignment or with<br \/>\nset or inherited from the shell&#8217;s parent in the environment<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 shell functions defined during execution or inherited from the<br \/>\nshell&#8217;s parent in the environment<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 options enabled at invocation (either by default or with<br \/>\ncommand-line arguments) or by set<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 options enabled by shopt<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 shell aliases defined with alias<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 various process IDs, including those of background jobs, the<br \/>\nvalue of $$, and the value of PPID<\/p>\n<p>When a simple command other than a builtin or shell function is to be<br \/>\nexecuted, it is invoked in a separate execution environment that<br \/>\nconsists of the following.\u00a0 Unless otherwise noted, the values are<br \/>\ninherited from the shell.<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 the shell&#8217;s open files, plus any modifications and additions<br \/>\nspecified by redirections to the command<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 the current working directory<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 the file creation mode mask<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 shell variables and functions marked for export, along with<br \/>\nvariables exported for the command, passed in the environment<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 traps caught by the shell are reset to the values inherited<br \/>\nfrom the shell&#8217;s parent, and traps ignored by the shell are<br \/>\nignored<\/p>\n<p>A command invoked in this separate environment cannot affect the<br \/>\nshell&#8217;s execution environment.<\/p>\n<p>Command substitution, commands grouped with parentheses, and<br \/>\nasynchronous commands are invoked in a subshell environment that is a<br \/>\nduplicate of the shell environment, except that traps caught by the<br \/>\nshell are reset to the values that the shell inherited from its<br \/>\nparent at invocation.\u00a0 Builtin commands that are invoked as part of a<br \/>\npipeline are also executed in a subshell environment.\u00a0 Changes made<br \/>\nto the subshell environment cannot affect the shell&#8217;s execution<br \/>\nenvironment.<\/p>\n<p>Subshells spawned to execute command substitutions inherit the value<br \/>\nof the -e option from the parent shell.\u00a0 When not in posix mode, bash<br \/>\nclears the -e option in such subshells.<\/p>\n<p>If a command is followed by a &amp; and job control is not active, the<br \/>\ndefault standard input for the command is the empty file \/dev\/null.<br \/>\nOtherwise, the invoked command inherits the file descriptors of the<br \/>\ncalling shell as modified by redirections.<\/p>\n<p>ENVIRONMENT<\/p>\n<p>When a program is invoked it is given an array of strings called the<br \/>\nenvironment.\u00a0 This is a list of name-value pairs, of the form<br \/>\nname=value.<\/p>\n<p>The shell provides several ways to manipulate the environment.\u00a0 On<br \/>\ninvocation, the shell scans its own environment and creates a<br \/>\nparameter for each name found, automatically marking it for export to<br \/>\nchild processes.\u00a0 Executed commands inherit the environment.\u00a0 The<br \/>\nexport and declare -x commands allow parameters and functions to be<br \/>\nadded to and deleted from the environment.\u00a0 If the value of a<br \/>\nparameter in the environment is modified, the new value becomes part<br \/>\nof the environment, replacing the old.\u00a0 The environment inherited by<br \/>\nany executed command consists of the shell&#8217;s initial environment,<br \/>\nwhose values may be modified in the shell, less any pairs removed by<br \/>\nthe unset command, plus any additions via the export and declare -x<br \/>\ncommands.<\/p>\n<p>The environment for any simple command or function may be augmented<br \/>\ntemporarily by prefixing it with parameter assignments, as described<br \/>\nabove in PARAMETERS.\u00a0 These assignment statements affect only the<br \/>\nenvironment seen by that command.<\/p>\n<p>If the -k option is set (see the set builtin command below), then all<br \/>\nparameter assignments are placed in the environment for a command,<br \/>\nnot just those that precede the command name.<\/p>\n<p>When bash invokes an external command, the variable _ is set to the<br \/>\nfull filename of the command and passed to that command in its<br \/>\nenvironment.<\/p>\n<p>EXIT STATUS<\/p>\n<p>The exit status of an executed command is the value returned by the<br \/>\nwaitpid system call or equivalent function.\u00a0 Exit statuses fall<br \/>\nbetween 0 and 255, though, as explained below, the shell may use<br \/>\nvalues above 125 specially.\u00a0 Exit statuses from shell builtins and<br \/>\ncompound commands are also limited to this range. Under certain<br \/>\ncircumstances, the shell will use special values to indicate specific<br \/>\nfailure modes.<\/p>\n<p>For the shell&#8217;s purposes, a command which exits with a zero exit<br \/>\nstatus has succeeded.\u00a0 An exit status of zero indicates success.\u00a0 A<br \/>\nnon-zero exit status indicates failure.\u00a0 When a command terminates on<br \/>\na fatal signal N, bash uses the value of 128+N as the exit status.<\/p>\n<p>If a command is not found, the child process created to execute it<br \/>\nreturns a status of 127.\u00a0 If a command is found but is not<br \/>\nexecutable, the return status is 126.<\/p>\n<p>If a command fails because of an error during expansion or<br \/>\nredirection, the exit status is greater than zero.<\/p>\n<p>Shell builtin commands return a status of 0 (true) if successful, and<br \/>\nnon-zero (false) if an error occurs while they execute.\u00a0 All builtins<br \/>\nreturn an exit status of 2 to indicate incorrect usage.<\/p>\n<p>Bash itself returns the exit status of the last command executed,<br \/>\nunless a syntax error occurs, in which case it exits with a non-zero<br \/>\nvalue.\u00a0 See also the exit builtin command below.<\/p>\n<p>SIGNALS<\/p>\n<p>When bash is interactive, in the absence of any traps, it ignores<br \/>\nSIGTERM (so that kill 0 does not kill an interactive shell), and<br \/>\nSIGINT is caught and handled (so that the wait builtin is<br \/>\ninterruptible).\u00a0 In all cases, bash ignores SIGQUIT.\u00a0 If job control<br \/>\nis in effect, bash ignores SIGTTIN, SIGTTOU, and SIGTSTP.<\/p>\n<p>Non-builtin commands run by bash have signal handlers set to the<br \/>\nvalues inherited by the shell from its parent.\u00a0 When job control is<br \/>\nnot in effect, asynchronous commands ignore SIGINT and SIGQUIT in<br \/>\naddition to these inherited handlers.\u00a0 Commands run as a result of<br \/>\ncommand substitution ignore the keyboard-generated job control<br \/>\nsignals SIGTTIN, SIGTTOU, and SIGTSTP.<\/p>\n<p>The shell exits by default upon receipt of a SIGHUP.\u00a0 Before exiting,<br \/>\nan interactive shell resends the SIGHUP to all jobs, running or<br \/>\nstopped.\u00a0 Stopped jobs are sent SIGCONT to ensure that they receive<br \/>\nthe SIGHUP.\u00a0 To prevent the shell from sending the signal to a<br \/>\nparticular job, it should be removed from the jobs table with the<br \/>\ndisown builtin (see SHELL BUILTIN COMMANDS below) or marked to not<br \/>\nreceive SIGHUP using disown -h.<\/p>\n<p>If the huponexit shell option has been set with shopt, bash sends a<br \/>\nSIGHUP to all jobs when an interactive login shell exits.<\/p>\n<p>If bash is waiting for a command to complete and receives a signal<br \/>\nfor which a trap has been set, the trap will not be executed until<br \/>\nthe command completes.\u00a0 When bash is waiting for an asynchronous<br \/>\ncommand via the wait builtin, the reception of a signal for which a<br \/>\ntrap has been set will cause the wait builtin to return immediately<br \/>\nwith an exit status greater than 128, immediately after which the<br \/>\ntrap is executed.<\/p>\n<p>JOB CONTROL<\/p>\n<p>Job control refers to the ability to selectively stop (suspend) the<br \/>\nexecution of processes and continue (resume) their execution at a<br \/>\nlater point.\u00a0 A user typically employs this facility via an<br \/>\ninteractive interface supplied jointly by the operating system<br \/>\nkernel&#8217;s terminal driver and bash.<\/p>\n<p>The shell associates a job with each pipeline.\u00a0 It keeps a table of<br \/>\ncurrently executing jobs, which may be listed with the jobs command.<br \/>\nWhen bash starts a job asynchronously (in the background), it prints<br \/>\na line that looks like:<\/p>\n<p>[1] 25647<\/p>\n<p>indicating that this job is job number 1 and that the process ID of<br \/>\nthe last process in the pipeline associated with this job is 25647.<br \/>\nAll of the processes in a single pipeline are members of the same<br \/>\njob.\u00a0 Bash uses the job abstraction as the basis for job control.<\/p>\n<p>To facilitate the implementation of the user interface to job<br \/>\ncontrol, the operating system maintains the notion of a current<br \/>\nterminal process group ID.\u00a0 Members of this process group (processes<br \/>\nwhose process group ID is equal to the current terminal process group<br \/>\nID) receive keyboard-generated signals such as SIGINT.\u00a0 These<br \/>\nprocesses are said to be in the foreground.\u00a0 Background processes are<br \/>\nthose whose process group ID differs from the terminal&#8217;s; such<br \/>\nprocesses are immune to keyboard-generated signals.\u00a0 Only foreground<br \/>\nprocesses are allowed to read from or, if the user so specifies with<br \/>\nstty tostop, write to the terminal.\u00a0 Background processes which<br \/>\nattempt to read from (write to when stty tostop is in effect) the<br \/>\nterminal are sent a SIGTTIN (SIGTTOU) signal by the kernel&#8217;s terminal<br \/>\ndriver, which, unless caught, suspends the process.<\/p>\n<p>If the operating system on which bash is running supports job<br \/>\ncontrol, bash contains facilities to use it.\u00a0 Typing the suspend<br \/>\ncharacter (typically ^Z, Control-Z) while a process is running causes<br \/>\nthat process to be stopped and returns control to bash.\u00a0 Typing the<br \/>\ndelayed suspend character (typically ^Y, Control-Y) causes the<br \/>\nprocess to be stopped when it attempts to read input from the<br \/>\nterminal, and control to be returned to bash.\u00a0 The user may then<br \/>\nmanipulate the state of this job, using the bg command to continue it<br \/>\nin the background, the fg command to continue it in the foreground,<br \/>\nor the kill command to kill it.\u00a0 A ^Z takes effect immediately, and<br \/>\nhas the additional side effect of causing pending output and<br \/>\ntypeahead to be discarded.<\/p>\n<p>There are a number of ways to refer to a job in the shell.\u00a0 The<br \/>\ncharacter % introduces a job specification (jobspec).\u00a0 Job number n<br \/>\nmay be referred to as %n.\u00a0 A job may also be referred to using a<br \/>\nprefix of the name used to start it, or using a substring that<br \/>\nappears in its command line.\u00a0 For example, %ce refers to a stopped ce<br \/>\njob.\u00a0 If a prefix matches more than one job, bash reports an error.<br \/>\nUsing %?ce, on the other hand, refers to any job containing the<br \/>\nstring ce in its command line.\u00a0 If the substring matches more than<br \/>\none job, bash reports an error.\u00a0 The symbols %% and %+ refer to the<br \/>\nshell&#8217;s notion of the current job, which is the last job stopped<br \/>\nwhile it was in the foreground or started in the background.\u00a0 The<br \/>\nprevious job may be referenced using %-.\u00a0 If there is only a single<br \/>\njob, %+ and %- can both be used to refer to that job.\u00a0 In output<br \/>\npertaining to jobs (e.g., the output of the jobs command), the<br \/>\ncurrent job is always flagged with a +, and the previous job with a<br \/>\n-.\u00a0 A single % (with no accompanying job specification) also refers<br \/>\nto the current job.<\/p>\n<p>Simply naming a job can be used to bring it into the foreground: %1<br \/>\nis a synonym for &#8220;fg %1&#8221;, bringing job 1 from the background into<br \/>\nthe foreground.\u00a0 Similarly, &#8220;%1 &amp;&#8221; resumes job 1 in the background,<br \/>\nequivalent to &#8220;bg %1&#8221;.<\/p>\n<p>The shell learns immediately whenever a job changes state.\u00a0 Normally,<br \/>\nbash waits until it is about to print a prompt before reporting<br \/>\nchanges in a job&#8217;s status so as to not interrupt any other output.<br \/>\nIf the -b option to the set builtin command is enabled, bash reports<br \/>\nsuch changes immediately.\u00a0 Any trap on SIGCHLD is executed for each<br \/>\nchild that exits.<\/p>\n<p>If an attempt to exit bash is made while jobs are stopped (or, if the<br \/>\ncheckjobs shell option has been enabled using the shopt builtin,<br \/>\nrunning), the shell prints a warning message, and, if the checkjobs<br \/>\noption is enabled, lists the jobs and their statuses.\u00a0 The jobs<br \/>\ncommand may then be used to inspect their status.\u00a0 If a second<br \/>\nattempt to exit is made without an intervening command, the shell<br \/>\ndoes not print another warning, and any stopped jobs are terminated.<\/p>\n<p>PROMPTING<\/p>\n<p>When executing interactively, bash displays the primary prompt PS1<br \/>\nwhen it is ready to read a command, and the secondary prompt PS2 when<br \/>\nit needs more input to complete a command.\u00a0 Bash allows these prompt<br \/>\nstrings to be customized by inserting a number of backslash-escaped<br \/>\nspecial characters that are decoded as follows:<br \/>\n\\a\u00a0\u00a0\u00a0\u00a0 an ASCII bell character (07)<br \/>\n\\d\u00a0\u00a0\u00a0\u00a0 the date in &#8220;Weekday Month Date&#8221; format (e.g., &#8220;Tue May<br \/>\n26&#8221;)<br \/>\n\\D{format}<br \/>\nthe format is passed to strftime(3) and the result is<br \/>\ninserted into the prompt string; an empty format<br \/>\nresults in a locale-specific time representation.\u00a0 The<br \/>\nbraces are required<br \/>\n\\e\u00a0\u00a0\u00a0\u00a0 an ASCII escape character (033)<br \/>\n\\h\u00a0\u00a0\u00a0\u00a0 the hostname up to the first `.&#8217;<br \/>\n\\H\u00a0\u00a0\u00a0\u00a0 the hostname<br \/>\n\\j\u00a0\u00a0\u00a0\u00a0 the number of jobs currently managed by the shell<br \/>\n\\l\u00a0\u00a0\u00a0\u00a0 the basename of the shell&#8217;s terminal device name<br \/>\n\\n\u00a0\u00a0\u00a0\u00a0 newline<br \/>\n\\r\u00a0\u00a0\u00a0\u00a0 carriage return<br \/>\n\\s\u00a0\u00a0\u00a0\u00a0 the name of the shell, the basename of $0 (the portion<br \/>\nfollowing the final slash)<br \/>\n\\t\u00a0\u00a0\u00a0\u00a0 the current time in 24-hour HH:MM:SS format<br \/>\n\\T\u00a0\u00a0\u00a0\u00a0 the current time in 12-hour HH:MM:SS format<br \/>\n\\@\u00a0\u00a0\u00a0\u00a0 the current time in 12-hour am\/pm format<br \/>\n\\A\u00a0\u00a0\u00a0\u00a0 the current time in 24-hour HH:MM format<br \/>\n\\u\u00a0\u00a0\u00a0\u00a0 the username of the current user<br \/>\n\\v\u00a0\u00a0\u00a0\u00a0 the version of bash (e.g., 2.00)<br \/>\n\\V\u00a0\u00a0\u00a0\u00a0 the release of bash, version + patch level (e.g.,<br \/>\n2.00.0)<br \/>\n\\w\u00a0\u00a0\u00a0\u00a0 the current working directory, with $HOME abbreviated<br \/>\nwith a tilde (uses the value of the PROMPT_DIRTRIM<br \/>\nvariable)<br \/>\n\\W\u00a0\u00a0\u00a0\u00a0 the basename of the current working directory, with<br \/>\n$HOME abbreviated with a tilde<br \/>\n\\!\u00a0\u00a0\u00a0\u00a0 the history number of this command<br \/>\n\\#\u00a0\u00a0\u00a0\u00a0 the command number of this command<br \/>\n\\$\u00a0\u00a0\u00a0\u00a0 if the effective UID is 0, a #, otherwise a $<br \/>\n\\nnn\u00a0\u00a0 the character corresponding to the octal number nnn<br \/>\n\\\\\u00a0\u00a0\u00a0\u00a0 a backslash<br \/>\n\\[\u00a0\u00a0\u00a0\u00a0 begin a sequence of non-printing characters, which<br \/>\ncould be used to embed a terminal control sequence into<br \/>\nthe prompt<br \/>\n\\]\u00a0\u00a0\u00a0\u00a0 end a sequence of non-printing characters<\/p>\n<p>The command number and the history number are usually different: the<br \/>\nhistory number of a command is its position in the history list,<br \/>\nwhich may include commands restored from the history file (see<br \/>\nHISTORY below), while the command number is the position in the<br \/>\nsequence of commands executed during the current shell session.<br \/>\nAfter the string is decoded, it is expanded via parameter expansion,<br \/>\ncommand substitution, arithmetic expansion, and quote removal,<br \/>\nsubject to the value of the promptvars shell option (see the<br \/>\ndescription of the shopt command under SHELL BUILTIN COMMANDS below).<\/p>\n<p>READLINE<\/p>\n<p>This is the library that handles reading input when using an<br \/>\ninteractive shell, unless the &#8211;noediting option is given at shell<br \/>\ninvocation.\u00a0 Line editing is also used when using the -e option to<br \/>\nthe read builtin.\u00a0 By default, the line editing commands are similar<br \/>\nto those of Emacs.\u00a0 A vi-style line editing interface is also<br \/>\navailable.\u00a0 Line editing can be enabled at any time using the -o<br \/>\nemacs or -o vi options to the set builtin (see SHELL BUILTIN COMMANDS<br \/>\nbelow).\u00a0 To turn off line editing after the shell is running, use the<br \/>\n+o emacs or +o vi options to the set builtin.<\/p>\n<p>Readline Notation<br \/>\nIn this section, the Emacs-style notation is used to denote<br \/>\nkeystrokes.\u00a0 Control keys are denoted by C-key, e.g., C-n means<br \/>\nControl-N.\u00a0 Similarly, meta keys are denoted by M-key, so M-x means<br \/>\nMeta-X.\u00a0 (On keyboards without a meta key, M-x means ESC x, i.e.,<br \/>\npress the Escape key then the x key.\u00a0 This makes ESC the meta prefix.<br \/>\nThe combination M-C-x means ESC-Control-x, or press the Escape key<br \/>\nthen hold the Control key while pressing the x key.)<\/p>\n<p>Readline commands may be given numeric arguments, which normally act<br \/>\nas a repeat count.\u00a0 Sometimes, however, it is the sign of the<br \/>\nargument that is significant.\u00a0 Passing a negative argument to a<br \/>\ncommand that acts in the forward direction (e.g., kill-line) causes<br \/>\nthat command to act in a backward direction.\u00a0 Commands whose behavior<br \/>\nwith arguments deviates from this are noted below.<\/p>\n<p>When a command is described as killing text, the text deleted is<br \/>\nsaved for possible future retrieval (yanking).\u00a0 The killed text is<br \/>\nsaved in a kill ring.\u00a0 Consecutive kills cause the text to be<br \/>\naccumulated into one unit, which can be yanked all at once.\u00a0 Commands<br \/>\nwhich do not kill text separate the chunks of text on the kill ring.<\/p>\n<p>Readline Initialization<br \/>\nReadline is customized by putting commands in an initialization file<br \/>\n(the inputrc file).\u00a0 The name of this file is taken from the value of<br \/>\nthe INPUTRC variable.\u00a0 If that variable is unset, the default is<br \/>\n~\/.inputrc.\u00a0 When a program which uses the readline library starts<br \/>\nup, the initialization file is read, and the key bindings and<br \/>\nvariables are set.\u00a0 There are only a few basic constructs allowed in<br \/>\nthe readline initialization file.\u00a0 Blank lines are ignored.\u00a0 Lines<br \/>\nbeginning with a # are comments.\u00a0 Lines beginning with a $ indicate<br \/>\nconditional constructs.\u00a0 Other lines denote key bindings and variable<br \/>\nsettings.<\/p>\n<p>The default key-bindings may be changed with an inputrc file.\u00a0 Other<br \/>\nprograms that use this library may add their own commands and<br \/>\nbindings.<\/p>\n<p>For example, placing<\/p>\n<p>M-Control-u: universal-argument<br \/>\nor<br \/>\nC-Meta-u: universal-argument<br \/>\ninto the inputrc would make M-C-u execute the readline command<br \/>\nuniversal-argument.<\/p>\n<p>The following symbolic character names are recognized: RUBOUT, DEL,<br \/>\nESC, LFD, NEWLINE, RET, RETURN, SPC, SPACE, and TAB.<\/p>\n<p>In addition to command names, readline allows keys to be bound to a<br \/>\nstring that is inserted when the key is pressed (a macro).<\/p>\n<p>Readline Key Bindings<br \/>\nThe syntax for controlling key bindings in the inputrc file is<br \/>\nsimple.\u00a0 All that is required is the name of the command or the text<br \/>\nof a macro and a key sequence to which it should be bound. The name<br \/>\nmay be specified in one of two ways: as a symbolic key name, possibly<br \/>\nwith Meta- or Control- prefixes, or as a key sequence.<\/p>\n<p>When using the form keyname:function-name or macro, keyname is the<br \/>\nname of a key spelled out in English.\u00a0 For example:<\/p>\n<p>Control-u: universal-argument<br \/>\nMeta-Rubout: backward-kill-word<br \/>\nControl-o: &#8220;&gt; output&#8221;<\/p>\n<p>In the above example, C-u is bound to the function<br \/>\nuniversal-argument, M-DEL is bound to the function<br \/>\nbackward-kill-word, and C-o is bound to run the macro expressed on<br \/>\nthe right hand side (that is, to insert the text &#8220;&gt; output&#8221; into<br \/>\nthe line).<\/p>\n<p>In the second form, &#8220;keyseq&#8221;:function-name or macro, keyseq differs<br \/>\nfrom keyname above in that strings denoting an entire key sequence<br \/>\nmay be specified by placing the sequence within double quotes.\u00a0 Some<br \/>\nGNU Emacs style key escapes can be used, as in the following example,<br \/>\nbut the symbolic character names are not recognized.<\/p>\n<p>&#8220;\\C-u&#8221;: universal-argument<br \/>\n&#8220;\\C-x\\C-r&#8221;: re-read-init-file<br \/>\n&#8220;\\e[11~&#8221;: &#8220;Function Key 1&#8243;<\/p>\n<p>In this example, C-u is again bound to the function<br \/>\nuniversal-argument.\u00a0 C-x C-r is bound to the function<br \/>\nre-read-init-file, and ESC [ 1 1 ~ is bound to insert the text<br \/>\n&#8220;Function Key 1&#8221;.<\/p>\n<p>The full set of GNU Emacs style escape sequences is<br \/>\n\\C-\u00a0\u00a0\u00a0 control prefix<br \/>\n\\M-\u00a0\u00a0\u00a0 meta prefix<br \/>\n\\e\u00a0\u00a0\u00a0\u00a0 an escape character<br \/>\n\\\\\u00a0\u00a0\u00a0\u00a0 backslash<br \/>\n\\&#8221;\u00a0\u00a0\u00a0\u00a0 literal &#8221;<br \/>\n\\&#8217;\u00a0\u00a0\u00a0\u00a0 literal &#8216;<\/p>\n<p>In addition to the GNU Emacs style escape sequences, a second set of<br \/>\nbackslash escapes is available:<br \/>\n\\a\u00a0\u00a0\u00a0\u00a0 alert (bell)<br \/>\n\\b\u00a0\u00a0\u00a0\u00a0 backspace<br \/>\n\\d\u00a0\u00a0\u00a0\u00a0 delete<br \/>\n\\f\u00a0\u00a0\u00a0\u00a0 form feed<br \/>\n\\n\u00a0\u00a0\u00a0\u00a0 newline<br \/>\n\\r\u00a0\u00a0\u00a0\u00a0 carriage return<br \/>\n\\t\u00a0\u00a0\u00a0\u00a0 horizontal tab<br \/>\n\\v\u00a0\u00a0\u00a0\u00a0 vertical tab<br \/>\n\\nnn\u00a0\u00a0 the eight-bit character whose value is the octal value<br \/>\nnnn (one to three digits)<br \/>\n\\xHH\u00a0\u00a0 the eight-bit character whose value is the hexadecimal<br \/>\nvalue HH (one or two hex digits)<\/p>\n<p>When entering the text of a macro, single or double quotes must be<br \/>\nused to indicate a macro definition.\u00a0 Unquoted text is assumed to be<br \/>\na function name.\u00a0 In the macro body, the backslash escapes described<br \/>\nabove are expanded.\u00a0 Backslash will quote any other character in the<br \/>\nmacro text, including &#8221; and &#8216;.<\/p>\n<p>Bash allows the current readline key bindings to be displayed or<br \/>\nmodified with the bind builtin command.\u00a0 The editing mode may be<br \/>\nswitched during interactive use by using the -o option to the set<br \/>\nbuiltin command (see SHELL BUILTIN COMMANDS below).<\/p>\n<p>Readline Variables<br \/>\nReadline has variables that can be used to further customize its<br \/>\nbehavior.\u00a0 A variable may be set in the inputrc file with a statement<br \/>\nof the form<\/p>\n<p>set variable-name value<\/p>\n<p>Except where noted, readline variables can take the values On or Off<br \/>\n(without regard to case).\u00a0 Unrecognized variable names are ignored.<br \/>\nWhen a variable value is read, empty or null values, &#8220;on&#8221; (case-<br \/>\ninsensitive), and &#8220;1&#8221; are equivalent to On.\u00a0 All other values are<br \/>\nequivalent to Off.\u00a0 The variables and their default values are:<\/p>\n<p>bell-style (audible)<br \/>\nControls what happens when readline wants to ring the terminal<br \/>\nbell.\u00a0 If set to none, readline never rings the bell.\u00a0 If set<br \/>\nto visible, readline uses a visible bell if one is available.<br \/>\nIf set to audible, readline attempts to ring the terminal&#8217;s<br \/>\nbell.<br \/>\nbind-tty-special-chars (On)<br \/>\nIf set to On, readline attempts to bind the control characters<br \/>\ntreated specially by the kernel&#8217;s terminal driver to their<br \/>\nreadline equivalents.<br \/>\ncolored-stats (Off)<br \/>\nIf set to On, readline displays possible completions using<br \/>\ndifferent colors to indicate their file type.\u00a0 The color<br \/>\ndefinitions are taken from the value of the LS_COLORS<br \/>\nenvironment variable.<br \/>\ncomment-begin (&#8220;#&#8221;)<br \/>\nThe string that is inserted when the readline insert-comment<br \/>\ncommand is executed.\u00a0 This command is bound to M-# in emacs<br \/>\nmode and to # in vi command mode.<br \/>\ncompletion-ignore-case (Off)<br \/>\nIf set to On, readline performs filename matching and<br \/>\ncompletion in a case-insensitive fashion.<br \/>\ncompletion-prefix-display-length (0)<br \/>\nThe length in characters of the common prefix of a list of<br \/>\npossible completions that is displayed without modification.<br \/>\nWhen set to a value greater than zero, common prefixes longer<br \/>\nthan this value are replaced with an ellipsis when displaying<br \/>\npossible completions.<br \/>\ncompletion-query-items (100)<br \/>\nThis determines when the user is queried about viewing the<br \/>\nnumber of possible completions generated by the<br \/>\npossible-completions command.\u00a0 It may be set to any integer<br \/>\nvalue greater than or equal to zero.\u00a0 If the number of<br \/>\npossible completions is greater than or equal to the value of<br \/>\nthis variable, the user is asked whether or not he wishes to<br \/>\nview them; otherwise they are simply listed on the terminal.<br \/>\nconvert-meta (On)<br \/>\nIf set to On, readline will convert characters with the eighth<br \/>\nbit set to an ASCII key sequence by stripping the eighth bit<br \/>\nand prefixing an escape character (in effect, using escape as<br \/>\nthe meta prefix).<br \/>\ndisable-completion (Off)<br \/>\nIf set to On, readline will inhibit word completion.<br \/>\nCompletion characters will be inserted into the line as if<br \/>\nthey had been mapped to self-insert.<br \/>\nediting-mode (emacs)<br \/>\nControls whether readline begins with a set of key bindings<br \/>\nsimilar to Emacs or vi.\u00a0 editing-mode can be set to either<br \/>\nemacs or vi.<br \/>\necho-control-characters (On)<br \/>\nWhen set to On, on operating systems that indicate they<br \/>\nsupport it, readline echoes a character corresponding to a<br \/>\nsignal generated from the keyboard.<br \/>\nenable-keypad (Off)<br \/>\nWhen set to On, readline will try to enable the application<br \/>\nkeypad when it is called.\u00a0 Some systems need this to enable<br \/>\nthe arrow keys.<br \/>\nenable-meta-key (On)<br \/>\nWhen set to On, readline will try to enable any meta modifier<br \/>\nkey the terminal claims to support when it is called.\u00a0 On many<br \/>\nterminals, the meta key is used to send eight-bit characters.<br \/>\nexpand-tilde (Off)<br \/>\nIf set to On, tilde expansion is performed when readline<br \/>\nattempts word completion.<br \/>\nhistory-preserve-point (Off)<br \/>\nIf set to On, the history code attempts to place point at the<br \/>\nsame location on each history line retrieved with previous-<br \/>\nhistory or next-history.<br \/>\nhistory-size (0)<br \/>\nSet the maximum number of history entries saved in the history<br \/>\nlist.\u00a0 If set to zero, any existing history entries are<br \/>\ndeleted and no new entries are saved.\u00a0 If set to a value less<br \/>\nthan zero, the number of history entries is not limited.\u00a0 By<br \/>\ndefault, the number of history entries is not limited.<br \/>\nhorizontal-scroll-mode (Off)<br \/>\nWhen set to On, makes readline use a single line for display,<br \/>\nscrolling the input horizontally on a single screen line when<br \/>\nit becomes longer than the screen width rather than wrapping<br \/>\nto a new line.<br \/>\ninput-meta (Off)<br \/>\nIf set to On, readline will enable eight-bit input (that is,<br \/>\nit will not strip the high bit from the characters it reads),<br \/>\nregardless of what the terminal claims it can support.\u00a0 The<br \/>\nname meta-flag is a synonym for this variable.<br \/>\nisearch-terminators (&#8220;C-[C-J&#8221;)<br \/>\nThe string of characters that should terminate an incremental<br \/>\nsearch without subsequently executing the character as a<br \/>\ncommand.\u00a0 If this variable has not been given a value, the<br \/>\ncharacters ESC and C-J will terminate an incremental search.<br \/>\nkeymap (emacs)<br \/>\nSet the current readline keymap.\u00a0 The set of valid keymap<br \/>\nnames is emacs, emacs-standard, emacs-meta, emacs-ctlx, vi,<br \/>\nvi-command, and vi-insert.\u00a0 vi is equivalent to vi-command;<br \/>\nemacs is equivalent to emacs-standard.\u00a0 The default value is<br \/>\nemacs; the value of editing-mode also affects the default<br \/>\nkeymap.<br \/>\nkeyseq-timeout (500)<br \/>\nSpecifies the duration readline will wait for a character when<br \/>\nreading an ambiguous key sequence (one that can form a<br \/>\ncomplete key sequence using the input read so far, or can take<br \/>\nadditional input to complete a longer key sequence).\u00a0 If no<br \/>\ninput is received within the timeout, readline will use the<br \/>\nshorter but complete key sequence.\u00a0 The value is specified in<br \/>\nmilliseconds, so a value of 1000 means that readline will wait<br \/>\none second for additional input.\u00a0 If this variable is set to a<br \/>\nvalue less than or equal to zero, or to a non-numeric value,<br \/>\nreadline will wait until another key is pressed to decide<br \/>\nwhich key sequence to complete.<br \/>\nmark-directories (On)<br \/>\nIf set to On, completed directory names have a slash appended.<br \/>\nmark-modified-lines (Off)<br \/>\nIf set to On, history lines that have been modified are<br \/>\ndisplayed with a preceding asterisk (*).<br \/>\nmark-symlinked-directories (Off)<br \/>\nIf set to On, completed names which are symbolic links to<br \/>\ndirectories have a slash appended (subject to the value of<br \/>\nmark-directories).<br \/>\nmatch-hidden-files (On)<br \/>\nThis variable, when set to On, causes readline to match files<br \/>\nwhose names begin with a `.&#8217; (hidden files) when performing<br \/>\nfilename completion.\u00a0 If set to Off, the leading `.&#8217; must be<br \/>\nsupplied by the user in the filename to be completed.<br \/>\nmenu-complete-display-prefix (Off)<br \/>\nIf set to On, menu completion displays the common prefix of<br \/>\nthe list of possible completions (which may be empty) before<br \/>\ncycling through the list.<br \/>\noutput-meta (Off)<br \/>\nIf set to On, readline will display characters with the eighth<br \/>\nbit set directly rather than as a meta-prefixed escape<br \/>\nsequence.<br \/>\npage-completions (On)<br \/>\nIf set to On, readline uses an internal more-like pager to<br \/>\ndisplay a screenful of possible completions at a time.<br \/>\nprint-completions-horizontally (Off)<br \/>\nIf set to On, readline will display completions with matches<br \/>\nsorted horizontally in alphabetical order, rather than down<br \/>\nthe screen.<br \/>\nrevert-all-at-newline (Off)<br \/>\nIf set to On, readline will undo all changes to history lines<br \/>\nbefore returning when accept-line is executed.\u00a0 By default,<br \/>\nhistory lines may be modified and retain individual undo lists<br \/>\nacross calls to readline.<br \/>\nshow-all-if-ambiguous (Off)<br \/>\nThis alters the default behavior of the completion functions.<br \/>\nIf set to On, words which have more than one possible<br \/>\ncompletion cause the matches to be listed immediately instead<br \/>\nof ringing the bell.<br \/>\nshow-all-if-unmodified (Off)<br \/>\nThis alters the default behavior of the completion functions<br \/>\nin a fashion similar to show-all-if-ambiguous.\u00a0 If set to On,<br \/>\nwords which have more than one possible completion without any<br \/>\npossible partial completion (the possible completions don&#8217;t<br \/>\nshare a common prefix) cause the matches to be listed<br \/>\nimmediately instead of ringing the bell.<br \/>\nshow-mode-in-prompt (Off)<br \/>\nIf set to On, add a character to the beginning of the prompt<br \/>\nindicating the editing mode: emacs (@), vi command (:) or vi<br \/>\ninsertion (+).<br \/>\nskip-completed-text (Off)<br \/>\nIf set to On, this alters the default completion behavior when<br \/>\ninserting a single match into the line.\u00a0 It&#8217;s only active when<br \/>\nperforming completion in the middle of a word.\u00a0 If enabled,<br \/>\nreadline does not insert characters from the completion that<br \/>\nmatch characters after point in the word being completed, so<br \/>\nportions of the word following the cursor are not duplicated.<br \/>\nvisible-stats (Off)<br \/>\nIf set to On, a character denoting a file&#8217;s type as reported<br \/>\nby stat(2) is appended to the filename when listing possible<br \/>\ncompletions.<\/p>\n<p>Readline Conditional Constructs<br \/>\nReadline implements a facility similar in spirit to the conditional<br \/>\ncompilation features of the C preprocessor which allows key bindings<br \/>\nand variable settings to be performed as the result of tests.\u00a0 There<br \/>\nare four parser directives used.<\/p>\n<p>$if\u00a0\u00a0\u00a0 The $if construct allows bindings to be made based on the<br \/>\nediting mode, the terminal being used, or the application<br \/>\nusing readline.\u00a0 The text of the test extends to the end of<br \/>\nthe line; no characters are required to isolate it.<\/p>\n<p>mode\u00a0\u00a0 The mode= form of the $if directive is used to test<br \/>\nwhether readline is in emacs or vi mode.\u00a0 This may be<br \/>\nused in conjunction with the set keymap command, for<br \/>\ninstance, to set bindings in the emacs-standard and<br \/>\nemacs-ctlx keymaps only if readline is starting out in<br \/>\nemacs mode.<\/p>\n<p>term\u00a0\u00a0 The term= form may be used to include terminal-specific<br \/>\nkey bindings, perhaps to bind the key sequences output<br \/>\nby the terminal&#8217;s function keys.\u00a0 The word on the right<br \/>\nside of the = is tested against the both full name of<br \/>\nthe terminal and the portion of the terminal name<br \/>\nbefore the first -.\u00a0 This allows sun to match both sun<br \/>\nand sun-cmd, for instance.<\/p>\n<p>application<br \/>\nThe application construct is used to include<br \/>\napplication-specific settings.\u00a0 Each program using the<br \/>\nreadline library sets the application name, and an<br \/>\ninitialization file can test for a particular value.<br \/>\nThis could be used to bind key sequences to functions<br \/>\nuseful for a specific program.\u00a0 For instance, the<br \/>\nfollowing command adds a key sequence that quotes the<br \/>\ncurrent or previous word in bash:<\/p>\n<p>$if Bash<br \/>\n# Quote the current or previous word<br \/>\n&#8220;\\C-xq&#8221;: &#8220;\\eb\\&#8221;\\ef\\&#8221;&#8221;<br \/>\n$endif<\/p>\n<p>$endif This command, as seen in the previous example, terminates an<br \/>\n$if command.<\/p>\n<p>$else\u00a0 Commands in this branch of the $if directive are executed if<br \/>\nthe test fails.<\/p>\n<p>$include<br \/>\nThis directive takes a single filename as an argument and<br \/>\nreads commands and bindings from that file.\u00a0 For example, the<br \/>\nfollowing directive would read \/etc\/inputrc:<\/p>\n<p>$include\u00a0 \/etc\/inputrc<\/p>\n<p>Searching<br \/>\nReadline provides commands for searching through the command history<br \/>\n(see HISTORY below) for lines containing a specified string.\u00a0 There<br \/>\nare two search modes: incremental and non-incremental.<\/p>\n<p>Incremental searches begin before the user has finished typing the<br \/>\nsearch string.\u00a0 As each character of the search string is typed,<br \/>\nreadline displays the next entry from the history matching the string<br \/>\ntyped so far.\u00a0 An incremental search requires only as many characters<br \/>\nas needed to find the desired history entry.\u00a0 The characters present<br \/>\nin the value of the isearch-terminators variable are used to<br \/>\nterminate an incremental search.\u00a0 If that variable has not been<br \/>\nassigned a value the Escape and Control-J characters will terminate<br \/>\nan incremental search.\u00a0 Control-G will abort an incremental search<br \/>\nand restore the original line.\u00a0 When the search is terminated, the<br \/>\nhistory entry containing the search string becomes the current line.<\/p>\n<p>To find other matching entries in the history list, type Control-S or<br \/>\nControl-R as appropriate.\u00a0 This will search backward or forward in<br \/>\nthe history for the next entry matching the search string typed so<br \/>\nfar.\u00a0 Any other key sequence bound to a readline command will<br \/>\nterminate the search and execute that command.\u00a0 For instance, a<br \/>\nnewline will terminate the search and accept the line, thereby<br \/>\nexecuting the command from the history list.<\/p>\n<p>Readline remembers the last incremental search string.\u00a0 If two<br \/>\nControl-Rs are typed without any intervening characters defining a<br \/>\nnew search string, any remembered search string is used.<\/p>\n<p>Non-incremental searches read the entire search string before<br \/>\nstarting to search for matching history lines.\u00a0 The search string may<br \/>\nbe typed by the user or be part of the contents of the current line.<\/p>\n<p>Readline Command Names<br \/>\nThe following is a list of the names of the commands and the default<br \/>\nkey sequences to which they are bound.\u00a0 Command names without an<br \/>\naccompanying key sequence are unbound by default.\u00a0 In the following<br \/>\ndescriptions, point refers to the current cursor position, and mark<br \/>\nrefers to a cursor position saved by the set-mark command.\u00a0 The text<br \/>\nbetween the point and mark is referred to as the region.<\/p>\n<p>Commands for Moving<br \/>\nbeginning-of-line (C-a)<br \/>\nMove to the start of the current line.<br \/>\nend-of-line (C-e)<br \/>\nMove to the end of the line.<br \/>\nforward-char (C-f)<br \/>\nMove forward a character.<br \/>\nbackward-char (C-b)<br \/>\nMove back a character.<br \/>\nforward-word (M-f)<br \/>\nMove forward to the end of the next word.\u00a0 Words are composed<br \/>\nof alphanumeric characters (letters and digits).<br \/>\nbackward-word (M-b)<br \/>\nMove back to the start of the current or previous word.\u00a0 Words<br \/>\nare composed of alphanumeric characters (letters and digits).<br \/>\nshell-forward-word<br \/>\nMove forward to the end of the next word.\u00a0 Words are delimited<br \/>\nby non-quoted shell metacharacters.<br \/>\nshell-backward-word<br \/>\nMove back to the start of the current or previous word.\u00a0 Words<br \/>\nare delimited by non-quoted shell metacharacters.<br \/>\nclear-screen (C-l)<br \/>\nClear the screen leaving the current line at the top of the<br \/>\nscreen.\u00a0 With an argument, refresh the current line without<br \/>\nclearing the screen.<br \/>\nredraw-current-line<br \/>\nRefresh the current line.<\/p>\n<p>Commands for Manipulating the History<br \/>\naccept-line (Newline, Return)<br \/>\nAccept the line regardless of where the cursor is.\u00a0 If this<br \/>\nline is non-empty, add it to the history list according to the<br \/>\nstate of the HISTCONTROL variable.\u00a0 If the line is a modified<br \/>\nhistory line, then restore the history line to its original<br \/>\nstate.<br \/>\nprevious-history (C-p)<br \/>\nFetch the previous command from the history list, moving back<br \/>\nin the list.<br \/>\nnext-history (C-n)<br \/>\nFetch the next command from the history list, moving forward<br \/>\nin the list.<br \/>\nbeginning-of-history (M-&lt;)<br \/>\nMove to the first line in the history.<br \/>\nend-of-history (M-&gt;)<br \/>\nMove to the end of the input history, i.e., the line currently<br \/>\nbeing entered.<br \/>\nreverse-search-history (C-r)<br \/>\nSearch backward starting at the current line and moving `up&#8217;<br \/>\nthrough the history as necessary.\u00a0 This is an incremental<br \/>\nsearch.<br \/>\nforward-search-history (C-s)<br \/>\nSearch forward starting at the current line and moving `down&#8217;<br \/>\nthrough the history as necessary.\u00a0 This is an incremental<br \/>\nsearch.<br \/>\nnon-incremental-reverse-search-history (M-p)<br \/>\nSearch backward through the history starting at the current<br \/>\nline using a non-incremental search for a string supplied by<br \/>\nthe user.<br \/>\nnon-incremental-forward-search-history (M-n)<br \/>\nSearch forward through the history using a non-incremental<br \/>\nsearch for a string supplied by the user.<br \/>\nhistory-search-forward<br \/>\nSearch forward through the history for the string of<br \/>\ncharacters between the start of the current line and the<br \/>\npoint.\u00a0 This is a non-incremental search.<br \/>\nhistory-search-backward<br \/>\nSearch backward through the history for the string of<br \/>\ncharacters between the start of the current line and the<br \/>\npoint.\u00a0 This is a non-incremental search.<br \/>\nyank-nth-arg (M-C-y)<br \/>\nInsert the first argument to the previous command (usually the<br \/>\nsecond word on the previous line) at point.\u00a0 With an argument<br \/>\nn, insert the nth word from the previous command (the words in<br \/>\nthe previous command begin with word 0).\u00a0 A negative argument<br \/>\ninserts the nth word from the end of the previous command.<br \/>\nOnce the argument n is computed, the argument is extracted as<br \/>\nif the &#8220;!n&#8221; history expansion had been specified.<br \/>\nyank-last-arg (M-., M-_)<br \/>\nInsert the last argument to the previous command (the last<br \/>\nword of the previous history entry).\u00a0 With a numeric argument,<br \/>\nbehave exactly like yank-nth-arg.\u00a0 Successive calls to<br \/>\nyank-last-arg move back through the history list, inserting<br \/>\nthe last word (or the word specified by the argument to the<br \/>\nfirst call) of each line in turn.\u00a0 Any numeric argument<br \/>\nsupplied to these successive calls determines the direction to<br \/>\nmove through the history.\u00a0 A negative argument switches the<br \/>\ndirection through the history (back or forward).\u00a0 The history<br \/>\nexpansion facilities are used to extract the last word, as if<br \/>\nthe &#8220;!$&#8221; history expansion had been specified.<br \/>\nshell-expand-line (M-C-e)<br \/>\nExpand the line as the shell does.\u00a0 This performs alias and<br \/>\nhistory expansion as well as all of the shell word expansions.<br \/>\nSee HISTORY EXPANSION below for a description of history<br \/>\nexpansion.<br \/>\nhistory-expand-line (M-^)<br \/>\nPerform history expansion on the current line.\u00a0 See HISTORY<br \/>\nEXPANSION below for a description of history expansion.<br \/>\nmagic-space<br \/>\nPerform history expansion on the current line and insert a<br \/>\nspace.\u00a0 See HISTORY EXPANSION below for a description of<br \/>\nhistory expansion.<br \/>\nalias-expand-line<br \/>\nPerform alias expansion on the current line.\u00a0 See ALIASES<br \/>\nabove for a description of alias expansion.<br \/>\nhistory-and-alias-expand-line<br \/>\nPerform history and alias expansion on the current line.<br \/>\ninsert-last-argument (M-., M-_)<br \/>\nA synonym for yank-last-arg.<br \/>\noperate-and-get-next (C-o)<br \/>\nAccept the current line for execution and fetch the next line<br \/>\nrelative to the current line from the history for editing.<br \/>\nAny argument is ignored.<br \/>\nedit-and-execute-command (C-xC-e)<br \/>\nInvoke an editor on the current command line, and execute the<br \/>\nresult as shell commands.\u00a0 Bash attempts to invoke $VISUAL,<br \/>\n$EDITOR, and emacs as the editor, in that order.<\/p>\n<p>Commands for Changing Text<br \/>\nend-of-file (usually C-d)<br \/>\nThe character indicating end-of-file as set, for example, by<br \/>\n&#8220;stty&#8221;.\u00a0 If this character is read when there are no<br \/>\ncharacters on the line, and point is at the beginning of the<br \/>\nline, Readline interprets it as the end of input and returns<br \/>\nEOF.<br \/>\ndelete-char (C-d)<br \/>\nDelete the character at point.\u00a0 If this function is bound to<br \/>\nthe same character as the tty EOF character, as C-d commonly<br \/>\nis, see above for the effects.<br \/>\nbackward-delete-char (Rubout)<br \/>\nDelete the character behind the cursor.\u00a0 When given a numeric<br \/>\nargument, save the deleted text on the kill ring.<br \/>\nforward-backward-delete-char<br \/>\nDelete the character under the cursor, unless the cursor is at<br \/>\nthe end of the line, in which case the character behind the<br \/>\ncursor is deleted.<br \/>\nquoted-insert (C-q, C-v)<br \/>\nAdd the next character typed to the line verbatim.\u00a0 This is<br \/>\nhow to insert characters like C-q, for example.<br \/>\ntab-insert (C-v TAB)<br \/>\nInsert a tab character.<br \/>\nself-insert (a, b, A, 1, !, &#8230;)<br \/>\nInsert the character typed.<br \/>\ntranspose-chars (C-t)<br \/>\nDrag the character before point forward over the character at<br \/>\npoint, moving point forward as well.\u00a0 If point is at the end<br \/>\nof the line, then this transposes the two characters before<br \/>\npoint.\u00a0 Negative arguments have no effect.<br \/>\ntranspose-words (M-t)<br \/>\nDrag the word before point past the word after point, moving<br \/>\npoint over that word as well.\u00a0 If point is at the end of the<br \/>\nline, this transposes the last two words on the line.<br \/>\nupcase-word (M-u)<br \/>\nUppercase the current (or following) word.\u00a0 With a negative<br \/>\nargument, uppercase the previous word, but do not move point.<br \/>\ndowncase-word (M-l)<br \/>\nLowercase the current (or following) word.\u00a0 With a negative<br \/>\nargument, lowercase the previous word, but do not move point.<br \/>\ncapitalize-word (M-c)<br \/>\nCapitalize the current (or following) word.\u00a0 With a negative<br \/>\nargument, capitalize the previous word, but do not move point.<br \/>\noverwrite-mode<br \/>\nToggle overwrite mode.\u00a0 With an explicit positive numeric<br \/>\nargument, switches to overwrite mode.\u00a0 With an explicit non-<br \/>\npositive numeric argument, switches to insert mode.\u00a0 This<br \/>\ncommand affects only emacs mode; vi mode does overwrite<br \/>\ndifferently.\u00a0 Each call to readline() starts in insert mode.<br \/>\nIn overwrite mode, characters bound to self-insert replace the<br \/>\ntext at point rather than pushing the text to the right.<br \/>\nCharacters bound to backward-delete-char replace the character<br \/>\nbefore point with a space.\u00a0 By default, this command is<br \/>\nunbound.<\/p>\n<p>Killing and Yanking<br \/>\nkill-line (C-k)<br \/>\nKill the text from point to the end of the line.<br \/>\nbackward-kill-line (C-x Rubout)<br \/>\nKill backward to the beginning of the line.<br \/>\nunix-line-discard (C-u)<br \/>\nKill backward from point to the beginning of the line.\u00a0 The<br \/>\nkilled text is saved on the kill-ring.<br \/>\nkill-whole-line<br \/>\nKill all characters on the current line, no matter where point<br \/>\nis.<br \/>\nkill-word (M-d)<br \/>\nKill from point to the end of the current word, or if between<br \/>\nwords, to the end of the next word.\u00a0 Word boundaries are the<br \/>\nsame as those used by forward-word.<br \/>\nbackward-kill-word (M-Rubout)<br \/>\nKill the word behind point.\u00a0 Word boundaries are the same as<br \/>\nthose used by backward-word.<br \/>\nshell-kill-word (M-d)<br \/>\nKill from point to the end of the current word, or if between<br \/>\nwords, to the end of the next word.\u00a0 Word boundaries are the<br \/>\nsame as those used by shell-forward-word.<br \/>\nshell-backward-kill-word (M-Rubout)<br \/>\nKill the word behind point.\u00a0 Word boundaries are the same as<br \/>\nthose used by shell-backward-word.<br \/>\nunix-word-rubout (C-w)<br \/>\nKill the word behind point, using white space as a word<br \/>\nboundary.\u00a0 The killed text is saved on the kill-ring.<br \/>\nunix-filename-rubout<br \/>\nKill the word behind point, using white space and the slash<br \/>\ncharacter as the word boundaries.\u00a0 The killed text is saved on<br \/>\nthe kill-ring.<br \/>\ndelete-horizontal-space (M-\\)<br \/>\nDelete all spaces and tabs around point.<br \/>\nkill-region<br \/>\nKill the text in the current region.<br \/>\ncopy-region-as-kill<br \/>\nCopy the text in the region to the kill buffer.<br \/>\ncopy-backward-word<br \/>\nCopy the word before point to the kill buffer.\u00a0 The word<br \/>\nboundaries are the same as backward-word.<br \/>\ncopy-forward-word<br \/>\nCopy the word following point to the kill buffer.\u00a0 The word<br \/>\nboundaries are the same as forward-word.<br \/>\nyank (C-y)<br \/>\nYank the top of the kill ring into the buffer at point.<br \/>\nyank-pop (M-y)<br \/>\nRotate the kill ring, and yank the new top.\u00a0 Only works<br \/>\nfollowing yank or yank-pop.<\/p>\n<p>Numeric Arguments<br \/>\ndigit-argument (M-0, M-1, &#8230;, M&#8211;)<br \/>\nAdd this digit to the argument already accumulating, or start<br \/>\na new argument.\u00a0 M&#8211; starts a negative argument.<br \/>\nuniversal-argument<br \/>\nThis is another way to specify an argument.\u00a0 If this command<br \/>\nis followed by one or more digits, optionally with a leading<br \/>\nminus sign, those digits define the argument.\u00a0 If the command<br \/>\nis followed by digits, executing universal-argument again ends<br \/>\nthe numeric argument, but is otherwise ignored.\u00a0 As a special<br \/>\ncase, if this command is immediately followed by a character<br \/>\nthat is neither a digit or minus sign, the argument count for<br \/>\nthe next command is multiplied by four.\u00a0 The argument count is<br \/>\ninitially one, so executing this function the first time makes<br \/>\nthe argument count four, a second time makes the argument<br \/>\ncount sixteen, and so on.<\/p>\n<p>Completing<br \/>\ncomplete (TAB)<br \/>\nAttempt to perform completion on the text before point.\u00a0 Bash<br \/>\nattempts completion treating the text as a variable (if the<br \/>\ntext begins with $), username (if the text begins with ~),<br \/>\nhostname (if the text begins with @), or command (including<br \/>\naliases and functions) in turn.\u00a0 If none of these produces a<br \/>\nmatch, filename completion is attempted.<br \/>\npossible-completions (M-?)<br \/>\nList the possible completions of the text before point.<br \/>\ninsert-completions (M-*)<br \/>\nInsert all completions of the text before point that would<br \/>\nhave been generated by possible-completions.<br \/>\nmenu-complete<br \/>\nSimilar to complete, but replaces the word to be completed<br \/>\nwith a single match from the list of possible completions.<br \/>\nRepeated execution of menu-complete steps through the list of<br \/>\npossible completions, inserting each match in turn.\u00a0 At the<br \/>\nend of the list of completions, the bell is rung (subject to<br \/>\nthe setting of bell-style) and the original text is restored.<br \/>\nAn argument of n moves n positions forward in the list of<br \/>\nmatches; a negative argument may be used to move backward<br \/>\nthrough the list.\u00a0 This command is intended to be bound to<br \/>\nTAB, but is unbound by default.<br \/>\nmenu-complete-backward<br \/>\nIdentical to menu-complete, but moves backward through the<br \/>\nlist of possible completions, as if menu-complete had been<br \/>\ngiven a negative argument.\u00a0 This command is unbound by<br \/>\ndefault.<br \/>\ndelete-char-or-list<br \/>\nDeletes the character under the cursor if not at the beginning<br \/>\nor end of the line (like delete-char).\u00a0 If at the end of the<br \/>\nline, behaves identically to possible-completions.\u00a0 This<br \/>\ncommand is unbound by default.<br \/>\ncomplete-filename (M-\/)<br \/>\nAttempt filename completion on the text before point.<br \/>\npossible-filename-completions (C-x \/)<br \/>\nList the possible completions of the text before point,<br \/>\ntreating it as a filename.<br \/>\ncomplete-username (M-~)<br \/>\nAttempt completion on the text before point, treating it as a<br \/>\nusername.<br \/>\npossible-username-completions (C-x ~)<br \/>\nList the possible completions of the text before point,<br \/>\ntreating it as a username.<br \/>\ncomplete-variable (M-$)<br \/>\nAttempt completion on the text before point, treating it as a<br \/>\nshell variable.<br \/>\npossible-variable-completions (C-x $)<br \/>\nList the possible completions of the text before point,<br \/>\ntreating it as a shell variable.<br \/>\ncomplete-hostname (M-@)<br \/>\nAttempt completion on the text before point, treating it as a<br \/>\nhostname.<br \/>\npossible-hostname-completions (C-x @)<br \/>\nList the possible completions of the text before point,<br \/>\ntreating it as a hostname.<br \/>\ncomplete-command (M-!)<br \/>\nAttempt completion on the text before point, treating it as a<br \/>\ncommand name.\u00a0 Command completion attempts to match the text<br \/>\nagainst aliases, reserved words, shell functions, shell<br \/>\nbuiltins, and finally executable filenames, in that order.<br \/>\npossible-command-completions (C-x !)<br \/>\nList the possible completions of the text before point,<br \/>\ntreating it as a command name.<br \/>\ndynamic-complete-history (M-TAB)<br \/>\nAttempt completion on the text before point, comparing the<br \/>\ntext against lines from the history list for possible<br \/>\ncompletion matches.<br \/>\ndabbrev-expand<br \/>\nAttempt menu completion on the text before point, comparing<br \/>\nthe text against lines from the history list for possible<br \/>\ncompletion matches.<br \/>\ncomplete-into-braces (M-{)<br \/>\nPerform filename completion and insert the list of possible<br \/>\ncompletions enclosed within braces so the list is available to<br \/>\nthe shell (see Brace Expansion above).<\/p>\n<p>Keyboard Macros<br \/>\nstart-kbd-macro (C-x ()<br \/>\nBegin saving the characters typed into the current keyboard<br \/>\nmacro.<br \/>\nend-kbd-macro (C-x ))<br \/>\nStop saving the characters typed into the current keyboard<br \/>\nmacro and store the definition.<br \/>\ncall-last-kbd-macro (C-x e)<br \/>\nRe-execute the last keyboard macro defined, by making the<br \/>\ncharacters in the macro appear as if typed at the keyboard.<br \/>\nprint-last-kbd-macro ()<br \/>\nPrint the last keyboard macro defined in a format suitable for<br \/>\nthe inputrc file.<\/p>\n<p>Miscellaneous<br \/>\nre-read-init-file (C-x C-r)<br \/>\nRead in the contents of the inputrc file, and incorporate any<br \/>\nbindings or variable assignments found there.<br \/>\nabort (C-g)<br \/>\nAbort the current editing command and ring the terminal&#8217;s bell<br \/>\n(subject to the setting of bell-style).<br \/>\ndo-uppercase-version (M-a, M-b, M-x, &#8230;)<br \/>\nIf the metafied character x is lowercase, run the command that<br \/>\nis bound to the corresponding uppercase character.<br \/>\nprefix-meta (ESC)<br \/>\nMetafy the next character typed.\u00a0 ESC f is equivalent to<br \/>\nMeta-f.<br \/>\nundo (C-_, C-x C-u)<br \/>\nIncremental undo, separately remembered for each line.<br \/>\nrevert-line (M-r)<br \/>\nUndo all changes made to this line.\u00a0 This is like executing<br \/>\nthe undo command enough times to return the line to its<br \/>\ninitial state.<br \/>\ntilde-expand (M-&amp;)<br \/>\nPerform tilde expansion on the current word.<br \/>\nset-mark (C-@, M-&lt;space&gt;)<br \/>\nSet the mark to the point.\u00a0 If a numeric argument is supplied,<br \/>\nthe mark is set to that position.<br \/>\nexchange-point-and-mark (C-x C-x)<br \/>\nSwap the point with the mark.\u00a0 The current cursor position is<br \/>\nset to the saved position, and the old cursor position is<br \/>\nsaved as the mark.<br \/>\ncharacter-search (C-])<br \/>\nA character is read and point is moved to the next occurrence<br \/>\nof that character.\u00a0 A negative count searches for previous<br \/>\noccurrences.<br \/>\ncharacter-search-backward (M-C-])<br \/>\nA character is read and point is moved to the previous<br \/>\noccurrence of that character.\u00a0 A negative count searches for<br \/>\nsubsequent occurrences.<br \/>\nskip-csi-sequence<br \/>\nRead enough characters to consume a multi-key sequence such as<br \/>\nthose defined for keys like Home and End.\u00a0 Such sequences<br \/>\nbegin with a Control Sequence Indicator (CSI), usually ESC-[.<br \/>\nIf this sequence is bound to &#8220;\\[&#8220;, keys producing such<br \/>\nsequences will have no effect unless explicitly bound to a<br \/>\nreadline command, instead of inserting stray characters into<br \/>\nthe editing buffer.\u00a0 This is unbound by default, but usually<br \/>\nbound to ESC-[.<br \/>\ninsert-comment (M-#)<br \/>\nWithout a numeric argument, the value of the readline<br \/>\ncomment-begin variable is inserted at the beginning of the<br \/>\ncurrent line.\u00a0 If a numeric argument is supplied, this command<br \/>\nacts as a toggle:\u00a0 if the characters at the beginning of the<br \/>\nline do not match the value of comment-begin, the value is<br \/>\ninserted, otherwise the characters in comment-begin are<br \/>\ndeleted from the beginning of the line.\u00a0 In either case, the<br \/>\nline is accepted as if a newline had been typed.\u00a0 The default<br \/>\nvalue of comment-begin causes this command to make the current<br \/>\nline a shell comment.\u00a0 If a numeric argument causes the<br \/>\ncomment character to be removed, the line will be executed by<br \/>\nthe shell.<br \/>\nglob-complete-word (M-g)<br \/>\nThe word before point is treated as a pattern for pathname<br \/>\nexpansion, with an asterisk implicitly appended.\u00a0 This pattern<br \/>\nis used to generate a list of matching filenames for possible<br \/>\ncompletions.<br \/>\nglob-expand-word (C-x *)<br \/>\nThe word before point is treated as a pattern for pathname<br \/>\nexpansion, and the list of matching filenames is inserted,<br \/>\nreplacing the word.\u00a0 If a numeric argument is supplied, an<br \/>\nasterisk is appended before pathname expansion.<br \/>\nglob-list-expansions (C-x g)<br \/>\nThe list of expansions that would have been generated by<br \/>\nglob-expand-word is displayed, and the line is redrawn.\u00a0 If a<br \/>\nnumeric argument is supplied, an asterisk is appended before<br \/>\npathname expansion.<br \/>\ndump-functions<br \/>\nPrint all of the functions and their key bindings to the<br \/>\nreadline output stream.\u00a0 If a numeric argument is supplied,<br \/>\nthe output is formatted in such a way that it can be made part<br \/>\nof an inputrc file.<br \/>\ndump-variables<br \/>\nPrint all of the settable readline variables and their values<br \/>\nto the readline output stream.\u00a0 If a numeric argument is<br \/>\nsupplied, the output is formatted in such a way that it can be<br \/>\nmade part of an inputrc file.<br \/>\ndump-macros<br \/>\nPrint all of the readline key sequences bound to macros and<br \/>\nthe strings they output.\u00a0 If a numeric argument is supplied,<br \/>\nthe output is formatted in such a way that it can be made part<br \/>\nof an inputrc file.<br \/>\ndisplay-shell-version (C-x C-v)<br \/>\nDisplay version information about the current instance of<br \/>\nbash.<\/p>\n<p>Programmable Completion<br \/>\nWhen word completion is attempted for an argument to a command for<br \/>\nwhich a completion specification (a compspec) has been defined using<br \/>\nthe complete builtin (see SHELL BUILTIN COMMANDS below), the<br \/>\nprogrammable completion facilities are invoked.<\/p>\n<p>First, the command name is identified.\u00a0 If the command word is the<br \/>\nempty string (completion attempted at the beginning of an empty<br \/>\nline), any compspec defined with the -E option to complete is used.<br \/>\nIf a compspec has been defined for that command, the compspec is used<br \/>\nto generate the list of possible completions for the word.\u00a0 If the<br \/>\ncommand word is a full pathname, a compspec for the full pathname is<br \/>\nsearched for first.\u00a0 If no compspec is found for the full pathname,<br \/>\nan attempt is made to find a compspec for the portion following the<br \/>\nfinal slash.\u00a0 If those searches do not result in a compspec, any<br \/>\ncompspec defined with the -D option to complete is used as the<br \/>\ndefault.<\/p>\n<p>Once a compspec has been found, it is used to generate the list of<br \/>\nmatching words.\u00a0 If a compspec is not found, the default bash<br \/>\ncompletion as described above under Completing is performed.<\/p>\n<p>First, the actions specified by the compspec are used.\u00a0 Only matches<br \/>\nwhich are prefixed by the word being completed are returned.\u00a0 When<br \/>\nthe -f or -d option is used for filename or directory name<br \/>\ncompletion, the shell variable FIGNORE is used to filter the matches.<\/p>\n<p>Any completions specified by a pathname expansion pattern to the -G<br \/>\noption are generated next.\u00a0 The words generated by the pattern need<br \/>\nnot match the word being completed.\u00a0 The GLOBIGNORE shell variable is<br \/>\nnot used to filter the matches, but the FIGNORE variable is used.<\/p>\n<p>Next, the string specified as the argument to the -W option is<br \/>\nconsidered.\u00a0 The string is first split using the characters in the<br \/>\nIFS special variable as delimiters.\u00a0 Shell quoting is honored.\u00a0 Each<br \/>\nword is then expanded using brace expansion, tilde expansion,<br \/>\nparameter and variable expansion, command substitution, and<br \/>\narithmetic expansion, as described above under EXPANSION.\u00a0 The<br \/>\nresults are split using the rules described above under Word<br \/>\nSplitting.\u00a0 The results of the expansion are prefix-matched against<br \/>\nthe word being completed, and the matching words become the possible<br \/>\ncompletions.<\/p>\n<p>After these matches have been generated, any shell function or<br \/>\ncommand specified with the -F and -C options is invoked.\u00a0 When the<br \/>\ncommand or function is invoked, the COMP_LINE, COMP_POINT, COMP_KEY,<br \/>\nand COMP_TYPE variables are assigned values as described above under<br \/>\nShell Variables.\u00a0 If a shell function is being invoked, the<br \/>\nCOMP_WORDS and COMP_CWORD variables are also set.\u00a0 When the function<br \/>\nor command is invoked, the first argument ($1) is the name of the<br \/>\ncommand whose arguments are being completed, the second argument ($2)<br \/>\nis the word being completed, and the third argument ($3) is the word<br \/>\npreceding the word being completed on the current command line.\u00a0 No<br \/>\nfiltering of the generated completions against the word being<br \/>\ncompleted is performed; the function or command has complete freedom<br \/>\nin generating the matches.<\/p>\n<p>Any function specified with -F is invoked first.\u00a0 The function may<br \/>\nuse any of the shell facilities, including the compgen builtin<br \/>\ndescribed below, to generate the matches.\u00a0 It must put the possible<br \/>\ncompletions in the COMPREPLY array variable, one per array element.<\/p>\n<p>Next, any command specified with the -C option is invoked in an<br \/>\nenvironment equivalent to command substitution.\u00a0 It should print a<br \/>\nlist of completions, one per line, to the standard output.\u00a0 Backslash<br \/>\nmay be used to escape a newline, if necessary.<\/p>\n<p>After all of the possible completions are generated, any filter<br \/>\nspecified with the -X option is applied to the list.\u00a0 The filter is a<br \/>\npattern as used for pathname expansion; a &amp; in the pattern is<br \/>\nreplaced with the text of the word being completed.\u00a0 A literal &amp; may<br \/>\nbe escaped with a backslash; the backslash is removed before<br \/>\nattempting a match.\u00a0 Any completion that matches the pattern will be<br \/>\nremoved from the list.\u00a0 A leading ! negates the pattern; in this case<br \/>\nany completion not matching the pattern will be removed.<\/p>\n<p>Finally, any prefix and suffix specified with the -P and -S options<br \/>\nare added to each member of the completion list, and the result is<br \/>\nreturned to the readline completion code as the list of possible<br \/>\ncompletions.<\/p>\n<p>If the previously-applied actions do not generate any matches, and<br \/>\nthe -o dirnames option was supplied to complete when the compspec was<br \/>\ndefined, directory name completion is attempted.<\/p>\n<p>If the -o plusdirs option was supplied to complete when the compspec<br \/>\nwas defined, directory name completion is attempted and any matches<br \/>\nare added to the results of the other actions.<\/p>\n<p>By default, if a compspec is found, whatever it generates is returned<br \/>\nto the completion code as the full set of possible completions.\u00a0 The<br \/>\ndefault bash completions are not attempted, and the readline default<br \/>\nof filename completion is disabled.\u00a0 If the -o bashdefault option was<br \/>\nsupplied to complete when the compspec was defined, the bash default<br \/>\ncompletions are attempted if the compspec generates no matches.\u00a0 If<br \/>\nthe -o default option was supplied to complete when the compspec was<br \/>\ndefined, readline&#8217;s default completion will be performed if the<br \/>\ncompspec (and, if attempted, the default bash completions) generate<br \/>\nno matches.<\/p>\n<p>When a compspec indicates that directory name completion is desired,<br \/>\nthe programmable completion functions force readline to append a<br \/>\nslash to completed names which are symbolic links to directories,<br \/>\nsubject to the value of the mark-directories readline variable,<br \/>\nregardless of the setting of the mark-symlinked-directories readline<br \/>\nvariable.<\/p>\n<p>There is some support for dynamically modifying completions.\u00a0 This is<br \/>\nmost useful when used in combination with a default completion<br \/>\nspecified with complete -D.\u00a0 It&#8217;s possible for shell functions<br \/>\nexecuted as completion handlers to indicate that completion should be<br \/>\nretried by returning an exit status of 124.\u00a0 If a shell function<br \/>\nreturns 124, and changes the compspec associated with the command on<br \/>\nwhich completion is being attempted (supplied as the first argument<br \/>\nwhen the function is executed), programmable completion restarts from<br \/>\nthe beginning, with an attempt to find a new compspec for that<br \/>\ncommand.\u00a0 This allows a set of completions to be built dynamically as<br \/>\ncompletion is attempted, rather than being loaded all at once.<\/p>\n<p>For instance, assuming that there is a library of compspecs, each<br \/>\nkept in a file corresponding to the name of the command, the<br \/>\nfollowing default completion function would load completions<br \/>\ndynamically:<\/p>\n<p>_completion_loader()<br \/>\n{<br \/>\n. &#8220;\/etc\/bash_completion.d\/$1.sh&#8221; &gt;\/dev\/null 2&gt;&amp;1 &amp;&amp; return 124<br \/>\n}<br \/>\ncomplete -D -F _completion_loader -o bashdefault -o default<\/p>\n<p>HISTORY<\/p>\n<p>When the -o history option to the set builtin is enabled, the shell<br \/>\nprovides access to the command history, the list of commands<br \/>\npreviously typed.\u00a0 The value of the HISTSIZE variable is used as the<br \/>\nnumber of commands to save in a history list.\u00a0 The text of the last<br \/>\nHISTSIZE commands (default 500) is saved.\u00a0 The shell stores each<br \/>\ncommand in the history list prior to parameter and variable expansion<br \/>\n(see EXPANSION above) but after history expansion is performed,<br \/>\nsubject to the values of the shell variables HISTIGNORE and<br \/>\nHISTCONTROL.<\/p>\n<p>On startup, the history is initialized from the file named by the<br \/>\nvariable HISTFILE (default ~\/.bash_history).\u00a0 The file named by the<br \/>\nvalue of HISTFILE is truncated, if necessary, to contain no more than<br \/>\nthe number of lines specified by the value of HISTFILESIZE.\u00a0 If<br \/>\nHISTFILESIZE is unset, or set to null, a non-numeric value, or a<br \/>\nnumeric value less than zero, the history file is not truncated.<br \/>\nWhen the history file is read, lines beginning with the history<br \/>\ncomment character followed immediately by a digit are interpreted as<br \/>\ntimestamps for the preceding history line.\u00a0 These timestamps are<br \/>\noptionally displayed depending on the value of the HISTTIMEFORMAT<br \/>\nvariable.\u00a0 When a shell with history enabled exits, the last<br \/>\n$HISTSIZE lines are copied from the history list to $HISTFILE.\u00a0 If<br \/>\nthe histappend shell option is enabled (see the description of shopt<br \/>\nunder SHELL BUILTIN COMMANDS below), the lines are appended to the<br \/>\nhistory file, otherwise the history file is overwritten.\u00a0 If HISTFILE<br \/>\nis unset, or if the history file is unwritable, the history is not<br \/>\nsaved.\u00a0 If the HISTTIMEFORMAT variable is set, time stamps are<br \/>\nwritten to the history file, marked with the history comment<br \/>\ncharacter, so they may be preserved across shell sessions.\u00a0 This uses<br \/>\nthe history comment character to distinguish timestamps from other<br \/>\nhistory lines.\u00a0 After saving the history, the history file is<br \/>\ntruncated to contain no more than HISTFILESIZE lines.\u00a0 If<br \/>\nHISTFILESIZE is unset, or set to null, a non-numeric value, or a<br \/>\nnumeric value less than zero, the history file is not truncated.<\/p>\n<p>The builtin command fc (see SHELL BUILTIN COMMANDS below) may be used<br \/>\nto list or edit and re-execute a portion of the history list.\u00a0 The<br \/>\nhistory builtin may be used to display or modify the history list and<br \/>\nmanipulate the history file.\u00a0 When using command-line editing, search<br \/>\ncommands are available in each editing mode that provide access to<br \/>\nthe history list.<\/p>\n<p>The shell allows control over which commands are saved on the history<br \/>\nlist.\u00a0 The HISTCONTROL and HISTIGNORE variables may be set to cause<br \/>\nthe shell to save only a subset of the commands entered.\u00a0 The cmdhist<br \/>\nshell option, if enabled, causes the shell to attempt to save each<br \/>\nline of a multi-line command in the same history entry, adding<br \/>\nsemicolons where necessary to preserve syntactic correctness.\u00a0 The<br \/>\nlithist shell option causes the shell to save the command with<br \/>\nembedded newlines instead of semicolons.\u00a0 See the description of the<br \/>\nshopt builtin below under SHELL BUILTIN COMMANDS for information on<br \/>\nsetting and unsetting shell options.<\/p>\n<p>HISTORY EXPANSION<\/p>\n<p>The shell supports a history expansion feature that is similar to the<br \/>\nhistory expansion in csh.\u00a0 This section describes what syntax<br \/>\nfeatures are available.\u00a0 This feature is enabled by default for<br \/>\ninteractive shells, and can be disabled using the +H option to the<br \/>\nset builtin command (see SHELL BUILTIN COMMANDS below).\u00a0 Non-<br \/>\ninteractive shells do not perform history expansion by default.<\/p>\n<p>History expansions introduce words from the history list into the<br \/>\ninput stream, making it easy to repeat commands, insert the arguments<br \/>\nto a previous command into the current input line, or fix errors in<br \/>\nprevious commands quickly.<\/p>\n<p>History expansion is performed immediately after a complete line is<br \/>\nread, before the shell breaks it into words.\u00a0 It takes place in two<br \/>\nparts.\u00a0 The first is to determine which line from the history list to<br \/>\nuse during substitution.\u00a0 The second is to select portions of that<br \/>\nline for inclusion into the current one.\u00a0 The line selected from the<br \/>\nhistory is the event, and the portions of that line that are acted<br \/>\nupon are words.\u00a0 Various modifiers are available to manipulate the<br \/>\nselected words.\u00a0 The line is broken into words in the same fashion as<br \/>\nwhen reading input, so that several metacharacter-separated words<br \/>\nsurrounded by quotes are considered one word.\u00a0 History expansions are<br \/>\nintroduced by the appearance of the history expansion character,<br \/>\nwhich is ! by default.\u00a0 Only backslash (\\) and single quotes can<br \/>\nquote the history expansion character.<\/p>\n<p>Several characters inhibit history expansion if found immediately<br \/>\nfollowing the history expansion character, even if it is unquoted:<br \/>\nspace, tab, newline, carriage return, and =.\u00a0 If the extglob shell<br \/>\noption is enabled, ( will also inhibit expansion.<\/p>\n<p>Several shell options settable with the shopt builtin may be used to<br \/>\ntailor the behavior of history expansion.\u00a0 If the histverify shell<br \/>\noption is enabled (see the description of the shopt builtin below),<br \/>\nand readline is being used, history substitutions are not immediately<br \/>\npassed to the shell parser.\u00a0 Instead, the expanded line is reloaded<br \/>\ninto the readline editing buffer for further modification.\u00a0 If<br \/>\nreadline is being used, and the histreedit shell option is enabled, a<br \/>\nfailed history substitution will be reloaded into the readline<br \/>\nediting buffer for correction.\u00a0 The -p option to the history builtin<br \/>\ncommand may be used to see what a history expansion will do before<br \/>\nusing it.\u00a0 The -s option to the history builtin may be used to add<br \/>\ncommands to the end of the history list without actually executing<br \/>\nthem, so that they are available for subsequent recall.<\/p>\n<p>The shell allows control of the various characters used by the<br \/>\nhistory expansion mechanism (see the description of histchars above<br \/>\nunder Shell Variables).\u00a0 The shell uses the history comment character<br \/>\nto mark history timestamps when writing the history file.<\/p>\n<p>Event Designators<br \/>\nAn event designator is a reference to a command line entry in the<br \/>\nhistory list.\u00a0 Unless the reference is absolute, events are relative<br \/>\nto the current position in the history list.<\/p>\n<p>!\u00a0\u00a0\u00a0\u00a0\u00a0 Start a history substitution, except when followed by a blank,<br \/>\nnewline, carriage return, = or ( (when the extglob shell<br \/>\noption is enabled using the shopt builtin).<br \/>\n!n\u00a0\u00a0\u00a0\u00a0 Refer to command line n.<br \/>\n!-n\u00a0\u00a0\u00a0 Refer to the current command minus n.<br \/>\n!!\u00a0\u00a0\u00a0\u00a0 Refer to the previous command.\u00a0 This is a synonym for `!-1&#8242;.<br \/>\n!string<br \/>\nRefer to the most recent command preceding the current<br \/>\nposition in the history list starting with string.<br \/>\n!?string[?]<br \/>\nRefer to the most recent command preceding the current<br \/>\nposition in the history list containing string.\u00a0 The trailing<br \/>\n? may be omitted if string is followed immediately by a<br \/>\nnewline.<br \/>\n^string1^string2^<br \/>\nQuick substitution.\u00a0 Repeat the previous command, replacing<br \/>\nstring1 with string2.\u00a0 Equivalent to &#8220;!!:s\/string1\/string2\/&#8221;<br \/>\n(see Modifiers below).<br \/>\n!#\u00a0\u00a0\u00a0\u00a0 The entire command line typed so far.<\/p>\n<p>Word Designators<br \/>\nWord designators are used to select desired words from the event.\u00a0 A<br \/>\n: separates the event specification from the word designator.\u00a0 It may<br \/>\nbe omitted if the word designator begins with a ^, $, *, -, or %.<br \/>\nWords are numbered from the beginning of the line, with the first<br \/>\nword being denoted by 0 (zero).\u00a0 Words are inserted into the current<br \/>\nline separated by single spaces.<\/p>\n<p>0 (zero)<br \/>\nThe zeroth word.\u00a0 For the shell, this is the command word.<br \/>\nn\u00a0\u00a0\u00a0\u00a0\u00a0 The nth word.<br \/>\n^\u00a0\u00a0\u00a0\u00a0\u00a0 The first argument.\u00a0 That is, word 1.<br \/>\n$\u00a0\u00a0\u00a0\u00a0\u00a0 The last word.\u00a0 This is usually the last argument, but will<br \/>\nexpand to the zeroth word if there is only one word in the<br \/>\nline.<br \/>\n%\u00a0\u00a0\u00a0\u00a0\u00a0 The word matched by the most recent `?string?&#8217; search.<br \/>\nx-y\u00a0\u00a0\u00a0 A range of words; `-y&#8217; abbreviates `0-y&#8217;.<br \/>\n*\u00a0\u00a0\u00a0\u00a0\u00a0 All of the words but the zeroth.\u00a0 This is a synonym for `1-$&#8217;.<br \/>\nIt is not an error to use * if there is just one word in the<br \/>\nevent; the empty string is returned in that case.<br \/>\nx*\u00a0\u00a0\u00a0\u00a0 Abbreviates x-$.<br \/>\nx-\u00a0\u00a0\u00a0\u00a0 Abbreviates x-$ like x*, but omits the last word.<\/p>\n<p>If a word designator is supplied without an event specification, the<br \/>\nprevious command is used as the event.<\/p>\n<p>Modifiers<br \/>\nAfter the optional word designator, there may appear a sequence of<br \/>\none or more of the following modifiers, each preceded by a `:&#8217;.<\/p>\n<p>h\u00a0\u00a0\u00a0\u00a0\u00a0 Remove a trailing filename component, leaving only the head.<br \/>\nt\u00a0\u00a0\u00a0\u00a0\u00a0 Remove all leading filename components, leaving the tail.<br \/>\nr\u00a0\u00a0\u00a0\u00a0\u00a0 Remove a trailing suffix of the form .xxx, leaving the<br \/>\nbasename.<br \/>\ne\u00a0\u00a0\u00a0\u00a0\u00a0 Remove all but the trailing suffix.<br \/>\np\u00a0\u00a0\u00a0\u00a0\u00a0 Print the new command but do not execute it.<br \/>\nq\u00a0\u00a0\u00a0\u00a0\u00a0 Quote the substituted words, escaping further substitutions.<br \/>\nx\u00a0\u00a0\u00a0\u00a0\u00a0 Quote the substituted words as with q, but break into words at<br \/>\nblanks and newlines.<br \/>\ns\/old\/new\/<br \/>\nSubstitute new for the first occurrence of old in the event<br \/>\nline.\u00a0 Any delimiter can be used in place of \/.\u00a0 The final<br \/>\ndelimiter is optional if it is the last character of the event<br \/>\nline.\u00a0 The delimiter may be quoted in old and new with a<br \/>\nsingle backslash.\u00a0 If &amp; appears in new, it is replaced by old.<br \/>\nA single backslash will quote the &amp;.\u00a0 If old is null, it is<br \/>\nset to the last old substituted, or, if no previous history<br \/>\nsubstitutions took place, the last string in a !?string[?]<br \/>\nsearch.<br \/>\n&amp;\u00a0\u00a0\u00a0\u00a0\u00a0 Repeat the previous substitution.<br \/>\ng\u00a0\u00a0\u00a0\u00a0\u00a0 Cause changes to be applied over the entire event line.\u00a0 This<br \/>\nis used in conjunction with `:s&#8217; (e.g., `:gs\/old\/new\/&#8217;) or<br \/>\n`:&amp;&#8217;.\u00a0 If used with `:s&#8217;, any delimiter can be used in place<br \/>\nof \/, and the final delimiter is optional if it is the last<br \/>\ncharacter of the event line.\u00a0 An a may be used as a synonym<br \/>\nfor g.<br \/>\nG\u00a0\u00a0\u00a0\u00a0\u00a0 Apply the following `s&#8217; modifier once to each word in the<br \/>\nevent line.<\/p>\n<p>SHELL BUILTIN COMMANDS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 top<\/p>\n<p>Unless otherwise noted, each builtin command documented in this<br \/>\nsection as accepting options preceded by &#8211; accepts &#8212; to signify the<br \/>\nend of the options.\u00a0 The :, true, false, and test builtins do not<br \/>\naccept options and do not treat &#8212; specially.\u00a0 The exit, logout,<br \/>\nbreak, continue, let, and shift builtins accept and process arguments<br \/>\nbeginning with &#8211; without requiring &#8211;.\u00a0 Other builtins that accept<br \/>\narguments but are not specified as accepting options interpret<br \/>\narguments beginning with &#8211; as invalid options and require &#8212; to<br \/>\nprevent this interpretation.<br \/>\n: [arguments]<br \/>\nNo effect; the command does nothing beyond expanding arguments<br \/>\nand performing any specified redirections.\u00a0 A zero exit code<br \/>\nis returned.<\/p>\n<p>.\u00a0 filename [arguments]<br \/>\nsource filename [arguments]<br \/>\nRead and execute commands from filename in the current shell<br \/>\nenvironment and return the exit status of the last command<br \/>\nexecuted from filename.\u00a0 If filename does not contain a slash,<br \/>\nfilenames in PATH are used to find the directory containing<br \/>\nfilename.\u00a0 The file searched for in PATH need not be<br \/>\nexecutable.\u00a0 When bash is not in posix mode, the current<br \/>\ndirectory is searched if no file is found in PATH.\u00a0 If the<br \/>\nsourcepath option to the shopt builtin command is turned off,<br \/>\nthe PATH is not searched.\u00a0 If any arguments are supplied, they<br \/>\nbecome the positional parameters when filename is executed.<br \/>\nOtherwise the positional parameters are unchanged.\u00a0 The return<br \/>\nstatus is the status of the last command exited within the<br \/>\nscript (0 if no commands are executed), and false if filename<br \/>\nis not found or cannot be read.<\/p>\n<p>alias [-p] [name[=value] &#8230;]<br \/>\nAlias with no arguments or with the -p option prints the list<br \/>\nof aliases in the form alias name=value on standard output.<br \/>\nWhen arguments are supplied, an alias is defined for each name<br \/>\nwhose value is given.\u00a0 A trailing space in\u00a0 value causes the<br \/>\nnext word to be checked for alias substitution when the alias<br \/>\nis expanded.\u00a0 For each name in the argument list for which no<br \/>\nvalue is supplied, the name and value of the alias is printed.<br \/>\nAlias returns true unless a name is given for which no alias<br \/>\nhas been defined.<\/p>\n<p>bg [jobspec &#8230;]<br \/>\nResume each suspended job jobspec in the background, as if it<br \/>\nhad been started with &amp;.\u00a0 If jobspec is not present, the<br \/>\nshell&#8217;s notion of the current job is used.\u00a0 bg jobspec returns<br \/>\n0 unless run when job control is disabled or, when run with<br \/>\njob control enabled, any specified jobspec was not found or<br \/>\nwas started without job control.<\/p>\n<p>bind [-m keymap] [-lpsvPSVX]<br \/>\nbind [-m keymap] [-q function] [-u function] [-r keyseq]<br \/>\nbind [-m keymap] -f filename<br \/>\nbind [-m keymap] -x keyseq:shell-command<br \/>\nbind [-m keymap] keyseq:function-name<br \/>\nbind readline-command<br \/>\nDisplay current readline key and function bindings, bind a key<br \/>\nsequence to a readline function or macro, or set a readline<br \/>\nvariable.\u00a0 Each non-option argument is a command as it would<br \/>\nappear in .inputrc, but each binding or command must be passed<br \/>\nas a separate argument; e.g., &#8216;&#8221;\\C-x\\C-r&#8221;: re-read-init-file&#8217;.<br \/>\nOptions, if supplied, have the following meanings:<br \/>\n-m keymap<br \/>\nUse keymap as the keymap to be affected by the<br \/>\nsubsequent bindings.\u00a0 Acceptable keymap names are<br \/>\nemacs, emacs-standard, emacs-meta, emacs-ctlx, vi,<br \/>\nvi-move, vi-command, and vi-insert.\u00a0 vi is equivalent<br \/>\nto vi-command; emacs is equivalent to emacs-standard.<br \/>\n-l\u00a0\u00a0\u00a0\u00a0 List the names of all readline functions.<br \/>\n-p\u00a0\u00a0\u00a0\u00a0 Display readline function names and bindings in such a<br \/>\nway that they can be re-read.<br \/>\n-P\u00a0\u00a0\u00a0\u00a0 List current readline function names and bindings.<br \/>\n-s\u00a0\u00a0\u00a0\u00a0 Display readline key sequences bound to macros and the<br \/>\nstrings they output in such a way that they can be re-<br \/>\nread.<br \/>\n-S\u00a0\u00a0\u00a0\u00a0 Display readline key sequences bound to macros and the<br \/>\nstrings they output.<br \/>\n-v\u00a0\u00a0\u00a0\u00a0 Display readline variable names and values in such a<br \/>\nway that they can be re-read.<br \/>\n-V\u00a0\u00a0\u00a0\u00a0 List current readline variable names and values.<br \/>\n-f filename<br \/>\nRead key bindings from filename.<br \/>\n-q function<br \/>\nQuery about which keys invoke the named function.<br \/>\n-u function<br \/>\nUnbind all keys bound to the named function.<br \/>\n-r keyseq<br \/>\nRemove any current binding for keyseq.<br \/>\n-x keyseq:shell-command<br \/>\nCause shell-command to be executed whenever keyseq is<br \/>\nentered.\u00a0 When shell-command is executed, the shell<br \/>\nsets the READLINE_LINE variable to the contents of the<br \/>\nreadline line buffer and the READLINE_POINT variable to<br \/>\nthe current location of the insertion point.\u00a0 If the<br \/>\nexecuted command changes the value of READLINE_LINE or<br \/>\nREADLINE_POINT, those new values will be reflected in<br \/>\nthe editing state.<br \/>\n-X\u00a0\u00a0\u00a0\u00a0 List all key sequences bound to shell commands and the<br \/>\nassociated commands in a format that can be reused as<br \/>\ninput.<\/p>\n<p>The return value is 0 unless an unrecognized option is given<br \/>\nor an error occurred.<\/p>\n<p>break [n]<br \/>\nExit from within a for, while, until, or select loop.\u00a0 If n is<br \/>\nspecified, break n levels.\u00a0 n must be \u2265 1.\u00a0 If n is greater<br \/>\nthan the number of enclosing loops, all enclosing loops are<br \/>\nexited.\u00a0 The return value is 0 unless n is not greater than or<br \/>\nequal to 1.<\/p>\n<p>builtin shell-builtin [arguments]<br \/>\nExecute the specified shell builtin, passing it arguments, and<br \/>\nreturn its exit status.\u00a0 This is useful when defining a<br \/>\nfunction whose name is the same as a shell builtin, retaining<br \/>\nthe functionality of the builtin within the function.\u00a0 The cd<br \/>\nbuiltin is commonly redefined this way.\u00a0 The return status is<br \/>\nfalse if shell-builtin is not a shell builtin command.<\/p>\n<p>caller [expr]<br \/>\nReturns the context of any active subroutine call (a shell<br \/>\nfunction or a script executed with the . or source builtins).<br \/>\nWithout expr, caller displays the line number and source<br \/>\nfilename of the current subroutine call.\u00a0 If a non-negative<br \/>\ninteger is supplied as expr, caller displays the line number,<br \/>\nsubroutine name, and source file corresponding to that<br \/>\nposition in the current execution call stack.\u00a0 This extra<br \/>\ninformation may be used, for example, to print a stack trace.<br \/>\nThe current frame is frame 0.\u00a0 The return value is 0 unless<br \/>\nthe shell is not executing a subroutine call or expr does not<br \/>\ncorrespond to a valid position in the call stack.<\/p>\n<p>cd [-L|[-P [-e]] [-@]] [dir]<br \/>\nChange the current directory to dir.\u00a0 if dir is not supplied,<br \/>\nthe value of the HOME shell variable is the default.\u00a0 Any<br \/>\nadditional arguments following dir are ignored.\u00a0 The variable<br \/>\nCDPATH defines the search path for the directory containing<br \/>\ndir: each directory name in CDPATH is searched for dir.<br \/>\nAlternative directory names in CDPATH are separated by a colon<br \/>\n(:).\u00a0 A null directory name in CDPATH is the same as the<br \/>\ncurrent directory, i.e., &#8220;.&#8221;.\u00a0 If dir begins with a slash<br \/>\n(\/), then CDPATH is not used. The -P option causes cd to use<br \/>\nthe physical directory structure by resolving symbolic links<br \/>\nwhile traversing dir and before processing instances of .. in<br \/>\ndir (see also the -P option to the set builtin command); the<br \/>\n-L option forces symbolic links to be followed by resolving<br \/>\nthe link after processing instances of .. in dir.\u00a0 If ..<br \/>\nappears in dir, it is processed by removing the immediately<br \/>\nprevious pathname component from dir, back to a slash or the<br \/>\nbeginning of dir.\u00a0 If the -e option is supplied with -P, and<br \/>\nthe current working directory cannot be successfully<br \/>\ndetermined after a successful directory change, cd will return<br \/>\nan unsuccessful status.\u00a0 On systems that support it, the\u00a0-@<br \/>\noption presents the extended attributes associated with a file<br \/>\nas a directory.\u00a0 An argument of &#8211; is converted to $OLDPWD<br \/>\nbefore the directory change is attempted.\u00a0 If a non-empty<br \/>\ndirectory name from CDPATH is used, or if &#8211; is the first<br \/>\nargument, and the directory change is successful, the absolute<br \/>\npathname of the new working directory is written to the<br \/>\nstandard output.\u00a0 The return value is true if the directory<br \/>\nwas successfully changed; false otherwise.<\/p>\n<p>command [-pVv] command [arg &#8230;]<br \/>\nRun command with args suppressing the normal shell function<br \/>\nlookup. Only builtin commands or commands found in the PATH<br \/>\nare executed.\u00a0 If the -p option is given, the search for<br \/>\ncommand is performed using a default value for PATH that is<br \/>\nguaranteed to find all of the standard utilities.\u00a0 If either<br \/>\nthe -V or -v option is supplied, a description of command is<br \/>\nprinted.\u00a0 The -v option causes a single word indicating the<br \/>\ncommand or filename used to invoke command to be displayed;<br \/>\nthe -V option produces a more verbose description.\u00a0 If the -V<br \/>\nor -v option is supplied, the exit status is 0 if command was<br \/>\nfound, and 1 if not.\u00a0 If neither option is supplied and an<br \/>\nerror occurred or command cannot be found, the exit status is<br \/>\n127.\u00a0 Otherwise, the exit status of the command builtin is the<br \/>\nexit status of command.<\/p>\n<p>compgen [option] [word]<br \/>\nGenerate possible completion matches for word according to the<br \/>\noptions, which may be any option accepted by the complete<br \/>\nbuiltin with the exception of -p and -r, and write the matches<br \/>\nto the standard output.\u00a0 When using the -F or -C options, the<br \/>\nvarious shell variables set by the programmable completion<br \/>\nfacilities, while available, will not have useful values.<\/p>\n<p>The matches will be generated in the same way as if the<br \/>\nprogrammable completion code had generated them directly from<br \/>\na completion specification with the same flags.\u00a0 If word is<br \/>\nspecified, only those completions matching word will be<br \/>\ndisplayed.<\/p>\n<p>The return value is true unless an invalid option is supplied,<br \/>\nor no matches were generated.<\/p>\n<p>complete [-abcdefgjksuv] [-o comp-option] [-DE] [-A action] [-G<br \/>\nglobpat] [-W wordlist] [-F function] [-C command]<br \/>\n[-X filterpat] [-P prefix] [-S suffix] name [name &#8230;]<br \/>\ncomplete -pr [-DE] [name &#8230;]<br \/>\nSpecify how arguments to each name should be completed.\u00a0 If<br \/>\nthe -p option is supplied, or if no options are supplied,<br \/>\nexisting completion specifications are printed in a way that<br \/>\nallows them to be reused as input.\u00a0 The -r option removes a<br \/>\ncompletion specification for each name, or, if no names are<br \/>\nsupplied, all completion specifications.\u00a0 The -D option<br \/>\nindicates that the remaining options and actions should apply<br \/>\nto the &#8220;default&#8221; command completion; that is, completion<br \/>\nattempted on a command for which no completion has previously<br \/>\nbeen defined.\u00a0 The -E option indicates that the remaining<br \/>\noptions and actions should apply to &#8220;empty&#8221; command<br \/>\ncompletion; that is, completion attempted on a blank line.<\/p>\n<p>The process of applying these completion specifications when<br \/>\nword completion is attempted is described above under<br \/>\nProgrammable Completion.<\/p>\n<p>Other options, if specified, have the following meanings.\u00a0 The<br \/>\narguments to the -G, -W, and -X options (and, if necessary,<br \/>\nthe -P and -S options) should be quoted to protect them from<br \/>\nexpansion before the complete builtin is invoked.<br \/>\n-o comp-option<br \/>\nThe comp-option controls several aspects of the<br \/>\ncompspec&#8217;s behavior beyond the simple generation of<br \/>\ncompletions.\u00a0 comp-option may be one of:<br \/>\nbashdefault<br \/>\nPerform the rest of the default bash<br \/>\ncompletions if the compspec generates no<br \/>\nmatches.<br \/>\ndefault Use readline&#8217;s default filename completion if<br \/>\nthe compspec generates no matches.<br \/>\ndirnames<br \/>\nPerform directory name completion if the<br \/>\ncompspec generates no matches.<br \/>\nfilenames<br \/>\nTell readline that the compspec generates<br \/>\nfilenames, so it can perform any<br \/>\nfilename-specific processing (like adding a<br \/>\nslash to directory names, quoting special<br \/>\ncharacters, or suppressing trailing spaces).<br \/>\nIntended to be used with shell functions.<br \/>\nnoquote Tell readline not to quote the completed words<br \/>\nif they are filenames (quoting filenames is<br \/>\nthe default).<br \/>\nnospace Tell readline not to append a space (the<br \/>\ndefault) to words completed at the end of the<br \/>\nline.<br \/>\nplusdirs<br \/>\nAfter any matches defined by the compspec are<br \/>\ngenerated, directory name completion is<br \/>\nattempted and any matches are added to the<br \/>\nresults of the other actions.<br \/>\n-A action<br \/>\nThe action may be one of the following to generate a<br \/>\nlist of possible completions:<br \/>\nalias\u00a0\u00a0 Alias names.\u00a0 May also be specified as -a.<br \/>\narrayvar<br \/>\nArray variable names.<br \/>\nbinding Readline key binding names.<br \/>\nbuiltin Names of shell builtin commands.\u00a0 May also be<br \/>\nspecified as -b.<br \/>\ncommand Command names.\u00a0 May also be specified as -c.<br \/>\ndirectory<br \/>\nDirectory names.\u00a0 May also be specified as -d.<br \/>\ndisabled<br \/>\nNames of disabled shell builtins.<br \/>\nenabled Names of enabled shell builtins.<br \/>\nexport\u00a0 Names of exported shell variables.\u00a0 May also<br \/>\nbe specified as -e.<br \/>\nfile\u00a0\u00a0\u00a0 File names.\u00a0 May also be specified as -f.<br \/>\nfunction<br \/>\nNames of shell functions.<br \/>\ngroup\u00a0\u00a0 Group names.\u00a0 May also be specified as -g.<br \/>\nhelptopic<br \/>\nHelp topics as accepted by the help builtin.<br \/>\nhostname<br \/>\nHostnames, as taken from the file specified by<br \/>\nthe HOSTFILE shell variable.<br \/>\njob\u00a0\u00a0\u00a0\u00a0 Job names, if job control is active.\u00a0 May also<br \/>\nbe specified as -j.<br \/>\nkeyword Shell reserved words.\u00a0 May also be specified<br \/>\nas -k.<br \/>\nrunning Names of running jobs, if job control is<br \/>\nactive.<br \/>\nservice Service names.\u00a0 May also be specified as -s.<br \/>\nsetopt\u00a0 Valid arguments for the -o option to the set<br \/>\nbuiltin.<br \/>\nshopt\u00a0\u00a0 Shell option names as accepted by the shopt<br \/>\nbuiltin.<br \/>\nsignal\u00a0 Signal names.<br \/>\nstopped Names of stopped jobs, if job control is<br \/>\nactive.<br \/>\nuser\u00a0\u00a0\u00a0 User names.\u00a0 May also be specified as -u.<br \/>\nvariable<br \/>\nNames of all shell variables.\u00a0 May also be<br \/>\nspecified as -v.<br \/>\n-C command<br \/>\ncommand is executed in a subshell environment, and its<br \/>\noutput is used as the possible completions.<br \/>\n-F function<br \/>\nThe shell function function is executed in the current<br \/>\nshell environment.\u00a0 When the function is executed, the<br \/>\nfirst argument ($1) is the name of the command whose<br \/>\narguments are being completed, the second argument<br \/>\n($2) is the word being completed, and the third<br \/>\nargument ($3) is the word preceding the word being<br \/>\ncompleted on the current command line.\u00a0 When it<br \/>\nfinishes, the possible completions are retrieved from<br \/>\nthe value of the COMPREPLY array variable.<br \/>\n-G globpat<br \/>\nThe pathname expansion pattern globpat is expanded to<br \/>\ngenerate the possible completions.<br \/>\n-P prefix<br \/>\nprefix is added at the beginning of each possible<br \/>\ncompletion after all other options have been applied.<br \/>\n-S suffix<br \/>\nsuffix is appended to each possible completion after<br \/>\nall other options have been applied.<br \/>\n-W wordlist<br \/>\nThe wordlist is split using the characters in the IFS<br \/>\nspecial variable as delimiters, and each resultant<br \/>\nword is expanded.\u00a0 The possible completions are the<br \/>\nmembers of the resultant list which match the word<br \/>\nbeing completed.<br \/>\n-X filterpat<br \/>\nfilterpat is a pattern as used for pathname expansion.<br \/>\nIt is applied to the list of possible completions<br \/>\ngenerated by the preceding options and arguments, and<br \/>\neach completion matching filterpat is removed from the<br \/>\nlist.\u00a0 A leading ! in filterpat negates the pattern;<br \/>\nin this case, any completion not matching filterpat is<br \/>\nremoved.<\/p>\n<p>The return value is true unless an invalid option is supplied,<br \/>\nan option other than -p or -r is supplied without a name<br \/>\nargument, an attempt is made to remove a completion<br \/>\nspecification for a name for which no specification exists, or<br \/>\nan error occurs adding a completion specification.<\/p>\n<p>compopt [-o option] [-DE] [+o option] [name]<br \/>\nModify completion options for each name according to the<br \/>\noptions, or for the currently-executing completion if no names<br \/>\nare supplied.\u00a0 If no options are given, display the completion<br \/>\noptions for each name or the current completion.\u00a0 The possible<br \/>\nvalues of option are those valid for the complete builtin<br \/>\ndescribed above.\u00a0 The -D option indicates that the remaining<br \/>\noptions should apply to the &#8220;default&#8221; command completion;<br \/>\nthat is, completion attempted on a command for which no<br \/>\ncompletion has previously been defined.\u00a0 The -E option<br \/>\nindicates that the remaining options should apply to &#8220;empty&#8221;<br \/>\ncommand completion; that is, completion attempted on a blank<br \/>\nline.<\/p>\n<p>The return value is true unless an invalid option is supplied,<br \/>\nan attempt is made to modify the options for a name for which<br \/>\nno completion specification exists, or an output error occurs.<\/p>\n<p>continue [n]<br \/>\nResume the next iteration of the enclosing for, while, until,<br \/>\nor select loop.\u00a0 If n is specified, resume at the nth<br \/>\nenclosing loop.\u00a0 n must be \u2265 1.\u00a0 If n is greater than the<br \/>\nnumber of enclosing loops, the last enclosing loop (the &#8220;top-<br \/>\nlevel&#8221; loop) is resumed.\u00a0 The return value is 0 unless n is<br \/>\nnot greater than or equal to 1.<\/p>\n<p>declare [-aAfFgilnrtux] [-p] [name[=value] &#8230;]<br \/>\ntypeset [-aAfFgilnrtux] [-p] [name[=value] &#8230;]<br \/>\nDeclare variables and\/or give them attributes.\u00a0 If no names<br \/>\nare given then display the values of variables.\u00a0 The -p option<br \/>\nwill display the attributes and values of each name.\u00a0 When -p<br \/>\nis used with name arguments, additional options, other than -f<br \/>\nand -F, are ignored.\u00a0 When -p is supplied without name<br \/>\narguments, it will display the attributes and values of all<br \/>\nvariables having the attributes specified by the additional<br \/>\noptions.\u00a0 If no other options are supplied with -p, declare<br \/>\nwill display the attributes and values of all shell variables.<br \/>\nThe -f option will restrict the display to shell functions.<br \/>\nThe -F option inhibits the display of function definitions;<br \/>\nonly the function name and attributes are printed.\u00a0 If the<br \/>\nextdebug shell option is enabled using shopt, the source file<br \/>\nname and line number where the function is defined are<br \/>\ndisplayed as well.\u00a0 The -F option implies -f.\u00a0 The -g option<br \/>\nforces variables to be created or modified at the global<br \/>\nscope, even when declare is executed in a shell function.\u00a0 It<br \/>\nis ignored in all other cases.\u00a0 The following options can be<br \/>\nused to restrict output to variables with the specified<br \/>\nattribute or to give variables attributes:<br \/>\n-a\u00a0\u00a0\u00a0\u00a0 Each name is an indexed array variable (see Arrays<br \/>\nabove).<br \/>\n-A\u00a0\u00a0\u00a0\u00a0 Each name is an associative array variable (see Arrays<br \/>\nabove).<br \/>\n-f\u00a0\u00a0\u00a0\u00a0 Use function names only.<br \/>\n-i\u00a0\u00a0\u00a0\u00a0 The variable is treated as an integer; arithmetic<br \/>\nevaluation (see ARITHMETIC EVALUATION above) is<br \/>\nperformed when the variable is assigned a value.<br \/>\n-l\u00a0\u00a0\u00a0\u00a0 When the variable is assigned a value, all upper-case<br \/>\ncharacters are converted to lower-case.\u00a0 The upper-case<br \/>\nattribute is disabled.<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 Give each name the nameref attribute, making it a name<br \/>\nreference to another variable.\u00a0 That other variable is<br \/>\ndefined by the value of name.\u00a0 All references and<br \/>\nassignments to name, except for changing the -n<br \/>\nattribute itself, are performed on the variable<br \/>\nreferenced by name&#8217;s value.\u00a0 The -n attribute cannot be<br \/>\napplied to array variables.<br \/>\n-r\u00a0\u00a0\u00a0\u00a0 Make names readonly.\u00a0 These names cannot then be<br \/>\nassigned values by subsequent assignment statements or<br \/>\nunset.<br \/>\n-t\u00a0\u00a0\u00a0\u00a0 Give each name the trace attribute.\u00a0 Traced functions<br \/>\ninherit the DEBUG and RETURN traps from the calling<br \/>\nshell.\u00a0 The trace attribute has no special meaning for<br \/>\nvariables.<br \/>\n-u\u00a0\u00a0\u00a0\u00a0 When the variable is assigned a value, all lower-case<br \/>\ncharacters are converted to upper-case.\u00a0 The lower-case<br \/>\nattribute is disabled.<br \/>\n-x\u00a0\u00a0\u00a0\u00a0 Mark names for export to subsequent commands via the<br \/>\nenvironment.<\/p>\n<p>Using `+&#8217; instead of `-&#8216; turns off the attribute instead, with<br \/>\nthe exceptions that +a may not be used to destroy an array<br \/>\nvariable and +r will not remove the readonly attribute.\u00a0 When<br \/>\nused in a function, declare and typeset make each name local,<br \/>\nas with the local command, unless the -g option is supplied.<br \/>\nIf a variable name is followed by =value, the value of the<br \/>\nvariable is set to value.\u00a0 When using -a or -A and the<br \/>\ncompound assignment syntax to create array variables,<br \/>\nadditional attributes do not take effect until subsequent<br \/>\nassignments.\u00a0 The return value is 0 unless an invalid option<br \/>\nis encountered, an attempt is made to define a function using<br \/>\n&#8220;-f foo=bar&#8221;, an attempt is made to assign a value to a<br \/>\nreadonly variable, an attempt is made to assign a value to an<br \/>\narray variable without using the compound assignment syntax<br \/>\n(see Arrays above), one of the names is not a valid shell<br \/>\nvariable name, an attempt is made to turn off readonly status<br \/>\nfor a readonly variable, an attempt is made to turn off array<br \/>\nstatus for an array variable, or an attempt is made to display<br \/>\na non-existent function with -f.<\/p>\n<p>dirs [-clpv] [+n] [-n]<br \/>\nWithout options, displays the list of currently remembered<br \/>\ndirectories.\u00a0 The default display is on a single line with<br \/>\ndirectory names separated by spaces.\u00a0 Directories are added to<br \/>\nthe list with the pushd command; the popd command removes<br \/>\nentries from the list.<br \/>\n-c\u00a0\u00a0\u00a0\u00a0 Clears the directory stack by deleting all of the<br \/>\nentries.<br \/>\n-l\u00a0\u00a0\u00a0\u00a0 Produces a listing using full pathnames; the default<br \/>\nlisting format uses a tilde to denote the home<br \/>\ndirectory.<br \/>\n-p\u00a0\u00a0\u00a0\u00a0 Print the directory stack with one entry per line.<br \/>\n-v\u00a0\u00a0\u00a0\u00a0 Print the directory stack with one entry per line,<br \/>\nprefixing each entry with its index in the stack.<br \/>\n+n\u00a0\u00a0\u00a0\u00a0 Displays the nth entry counting from the left of the<br \/>\nlist shown by dirs when invoked without options,<br \/>\nstarting with zero.<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 Displays the nth entry counting from the right of the<br \/>\nlist shown by dirs when invoked without options,<br \/>\nstarting with zero.<\/p>\n<p>The return value is 0 unless an invalid option is supplied or<br \/>\nn indexes beyond the end of the directory stack.<\/p>\n<p>disown [-ar] [-h] [jobspec &#8230;]<br \/>\nWithout options, remove each jobspec from the table of active<br \/>\njobs.\u00a0 If jobspec is not present, and neither the -a nor the<br \/>\n-r option is supplied, the current job is used.\u00a0 If the -h<br \/>\noption is given, each jobspec is not removed from the table,<br \/>\nbut is marked so that SIGHUP is not sent to the job if the<br \/>\nshell receives a SIGHUP.\u00a0 If no jobspec is supplied, the -a<br \/>\noption means to remove or mark all jobs; the -r option without<br \/>\na jobspec argument restricts operation to running jobs.\u00a0 The<br \/>\nreturn value is 0 unless a jobspec does not specify a valid<br \/>\njob.<\/p>\n<p>echo [-neE] [arg &#8230;]<br \/>\nOutput the args, separated by spaces, followed by a newline.<br \/>\nThe return status is 0 unless a write error occurs.\u00a0 If -n is<br \/>\nspecified, the trailing newline is suppressed.\u00a0 If the -e<br \/>\noption is given, interpretation of the following backslash-<br \/>\nescaped characters is enabled.\u00a0 The -E option disables the<br \/>\ninterpretation of these escape characters, even on systems<br \/>\nwhere they are interpreted by default.\u00a0 The xpg_echo shell<br \/>\noption may be used to dynamically determine whether or not<br \/>\necho expands these escape characters by default.\u00a0 echo does<br \/>\nnot interpret &#8212; to mean the end of options.\u00a0 echo interprets<br \/>\nthe following escape sequences:<br \/>\n\\a\u00a0\u00a0\u00a0\u00a0 alert (bell)<br \/>\n\\b\u00a0\u00a0\u00a0\u00a0 backspace<br \/>\n\\c\u00a0\u00a0\u00a0\u00a0 suppress further output<br \/>\n\\e<br \/>\n\\E\u00a0\u00a0\u00a0\u00a0 an escape character<br \/>\n\\f\u00a0\u00a0\u00a0\u00a0 form feed<br \/>\n\\n\u00a0\u00a0\u00a0\u00a0 new line<br \/>\n\\r\u00a0\u00a0\u00a0\u00a0 carriage return<br \/>\n\\t\u00a0\u00a0\u00a0\u00a0 horizontal tab<br \/>\n\\v\u00a0\u00a0\u00a0\u00a0 vertical tab<br \/>\n\\\\\u00a0\u00a0\u00a0\u00a0 backslash<br \/>\n\\0nnn\u00a0 the eight-bit character whose value is the octal value<br \/>\nnnn (zero to three octal digits)<br \/>\n\\xHH\u00a0\u00a0 the eight-bit character whose value is the hexadecimal<br \/>\nvalue HH (one or two hex digits)<br \/>\n\\uHHHH the Unicode (ISO\/IEC 10646) character whose value is<br \/>\nthe hexadecimal value HHHH (one to four hex digits)<br \/>\n\\UHHHHHHHH<br \/>\nthe Unicode (ISO\/IEC 10646) character whose value is<br \/>\nthe hexadecimal value HHHHHHHH (one to eight hex<br \/>\ndigits)<\/p>\n<p>enable [-a] [-dnps] [-f filename] [name &#8230;]<br \/>\nEnable and disable builtin shell commands.\u00a0 Disabling a<br \/>\nbuiltin allows a disk command which has the same name as a<br \/>\nshell builtin to be executed without specifying a full<br \/>\npathname, even though the shell normally searches for builtins<br \/>\nbefore disk commands.\u00a0 If -n is used, each name is disabled;<br \/>\notherwise, names are enabled.\u00a0 For example, to use the test<br \/>\nbinary found via the PATH instead of the shell builtin<br \/>\nversion, run &#8220;enable -n test&#8221;.\u00a0 The -f option means to load<br \/>\nthe new builtin command name from shared object filename, on<br \/>\nsystems that support dynamic loading.\u00a0 The -d option will<br \/>\ndelete a builtin previously loaded with -f.\u00a0 If no name<br \/>\narguments are given, or if the -p option is supplied, a list<br \/>\nof shell builtins is printed.\u00a0 With no other option arguments,<br \/>\nthe list consists of all enabled shell builtins.\u00a0 If -n is<br \/>\nsupplied, only disabled builtins are printed.\u00a0 If -a is<br \/>\nsupplied, the list printed includes all builtins, with an<br \/>\nindication of whether or not each is enabled.\u00a0 If -s is<br \/>\nsupplied, the output is restricted to the POSIX special<br \/>\nbuiltins.\u00a0 The return value is 0 unless a name is not a shell<br \/>\nbuiltin or there is an error loading a new builtin from a<br \/>\nshared object.<\/p>\n<p>eval [arg &#8230;]<br \/>\nThe args are read and concatenated together into a single<br \/>\ncommand.\u00a0 This command is then read and executed by the shell,<br \/>\nand its exit status is returned as the value of eval.\u00a0 If<br \/>\nthere are no args, or only null arguments, eval returns 0.<\/p>\n<p>exec [-cl] [-a name] [command [arguments]]<br \/>\nIf command is specified, it replaces the shell.\u00a0 No new<br \/>\nprocess is created.\u00a0 The arguments become the arguments to<br \/>\ncommand.\u00a0 If the -l option is supplied, the shell places a<br \/>\ndash at the beginning of the zeroth argument passed to<br \/>\ncommand.\u00a0 This is what login(1) does.\u00a0 The -c option causes<br \/>\ncommand to be executed with an empty environment.\u00a0 If -a is<br \/>\nsupplied, the shell passes name as the zeroth argument to the<br \/>\nexecuted command.\u00a0 If command cannot be executed for some<br \/>\nreason, a non-interactive shell exits, unless the execfail<br \/>\nshell option is enabled.\u00a0 In that case, it returns failure.<br \/>\nAn interactive shell returns failure if the file cannot be<br \/>\nexecuted.\u00a0 If command is not specified, any redirections take<br \/>\neffect in the current shell, and the return status is 0.\u00a0 If<br \/>\nthere is a redirection error, the return status is 1.<\/p>\n<p>exit [n]<br \/>\nCause the shell to exit with a status of n.\u00a0 If n is omitted,<br \/>\nthe exit status is that of the last command executed.\u00a0 A trap<br \/>\non EXIT is executed before the shell terminates.<\/p>\n<p>export [-fn] [name[=word]] &#8230;<br \/>\nexport -p<br \/>\nThe supplied names are marked for automatic export to the<br \/>\nenvironment of subsequently executed commands.\u00a0 If the -f<br \/>\noption is given, the names refer to functions.\u00a0 If no names<br \/>\nare given, or if the -p option is supplied, a list of names of<br \/>\nall exported variables is printed.\u00a0 The -n option causes the<br \/>\nexport property to be removed from each name.\u00a0 If a variable<br \/>\nname is followed by =word, the value of the variable is set to<br \/>\nword.\u00a0 export returns an exit status of 0 unless an invalid<br \/>\noption is encountered, one of the names is not a valid shell<br \/>\nvariable name, or -f is supplied with a name that is not a<br \/>\nfunction.<\/p>\n<p>fc [-e ename] [-lnr] [first] [last]<br \/>\nfc -s [pat=rep] [cmd]<br \/>\nThe first form selects a range of commands from first to last<br \/>\nfrom the history list and displays or edits and re-executes<br \/>\nthem.\u00a0 First and last may be specified as a string (to locate<br \/>\nthe last command beginning with that string) or as a number<br \/>\n(an index into the history list, where a negative number is<br \/>\nused as an offset from the current command number).\u00a0 If last<br \/>\nis not specified it is set to the current command for listing<br \/>\n(so that &#8220;fc -l -10&#8221; prints the last 10 commands) and to<br \/>\nfirst otherwise.\u00a0 If first is not specified it is set to the<br \/>\nprevious command for editing and -16 for listing.<\/p>\n<p>The -n option suppresses the command numbers when listing.<br \/>\nThe -r option reverses the order of the commands.\u00a0 If the -l<br \/>\noption is given, the commands are listed on standard output.<br \/>\nOtherwise, the editor given by ename is invoked on a file<br \/>\ncontaining those commands.\u00a0 If ename is not given, the value<br \/>\nof the FCEDIT variable is used, and the value of EDITOR if<br \/>\nFCEDIT is not set.\u00a0 If neither variable is set, vi is used.<br \/>\nWhen editing is complete, the edited commands are echoed and<br \/>\nexecuted.<\/p>\n<p>In the second form, command is re-executed after each instance<br \/>\nof pat is replaced by rep.\u00a0 Command is intepreted the same as<br \/>\nfirst above.\u00a0 A useful alias to use with this is &#8220;r=&#8221;fc<br \/>\n-s&#8221;&#8221;, so that typing &#8220;r cc&#8221; runs the last command beginning<br \/>\nwith &#8220;cc&#8221; and typing &#8220;r&#8221; re-executes the last command.<\/p>\n<p>If the first form is used, the return value is 0 unless an<br \/>\ninvalid option is encountered or first or last specify history<br \/>\nlines out of range.\u00a0 If the -e option is supplied, the return<br \/>\nvalue is the value of the last command executed or failure if<br \/>\nan error occurs with the temporary file of commands.\u00a0 If the<br \/>\nsecond form is used, the return status is that of the command<br \/>\nre-executed, unless cmd does not specify a valid history line,<br \/>\nin which case fc returns failure.<\/p>\n<p>fg [jobspec]<br \/>\nResume jobspec in the foreground, and make it the current job.<br \/>\nIf jobspec is not present, the shell&#8217;s notion of the current<br \/>\njob is used.\u00a0 The return value is that of the command placed<br \/>\ninto the foreground, or failure if run when job control is<br \/>\ndisabled or, when run with job control enabled, if jobspec<br \/>\ndoes not specify a valid job or jobspec specifies a job that<br \/>\nwas started without job control.<\/p>\n<p>getopts optstring name [args]<br \/>\ngetopts is used by shell procedures to parse positional<br \/>\nparameters.\u00a0 optstring contains the option characters to be<br \/>\nrecognized; if a character is followed by a colon, the option<br \/>\nis expected to have an argument, which should be separated<br \/>\nfrom it by white space.\u00a0 The colon and question mark<br \/>\ncharacters may not be used as option characters.\u00a0 Each time it<br \/>\nis invoked, getopts places the next option in the shell<br \/>\nvariable name, initializing name if it does not exist, and the<br \/>\nindex of the next argument to be processed into the variable<br \/>\nOPTIND.\u00a0 OPTIND is initialized to 1 each time the shell or a<br \/>\nshell script is invoked.\u00a0 When an option requires an argument,<br \/>\ngetopts places that argument into the variable OPTARG.\u00a0 The<br \/>\nshell does not reset OPTIND automatically; it must be manually<br \/>\nreset between multiple calls to getopts within the same shell<br \/>\ninvocation if a new set of parameters is to be used.<\/p>\n<p>When the end of options is encountered, getopts exits with a<br \/>\nreturn value greater than zero.\u00a0 OPTIND is set to the index of<br \/>\nthe first non-option argument, and name is set to ?.<\/p>\n<p>getopts normally parses the positional parameters, but if more<br \/>\narguments are given in args, getopts parses those instead.<\/p>\n<p>getopts can report errors in two ways.\u00a0 If the first character<br \/>\nof optstring is a colon, silent error reporting is used.\u00a0 In<br \/>\nnormal operation, diagnostic messages are printed when invalid<br \/>\noptions or missing option arguments are encountered.\u00a0 If the<br \/>\nvariable OPTERR is set to 0, no error messages will be<br \/>\ndisplayed, even if the first character of optstring is not a<br \/>\ncolon.<\/p>\n<p>If an invalid option is seen, getopts places ? into name and,<br \/>\nif not silent, prints an error message and unsets OPTARG.\u00a0 If<br \/>\ngetopts is silent, the option character found is placed in<br \/>\nOPTARG and no diagnostic message is printed.<\/p>\n<p>If a required argument is not found, and getopts is not<br \/>\nsilent, a question mark (?) is placed in name, OPTARG is<br \/>\nunset, and a diagnostic message is printed.\u00a0 If getopts is<br \/>\nsilent, then a colon (:) is placed in name and OPTARG is set<br \/>\nto the option character found.<\/p>\n<p>getopts returns true if an option, specified or unspecified,<br \/>\nis found.\u00a0 It returns false if the end of options is<br \/>\nencountered or an error occurs.<\/p>\n<p>hash [-lr] [-p filename] [-dt] [name]<br \/>\nEach time hash is invoked, the full pathname of the command<br \/>\nname is determined by searching the directories in $PATH and<br \/>\nremembered.\u00a0 Any previously-remembered pathname is discarded.<br \/>\nIf the -p option is supplied, no path search is performed, and<br \/>\nfilename is used as the full filename of the command.\u00a0 The -r<br \/>\noption causes the shell to forget all remembered locations.<br \/>\nThe -d option causes the shell to forget the remembered<br \/>\nlocation of each name.\u00a0 If the -t option is supplied, the full<br \/>\npathname to which each name corresponds is printed.\u00a0 If<br \/>\nmultiple name arguments are supplied with -t, the name is<br \/>\nprinted before the hashed full pathname.\u00a0 The -l option causes<br \/>\noutput to be displayed in a format that may be reused as<br \/>\ninput.\u00a0 If no arguments are given, or if only -l is supplied,<br \/>\ninformation about remembered commands is printed.\u00a0 The return<br \/>\nstatus is true unless a name is not found or an invalid option<br \/>\nis supplied.<\/p>\n<p>help [-dms] [pattern]<br \/>\nDisplay helpful information about builtin commands.\u00a0 If<br \/>\npattern is specified, help gives detailed help on all commands<br \/>\nmatching pattern; otherwise help for all the builtins and<br \/>\nshell control structures is printed.<br \/>\n-d\u00a0\u00a0\u00a0\u00a0 Display a short description of each pattern<br \/>\n-m\u00a0\u00a0\u00a0\u00a0 Display the description of each pattern in a manpage-<br \/>\nlike format<br \/>\n-s\u00a0\u00a0\u00a0\u00a0 Display only a short usage synopsis for each pattern<\/p>\n<p>The return status is 0 unless no command matches pattern.<\/p>\n<p>history [n]<br \/>\nhistory -c<br \/>\nhistory -d offset<br \/>\nhistory -anrw [filename]<br \/>\nhistory -p arg [arg &#8230;]<br \/>\nhistory -s arg [arg &#8230;]<br \/>\nWith no options, display the command history list with line<br \/>\nnumbers.\u00a0 Lines listed with a * have been modified.\u00a0 An<br \/>\nargument of n lists only the last n lines.\u00a0 If the shell<br \/>\nvariable HISTTIMEFORMAT is set and not null, it is used as a<br \/>\nformat string for strftime(3) to display the time stamp<br \/>\nassociated with each displayed history entry.\u00a0 No intervening<br \/>\nblank is printed between the formatted time stamp and the<br \/>\nhistory line.\u00a0 If filename is supplied, it is used as the name<br \/>\nof the history file; if not, the value of HISTFILE is used.<br \/>\nOptions, if supplied, have the following meanings:<br \/>\n-c\u00a0\u00a0\u00a0\u00a0 Clear the history list by deleting all the entries.<br \/>\n-d offset<br \/>\nDelete the history entry at position offset.<br \/>\n-a\u00a0\u00a0\u00a0\u00a0 Append the &#8220;new&#8221; history lines (history lines entered<br \/>\nsince the beginning of the current bash session) to the<br \/>\nhistory file.<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 Read the history lines not already read from the<br \/>\nhistory file into the current history list.\u00a0 These are<br \/>\nlines appended to the history file since the beginning<br \/>\nof the current bash session.<br \/>\n-r\u00a0\u00a0\u00a0\u00a0 Read the contents of the history file and append them<br \/>\nto the current history list.<br \/>\n-w\u00a0\u00a0\u00a0\u00a0 Write the current history list to the history file,<br \/>\noverwriting the history file&#8217;s contents.<br \/>\n-p\u00a0\u00a0\u00a0\u00a0 Perform history substitution on the following args and<br \/>\ndisplay the result on the standard output.\u00a0 Does not<br \/>\nstore the results in the history list.\u00a0 Each arg must<br \/>\nbe quoted to disable normal history expansion.<br \/>\n-s\u00a0\u00a0\u00a0\u00a0 Store the args in the history list as a single entry.<br \/>\nThe last command in the history list is removed before<br \/>\nthe args are added.<\/p>\n<p>If the HISTTIMEFORMAT variable is set, the time stamp<br \/>\ninformation associated with each history entry is written to<br \/>\nthe history file, marked with the history comment character.<br \/>\nWhen the history file is read, lines beginning with the<br \/>\nhistory comment character followed immediately by a digit are<br \/>\ninterpreted as timestamps for the previous history line.\u00a0 The<br \/>\nreturn value is 0 unless an invalid option is encountered, an<br \/>\nerror occurs while reading or writing the history file, an<br \/>\ninvalid offset is supplied as an argument to -d, or the<br \/>\nhistory expansion supplied as an argument to -p fails.<\/p>\n<p>jobs [-lnprs] [ jobspec &#8230; ]<br \/>\njobs -x command [ args &#8230; ]<br \/>\nThe first form lists the active jobs.\u00a0 The options have the<br \/>\nfollowing meanings:<br \/>\n-l\u00a0\u00a0\u00a0\u00a0 List process IDs in addition to the normal information.<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 Display information only about jobs that have changed<br \/>\nstatus since the user was last notified of their<br \/>\nstatus.<br \/>\n-p\u00a0\u00a0\u00a0\u00a0 List only the process ID of the job&#8217;s process group<br \/>\nleader.<br \/>\n-r\u00a0\u00a0\u00a0\u00a0 Display only running jobs.<br \/>\n-s\u00a0\u00a0\u00a0\u00a0 Display only stopped jobs.<\/p>\n<p>If jobspec is given, output is restricted to information about<br \/>\nthat job.\u00a0 The return status is 0 unless an invalid option is<br \/>\nencountered or an invalid jobspec is supplied.<\/p>\n<p>If the -x option is supplied, jobs replaces any jobspec found<br \/>\nin command or args with the corresponding process group ID,<br \/>\nand executes command passing it args, returning its exit<br \/>\nstatus.<\/p>\n<p>kill [-s sigspec | -n signum | -sigspec] [pid | jobspec] &#8230;<br \/>\nkill -l [sigspec | exit_status]<br \/>\nSend the signal named by sigspec or signum to the processes<br \/>\nnamed by pid or jobspec.\u00a0 sigspec is either a case-insensitive<br \/>\nsignal name such as SIGKILL (with or without the SIG prefix)<br \/>\nor a signal number; signum is a signal number.\u00a0 If sigspec is<br \/>\nnot present, then SIGTERM is assumed.\u00a0 An argument of -l lists<br \/>\nthe signal names.\u00a0 If any arguments are supplied when -l is<br \/>\ngiven, the names of the signals corresponding to the arguments<br \/>\nare listed, and the return status is 0.\u00a0 The exit_status<br \/>\nargument to -l is a number specifying either a signal number<br \/>\nor the exit status of a process terminated by a signal.\u00a0 kill<br \/>\nreturns true if at least one signal was successfully sent, or<br \/>\nfalse if an error occurs or an invalid option is encountered.<\/p>\n<p>let arg [arg &#8230;]<br \/>\nEach arg is an arithmetic expression to be evaluated (see<br \/>\nARITHMETIC EVALUATION above).\u00a0 If the last arg evaluates to 0,<br \/>\nlet returns 1; 0 is returned otherwise.<\/p>\n<p>local [option] [name[=value] &#8230;]<br \/>\nFor each argument, a local variable named name is created, and<br \/>\nassigned value.\u00a0 The option can be any of the options accepted<br \/>\nby declare.\u00a0 When local is used within a function, it causes<br \/>\nthe variable name to have a visible scope restricted to that<br \/>\nfunction and its children.\u00a0 With no operands, local writes a<br \/>\nlist of local variables to the standard output.\u00a0 It is an<br \/>\nerror to use local when not within a function.\u00a0 The return<br \/>\nstatus is 0 unless local is used outside a function, an<br \/>\ninvalid name is supplied, or name is a readonly variable.<\/p>\n<p>logout Exit a login shell.<\/p>\n<p>mapfile [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback]<br \/>\n[-c quantum] [array]<br \/>\nreadarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C<br \/>\ncallback] [-c quantum] [array]<br \/>\nRead lines from the standard input into the indexed array<br \/>\nvariable array, or from file descriptor fd if the -u option is<br \/>\nsupplied.\u00a0 The variable MAPFILE is the default array.<br \/>\nOptions, if supplied, have the following meanings:<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 Copy at most count lines.\u00a0 If count is 0, all lines are<br \/>\ncopied.<br \/>\n-O\u00a0\u00a0\u00a0\u00a0 Begin assigning to array at index origin.\u00a0 The default<br \/>\nindex is 0.<br \/>\n-s\u00a0\u00a0\u00a0\u00a0 Discard the first count lines read.<br \/>\n-t\u00a0\u00a0\u00a0\u00a0 Remove a trailing newline from each line read.<br \/>\n-u\u00a0\u00a0\u00a0\u00a0 Read lines from file descriptor fd instead of the<br \/>\nstandard input.<br \/>\n-C\u00a0\u00a0\u00a0\u00a0 Evaluate callback each time quantum lines are read.<br \/>\nThe -c option specifies quantum.<br \/>\n-c\u00a0\u00a0\u00a0\u00a0 Specify the number of lines read between each call to<br \/>\ncallback.<\/p>\n<p>If -C is specified without -c, the default quantum is 5000.<br \/>\nWhen callback is evaluated, it is supplied the index of the<br \/>\nnext array element to be assigned and the line to be assigned<br \/>\nto that element as additional arguments.\u00a0 callback is<br \/>\nevaluated after the line is read but before the array element<br \/>\nis assigned.<\/p>\n<p>If not supplied with an explicit origin, mapfile will clear<br \/>\narray before assigning to it.<\/p>\n<p>mapfile returns successfully unless an invalid option or<br \/>\noption argument is supplied, array is invalid or unassignable,<br \/>\nor if array is not an indexed array.<\/p>\n<p>popd [-n] [+n] [-n]<br \/>\nRemoves entries from the directory stack.\u00a0 With no arguments,<br \/>\nremoves the top directory from the stack, and performs a cd to<br \/>\nthe new top directory.\u00a0 Arguments, if supplied, have the<br \/>\nfollowing meanings:<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 Suppresses the normal change of directory when removing<br \/>\ndirectories from the stack, so that only the stack is<br \/>\nmanipulated.<br \/>\n+n\u00a0\u00a0\u00a0\u00a0 Removes the nth entry counting from the left of the<br \/>\nlist shown by dirs, starting with zero.\u00a0 For example:<br \/>\n&#8220;popd +0&#8221; removes the first directory, &#8220;popd +1&#8221;<br \/>\nthe second.<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 Removes the nth entry counting from the right of the<br \/>\nlist shown by dirs, starting with zero.\u00a0 For example:<br \/>\n&#8220;popd -0&#8221; removes the last directory, &#8220;popd -1&#8221; the<br \/>\nnext to last.<\/p>\n<p>If the popd command is successful, a dirs is performed as<br \/>\nwell, and the return status is 0.\u00a0 popd returns false if an<br \/>\ninvalid option is encountered, the directory stack is empty, a<br \/>\nnon-existent directory stack entry is specified, or the<br \/>\ndirectory change fails.<\/p>\n<p>printf [-v var] format [arguments]<br \/>\nWrite the formatted arguments to the standard output under the<br \/>\ncontrol of the format.\u00a0 The -v option causes the output to be<br \/>\nassigned to the variable var rather than being printed to the<br \/>\nstandard output.<\/p>\n<p>The format is a character string which contains three types of<br \/>\nobjects: plain characters, which are simply copied to standard<br \/>\noutput, character escape sequences, which are converted and<br \/>\ncopied to the standard output, and format specifications, each<br \/>\nof which causes printing of the next successive argument.\u00a0 In<br \/>\naddition to the standard printf(1) format specifications,<br \/>\nprintf interprets the following extensions:<br \/>\n%b\u00a0\u00a0\u00a0\u00a0 causes printf to expand backslash escape sequences in<br \/>\nthe corresponding argument (except that \\c terminates<br \/>\noutput, backslashes in \\&#8217;, \\&#8221;, and \\? are not removed,<br \/>\nand octal escapes beginning with \\0 may contain up to<br \/>\nfour digits).<br \/>\n%q\u00a0\u00a0\u00a0\u00a0 causes printf to output the corresponding argument in a<br \/>\nformat that can be reused as shell input.<br \/>\n%(datefmt)T<br \/>\ncauses printf to output the date-time string resulting<br \/>\nfrom using datefmt as a format string for strftime(3).<br \/>\nThe corresponding argument is an integer representing<br \/>\nthe number of seconds since the epoch.\u00a0 Two special<br \/>\nargument values may be used: -1 represents the current<br \/>\ntime, and -2 represents the time the shell was invoked.<br \/>\nIf no argument is specified, conversion behaves as if<br \/>\n-1 had been given.\u00a0 This is an exception to the usual<br \/>\nprintf behavior.<\/p>\n<p>Arguments to non-string format specifiers are treated as C<br \/>\nconstants, except that a leading plus or minus sign is<br \/>\nallowed, and if the leading character is a single or double<br \/>\nquote, the value is the ASCII value of the following<br \/>\ncharacter.<\/p>\n<p>The format is reused as necessary to consume all of the<br \/>\narguments.\u00a0 If the format requires more arguments than are<br \/>\nsupplied, the extra format specifications behave as if a zero<br \/>\nvalue or null string, as appropriate, had been supplied.\u00a0 The<br \/>\nreturn value is zero on success, non-zero on failure.<\/p>\n<p>pushd [-n] [+n] [-n]<br \/>\npushd [-n] [dir]<br \/>\nAdds a directory to the top of the directory stack, or rotates<br \/>\nthe stack, making the new top of the stack the current working<br \/>\ndirectory.\u00a0 With no arguments, exchanges the top two<br \/>\ndirectories and returns 0, unless the directory stack is<br \/>\nempty.\u00a0 Arguments, if supplied, have the following meanings:<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 Suppresses the normal change of directory when adding<br \/>\ndirectories to the stack, so that only the stack is<br \/>\nmanipulated.<br \/>\n+n\u00a0\u00a0\u00a0\u00a0 Rotates the stack so that the nth directory (counting<br \/>\nfrom the left of the list shown by dirs, starting with<br \/>\nzero) is at the top.<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 Rotates the stack so that the nth directory (counting<br \/>\nfrom the right of the list shown by dirs, starting with<br \/>\nzero) is at the top.<br \/>\ndir\u00a0\u00a0\u00a0 Adds dir to the directory stack at the top, making it<br \/>\nthe new current working directory as if it had been<br \/>\nsupplied as the argument to the cd builtin.<\/p>\n<p>If the pushd command is successful, a dirs is performed as<br \/>\nwell.\u00a0 If the first form is used, pushd returns 0 unless the<br \/>\ncd to dir fails.\u00a0 With the second form, pushd returns 0 unless<br \/>\nthe directory stack is empty, a non-existent directory stack<br \/>\nelement is specified, or the directory change to the specified<br \/>\nnew current directory fails.<\/p>\n<p>pwd [-LP]<br \/>\nPrint the absolute pathname of the current working directory.<br \/>\nThe pathname printed contains no symbolic links if the -P<br \/>\noption is supplied or the -o physical option to the set<br \/>\nbuiltin command is enabled.\u00a0 If the -L option is used, the<br \/>\npathname printed may contain symbolic links.\u00a0 The return<br \/>\nstatus is 0 unless an error occurs while reading the name of<br \/>\nthe current directory or an invalid option is supplied.<\/p>\n<p>read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars]<br \/>\n[-p prompt] [-t timeout] [-u fd] [name &#8230;]<br \/>\nOne line is read from the standard input, or from the file<br \/>\ndescriptor fd supplied as an argument to the -u option, and<br \/>\nthe first word is assigned to the first name, the second word<br \/>\nto the second name, and so on, with leftover words and their<br \/>\nintervening separators assigned to the last name.\u00a0 If there<br \/>\nare fewer words read from the input stream than names, the<br \/>\nremaining names are assigned empty values.\u00a0 The characters in<br \/>\nIFS are used to split the line into words using the same rules<br \/>\nthe shell uses for expansion (described above under Word<br \/>\nSplitting).\u00a0 The backslash character (\\) may be used to remove<br \/>\nany special meaning for the next character read and for line<br \/>\ncontinuation.\u00a0 Options, if supplied, have the following<br \/>\nmeanings:<br \/>\n-a aname<br \/>\nThe words are assigned to sequential indices of the<br \/>\narray variable aname, starting at 0.\u00a0 aname is unset<br \/>\nbefore any new values are assigned.\u00a0 Other name<br \/>\narguments are ignored.<br \/>\n-d delim<br \/>\nThe first character of delim is used to terminate the<br \/>\ninput line, rather than newline.<br \/>\n-e\u00a0\u00a0\u00a0\u00a0 If the standard input is coming from a terminal,<br \/>\nreadline (see READLINE above) is used to obtain the<br \/>\nline.\u00a0 Readline uses the current (or default, if line<br \/>\nediting was not previously active) editing settings.<br \/>\n-i text<br \/>\nIf readline is being used to read the line, text is<br \/>\nplaced into the editing buffer before editing begins.<br \/>\n-n nchars<br \/>\nread returns after reading nchars characters rather<br \/>\nthan waiting for a complete line of input, but honor a<br \/>\ndelimiter if fewer than nchars characters are read<br \/>\nbefore the delimiter.<br \/>\n-N nchars<br \/>\nread returns after reading exactly nchars characters<br \/>\nrather than waiting for a complete line of input,<br \/>\nunless EOF is encountered or read times out.\u00a0 Delimiter<br \/>\ncharacters encountered in the input are not treated<br \/>\nspecially and do not cause read to return until nchars<br \/>\ncharacters are read.<br \/>\n-p prompt<br \/>\nDisplay prompt on standard error, without a trailing<br \/>\nnewline, before attempting to read any input.\u00a0 The<br \/>\nprompt is displayed only if input is coming from a<br \/>\nterminal.<br \/>\n-r\u00a0\u00a0\u00a0\u00a0 Backslash does not act as an escape character.\u00a0 The<br \/>\nbackslash is considered to be part of the line.\u00a0 In<br \/>\nparticular, a backslash-newline pair may not be used as<br \/>\na line continuation.<br \/>\n-s\u00a0\u00a0\u00a0\u00a0 Silent mode.\u00a0 If input is coming from a terminal,<br \/>\ncharacters are not echoed.<br \/>\n-t timeout<br \/>\nCause read to time out and return failure if a complete<br \/>\nline of input (or a specified number of characters) is<br \/>\nnot read within timeout seconds.\u00a0 timeout may be a<br \/>\ndecimal number with a fractional portion following the<br \/>\ndecimal point.\u00a0 This option is only effective if read<br \/>\nis reading input from a terminal, pipe, or other<br \/>\nspecial file; it has no effect when reading from<br \/>\nregular files.\u00a0 If read times out, read saves any<br \/>\npartial input read into the specified variable name.<br \/>\nIf timeout is 0, read returns immediately, without<br \/>\ntrying to read any data.\u00a0 The exit status is 0 if input<br \/>\nis available on the specified file descriptor, non-zero<br \/>\notherwise.\u00a0 The exit status is greater than 128 if the<br \/>\ntimeout is exceeded.<br \/>\n-u fd\u00a0 Read input from file descriptor fd.<\/p>\n<p>If no names are supplied, the line read is assigned to the<br \/>\nvariable REPLY.\u00a0 The return code is zero, unless end-of-file<br \/>\nis encountered, read times out (in which case the return code<br \/>\nis greater than 128), a variable assignment error (such as<br \/>\nassigning to a readonly variable) occurs, or an invalid file<br \/>\ndescriptor is supplied as the argument to -u.<\/p>\n<p>readonly [-aAf] [-p] [name[=word] &#8230;]<br \/>\nThe given names are marked readonly; the values of these names<br \/>\nmay not be changed by subsequent assignment.\u00a0 If the -f option<br \/>\nis supplied, the functions corresponding to the names are so<br \/>\nmarked.\u00a0 The -a option restricts the variables to indexed<br \/>\narrays; the -A option restricts the variables to associative<br \/>\narrays.\u00a0 If both options are supplied, -A takes precedence.<br \/>\nIf no name arguments are given, or if the -p option is<br \/>\nsupplied, a list of all readonly names is printed.\u00a0 The other<br \/>\noptions may be used to restrict the output to a subset of the<br \/>\nset of readonly names.\u00a0 The -p option causes output to be<br \/>\ndisplayed in a format that may be reused as input.\u00a0 If a<br \/>\nvariable name is followed by =word, the value of the variable<br \/>\nis set to word.\u00a0 The return status is 0 unless an invalid<br \/>\noption is encountered, one of the names is not a valid shell<br \/>\nvariable name, or -f is supplied with a name that is not a<br \/>\nfunction.<\/p>\n<p>return [n]<br \/>\nCauses a function to stop executing and return the value<br \/>\nspecified by n to its caller.\u00a0 If n is omitted, the return<br \/>\nstatus is that of the last command executed in the function<br \/>\nbody.\u00a0 If return is used outside a function, but during<br \/>\nexecution of a script by the .\u00a0 (source) command, it causes<br \/>\nthe shell to stop executing that script and return either n or<br \/>\nthe exit status of the last command executed within the script<br \/>\nas the exit status of the script.\u00a0 If n is supplied, the<br \/>\nreturn value is its least significant 8 bits.\u00a0 The return<br \/>\nstatus is non-zero if return is supplied a non-numeric<br \/>\nargument, or is used outside a function and not during<br \/>\nexecution of a script by . or source.\u00a0 Any command associated<br \/>\nwith the RETURN trap is executed before execution resumes<br \/>\nafter the function or script.<\/p>\n<p>set [&#8211;abefhkmnptuvxBCEHPT] [-o option-name] [arg &#8230;]<br \/>\nset [+abefhkmnptuvxBCEHPT] [+o option-name] [arg &#8230;]<br \/>\nWithout options, the name and value of each shell variable are<br \/>\ndisplayed in a format that can be reused as input for setting<br \/>\nor resetting the currently-set variables.\u00a0 Read-only variables<br \/>\ncannot be reset.\u00a0 In posix mode, only shell variables are<br \/>\nlisted.\u00a0 The output is sorted according to the current locale.<br \/>\nWhen options are specified, they set or unset shell<br \/>\nattributes.\u00a0 Any arguments remaining after option processing<br \/>\nare treated as values for the positional parameters and are<br \/>\nassigned, in order, to $1, $2, &#8230;\u00a0 $n.\u00a0 Options, if<br \/>\nspecified, have the following meanings:<br \/>\n-a\u00a0\u00a0\u00a0\u00a0\u00a0 Automatically mark variables and functions which are<br \/>\nmodified or created for export to the environment of<br \/>\nsubsequent commands.<br \/>\n-b\u00a0\u00a0\u00a0\u00a0\u00a0 Report the status of terminated background jobs<br \/>\nimmediately, rather than before the next primary<br \/>\nprompt.\u00a0 This is effective only when job control is<br \/>\nenabled.<br \/>\n-e\u00a0\u00a0\u00a0\u00a0\u00a0 Exit immediately if a pipeline (which may consist of a<br \/>\nsingle simple command), a list, or a compound command<br \/>\n(see SHELL GRAMMAR above),\u00a0 exits with a non-zero<br \/>\nstatus.\u00a0 The shell does not exit if the command that<br \/>\nfails is part of the command list immediately<br \/>\nfollowing a while or until keyword, part of the test<br \/>\nfollowing the if or elif reserved words, part of any<br \/>\ncommand executed in a &amp;&amp; or || list except the command<br \/>\nfollowing the final &amp;&amp; or ||, any command in a<br \/>\npipeline but the last, or if the command&#8217;s return<br \/>\nvalue is being inverted with !.\u00a0 If a compound command<br \/>\nother than a subshell returns a non-zero status<br \/>\nbecause a command failed while -e was being ignored,<br \/>\nthe shell does not exit.\u00a0 A trap on ERR, if set, is<br \/>\nexecuted before the shell exits.\u00a0 This option applies<br \/>\nto the shell environment and each subshell environment<br \/>\nseparately (see COMMAND EXECUTION ENVIRONMENT above),<br \/>\nand may cause subshells to exit before executing all<br \/>\nthe commands in the subshell.<\/p>\n<p>If a compound command or shell function executes in a<br \/>\ncontext where -e is being ignored, none of the<br \/>\ncommands executed within the compound command or<br \/>\nfunction body will be affected by the -e setting, even<br \/>\nif -e is set and a command returns a failure status.<br \/>\nIf a compound command or shell function sets -e while<br \/>\nexecuting in a context where -e is ignored, that<br \/>\nsetting will not have any effect until the compound<br \/>\ncommand or the command containing the function call<br \/>\ncompletes.<br \/>\n-f\u00a0\u00a0\u00a0\u00a0\u00a0 Disable pathname expansion.<br \/>\n-h\u00a0\u00a0\u00a0\u00a0\u00a0 Remember the location of commands as they are looked<br \/>\nup for execution.\u00a0 This is enabled by default.<br \/>\n-k\u00a0\u00a0\u00a0\u00a0\u00a0 All arguments in the form of assignment statements are<br \/>\nplaced in the environment for a command, not just<br \/>\nthose that precede the command name.<br \/>\n-m\u00a0\u00a0\u00a0\u00a0\u00a0 Monitor mode.\u00a0 Job control is enabled.\u00a0 This option is<br \/>\non by default for interactive shells on systems that<br \/>\nsupport it (see JOB CONTROL above).\u00a0 All processes run<br \/>\nin a separate process group.\u00a0 When a background job<br \/>\ncompletes, the shell prints a line containing its exit<br \/>\nstatus.<br \/>\n-n\u00a0\u00a0\u00a0\u00a0\u00a0 Read commands but do not execute them.\u00a0 This may be<br \/>\nused to check a shell script for syntax errors.\u00a0 This<br \/>\nis ignored by interactive shells.<br \/>\n-o option-name<br \/>\nThe option-name can be one of the following:<br \/>\nallexport<br \/>\nSame as -a.<br \/>\nbraceexpand<br \/>\nSame as -B.<br \/>\nemacs\u00a0\u00a0 Use an emacs-style command line editing<br \/>\ninterface.\u00a0 This is enabled by default when<br \/>\nthe shell is interactive, unless the shell is<br \/>\nstarted with the &#8211;noediting option.\u00a0 This<br \/>\nalso affects the editing interface used for<br \/>\nread -e.<br \/>\nerrexit Same as -e.<br \/>\nerrtrace<br \/>\nSame as -E.<br \/>\nfunctrace<br \/>\nSame as -T.<br \/>\nhashall Same as -h.<br \/>\nhistexpand<br \/>\nSame as -H.<br \/>\nhistory Enable command history, as described above<br \/>\nunder HISTORY.\u00a0 This option is on by default<br \/>\nin interactive shells.<br \/>\nignoreeof<br \/>\nThe effect is as if the shell command<br \/>\n&#8220;IGNOREEOF=10&#8221; had been executed (see Shell<br \/>\nVariables above).<br \/>\nkeyword Same as -k.<br \/>\nmonitor Same as -m.<br \/>\nnoclobber<br \/>\nSame as -C.<br \/>\nnoexec\u00a0 Same as -n.<br \/>\nnoglob\u00a0 Same as -f.<br \/>\nnolog\u00a0\u00a0 Currently ignored.<br \/>\nnotify\u00a0 Same as -b.<br \/>\nnounset Same as -u.<br \/>\nonecmd\u00a0 Same as -t.<br \/>\nphysical<br \/>\nSame as -P.<br \/>\npipefail<br \/>\nIf set, the return value of a pipeline is the<br \/>\nvalue of the last (rightmost) command to exit<br \/>\nwith a non-zero status, or zero if all<br \/>\ncommands in the pipeline exit successfully.<br \/>\nThis option is disabled by default.<br \/>\nposix\u00a0\u00a0 Change the behavior of bash where the default<br \/>\noperation differs from the POSIX standard to<br \/>\nmatch the standard (posix mode).\u00a0 See SEE ALSO<br \/>\nbelow for a reference to a document that<br \/>\ndetails how posix mode affects bash&#8217;s<br \/>\nbehavior.<br \/>\nprivileged<br \/>\nSame as -p.<br \/>\nverbose Same as -v.<br \/>\nvi\u00a0\u00a0\u00a0\u00a0\u00a0 Use a vi-style command line editing interface.<br \/>\nThis also affects the editing interface used<br \/>\nfor read -e.<br \/>\nxtrace\u00a0 Same as -x.<br \/>\nIf -o is supplied with no option-name, the values of<br \/>\nthe current options are printed.\u00a0 If +o is supplied<br \/>\nwith no option-name, a series of set commands to<br \/>\nrecreate the current option settings is displayed on<br \/>\nthe standard output.<br \/>\n-p\u00a0\u00a0\u00a0\u00a0\u00a0 Turn on privileged mode.\u00a0 In this mode, the $ENV and<br \/>\n$BASH_ENV files are not processed, shell functions are<br \/>\nnot inherited from the environment, and the SHELLOPTS,<br \/>\nBASHOPTS, CDPATH, and GLOBIGNORE variables, if they<br \/>\nappear in the environment, are ignored.\u00a0 If the shell<br \/>\nis started with the effective user (group) id not<br \/>\nequal to the real user (group) id, and the -p option<br \/>\nis not supplied, these actions are taken and the<br \/>\neffective user id is set to the real user id.\u00a0 If the<br \/>\n-p option is supplied at startup, the effective user<br \/>\nid is not reset.\u00a0 Turning this option off causes the<br \/>\neffective user and group ids to be set to the real<br \/>\nuser and group ids.<br \/>\n-t\u00a0\u00a0\u00a0\u00a0\u00a0 Exit after reading and executing one command.<br \/>\n-u\u00a0\u00a0\u00a0\u00a0\u00a0 Treat unset variables and parameters other than the<br \/>\nspecial parameters &#8220;@&#8221; and &#8220;*&#8221; as an error when<br \/>\nperforming parameter expansion.\u00a0 If expansion is<br \/>\nattempted on an unset variable or parameter, the shell<br \/>\nprints an error message, and, if not interactive,<br \/>\nexits with a non-zero status.<br \/>\n-v\u00a0\u00a0\u00a0\u00a0\u00a0 Print shell input lines as they are read.<br \/>\n-x\u00a0\u00a0\u00a0\u00a0\u00a0 After expanding each simple command, for command, case<br \/>\ncommand, select command, or arithmetic for command,<br \/>\ndisplay the expanded value of PS4, followed by the<br \/>\ncommand and its expanded arguments or associated word<br \/>\nlist.<br \/>\n-B\u00a0\u00a0\u00a0\u00a0\u00a0 The shell performs brace expansion (see Brace<br \/>\nExpansion above).\u00a0 This is on by default.<br \/>\n-C\u00a0\u00a0\u00a0\u00a0\u00a0 If set, bash does not overwrite an existing file with<br \/>\nthe &gt;, &gt;&amp;, and &lt;&gt; redirection operators.\u00a0 This may be<br \/>\noverridden when creating output files by using the<br \/>\nredirection operator &gt;| instead of &gt;.<br \/>\n-E\u00a0\u00a0\u00a0\u00a0\u00a0 If set, any trap on ERR is inherited by shell<br \/>\nfunctions, command substitutions, and commands<br \/>\nexecuted in a subshell environment.\u00a0 The ERR trap is<br \/>\nnormally not inherited in such cases.<br \/>\n-H\u00a0\u00a0\u00a0\u00a0\u00a0 Enable !\u00a0 style history substitution.\u00a0 This option is<br \/>\non by default when the shell is interactive.<br \/>\n-P\u00a0\u00a0\u00a0\u00a0\u00a0 If set, the shell does not resolve symbolic links when<br \/>\nexecuting commands such as cd that change the current<br \/>\nworking directory.\u00a0 It uses the physical directory<br \/>\nstructure instead.\u00a0 By default, bash follows the<br \/>\nlogical chain of directories when performing commands<br \/>\nwhich change the current directory.<br \/>\n-T\u00a0\u00a0\u00a0\u00a0\u00a0 If set, any traps on DEBUG and RETURN are inherited by<br \/>\nshell functions, command substitutions, and commands<br \/>\nexecuted in a subshell environment.\u00a0 The DEBUG and<br \/>\nRETURN traps are normally not inherited in such cases.<br \/>\n&#8212;\u00a0\u00a0\u00a0\u00a0\u00a0 If no arguments follow this option, then the<br \/>\npositional parameters are unset.\u00a0 Otherwise, the<br \/>\npositional parameters are set to the args, even if<br \/>\nsome of them begin with a -.<br \/>\n&#8211;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Signal the end of options, cause all remaining args to<br \/>\nbe assigned to the positional parameters.\u00a0 The -x and<br \/>\n-v options are turned off.\u00a0 If there are no args, the<br \/>\npositional parameters remain unchanged.<\/p>\n<p>The options are off by default unless otherwise noted.\u00a0 Using<br \/>\n+ rather than &#8211; causes these options to be turned off.\u00a0 The<br \/>\noptions can also be specified as arguments to an invocation of<br \/>\nthe shell.\u00a0 The current set of options may be found in $-.<br \/>\nThe return status is always true unless an invalid option is<br \/>\nencountered.<\/p>\n<p>shift [n]<br \/>\nThe positional parameters from n+1 &#8230; are renamed to $1 &#8230;.<br \/>\nParameters represented by the numbers $# down to $#-n+1 are<br \/>\nunset.\u00a0 n must be a non-negative number less than or equal to<br \/>\n$#.\u00a0 If n is 0, no parameters are changed.\u00a0 If n is not given,<br \/>\nit is assumed to be 1.\u00a0 If n is greater than $#, the<br \/>\npositional parameters are not changed.\u00a0 The return status is<br \/>\ngreater than zero if n is greater than $# or less than zero;<br \/>\notherwise 0.<\/p>\n<p>shopt [-pqsu] [-o] [optname &#8230;]<br \/>\nToggle the values of settings controlling optional shell<br \/>\nbehavior.\u00a0 The settings can be either those listed below, or,<br \/>\nif the -o option is used, those available with the -o option<br \/>\nto the set builtin command.\u00a0 With no options, or with the -p<br \/>\noption, a list of all settable options is displayed, with an<br \/>\nindication of whether or not each is set.\u00a0 The -p option<br \/>\ncauses output to be displayed in a form that may be reused as<br \/>\ninput.\u00a0 Other options have the following meanings:<br \/>\n-s\u00a0\u00a0\u00a0\u00a0 Enable (set) each optname.<br \/>\n-u\u00a0\u00a0\u00a0\u00a0 Disable (unset) each optname.<br \/>\n-q\u00a0\u00a0\u00a0\u00a0 Suppresses normal output (quiet mode); the return<br \/>\nstatus indicates whether the optname is set or unset.<br \/>\nIf multiple optname arguments are given with -q, the<br \/>\nreturn status is zero if all optnames are enabled; non-<br \/>\nzero otherwise.<br \/>\n-o\u00a0\u00a0\u00a0\u00a0 Restricts the values of optname to be those defined for<br \/>\nthe -o option to the set builtin.<\/p>\n<p>If either -s or -u is used with no optname arguments, shopt<br \/>\nshows only those options which are set or unset, respectively.<br \/>\nUnless otherwise noted, the shopt options are disabled (unset)<br \/>\nby default.<\/p>\n<p>The return status when listing options is zero if all optnames<br \/>\nare enabled, non-zero otherwise.\u00a0 When setting or unsetting<br \/>\noptions, the return status is zero unless an optname is not a<br \/>\nvalid shell option.<\/p>\n<p>The list of shopt options is:<\/p>\n<p>autocd\u00a0 If set, a command name that is the name of a directory<br \/>\nis executed as if it were the argument to the cd<br \/>\ncommand.\u00a0 This option is only used by interactive<br \/>\nshells.<br \/>\ncdable_vars<br \/>\nIf set, an argument to the cd builtin command that is<br \/>\nnot a directory is assumed to be the name of a<br \/>\nvariable whose value is the directory to change to.<br \/>\ncdspell If set, minor errors in the spelling of a directory<br \/>\ncomponent in a cd command will be corrected.\u00a0 The<br \/>\nerrors checked for are transposed characters, a<br \/>\nmissing character, and one character too many.\u00a0 If a<br \/>\ncorrection is found, the corrected filename is<br \/>\nprinted, and the command proceeds.\u00a0 This option is<br \/>\nonly used by interactive shells.<br \/>\ncheckhash<br \/>\nIf set, bash checks that a command found in the hash<br \/>\ntable exists before trying to execute it.\u00a0 If a hashed<br \/>\ncommand no longer exists, a normal path search is<br \/>\nperformed.<br \/>\ncheckjobs<br \/>\nIf set, bash lists the status of any stopped and<br \/>\nrunning jobs before exiting an interactive shell.\u00a0 If<br \/>\nany jobs are running, this causes the exit to be<br \/>\ndeferred until a second exit is attempted without an<br \/>\nintervening command (see JOB CONTROL above).\u00a0 The<br \/>\nshell always postpones exiting if any jobs are<br \/>\nstopped.<br \/>\ncheckwinsize<br \/>\nIf set, bash checks the window size after each command<br \/>\nand, if necessary, updates the values of LINES and<br \/>\nCOLUMNS.<br \/>\ncmdhist If set, bash attempts to save all lines of a multiple-<br \/>\nline command in the same history entry.\u00a0 This allows<br \/>\neasy re-editing of multi-line commands.<br \/>\ncompat31<br \/>\nIf set, bash changes its behavior to that of version<br \/>\n3.1 with respect to quoted arguments to the [[<br \/>\nconditional command&#8217;s =~ operator and locale-specific<br \/>\nstring comparison when using the [[ conditional<br \/>\ncommand&#8217;s &lt; and &gt; operators.\u00a0 Bash versions prior to<br \/>\nbash-4.1 use ASCII collation and strcmp(3); bash-4.1<br \/>\nand later use the current locale&#8217;s collation sequence<br \/>\nand strcoll(3).<br \/>\ncompat32<br \/>\nIf set, bash changes its behavior to that of version<br \/>\n3.2 with respect to locale-specific string comparison<br \/>\nwhen using the [[ conditional command&#8217;s &lt; and &gt;<br \/>\noperators (see previous item).<br \/>\ncompat40<br \/>\nIf set, bash changes its behavior to that of version<br \/>\n4.0 with respect to locale-specific string comparison<br \/>\nwhen using the [[ conditional command&#8217;s &lt; and &gt;<br \/>\noperators (see description of compat31) and the effect<br \/>\nof interrupting a command list.\u00a0 Bash versions 4.0 and<br \/>\nlater interrupt the list as if the shell received the<br \/>\ninterrupt; previous versions continue with the next<br \/>\ncommand in the list.<br \/>\ncompat41<br \/>\nIf set, bash, when in posix mode, treats a single<br \/>\nquote in a double-quoted parameter expansion as a<br \/>\nspecial character.\u00a0 The single quotes must match (an<br \/>\neven number) and the characters between the single<br \/>\nquotes are considered quoted.\u00a0 This is the behavior of<br \/>\nposix mode through version 4.1.\u00a0 The default bash<br \/>\nbehavior remains as in previous versions.<br \/>\ncompat42<br \/>\nIf set, bash does not process the replacement string<br \/>\nin the pattern substitution word expansion using quote<br \/>\nremoval.<br \/>\ncomplete_fullquote<br \/>\nIf set, bash quotes all shell metacharacters in<br \/>\nfilenames and directory names when performing<br \/>\ncompletion.\u00a0 If not set, bash removes metacharacters<br \/>\nsuch as the dollar sign from the set of characters<br \/>\nthat will be quoted in completed filenames when these<br \/>\nmetacharacters appear in shell variable references in<br \/>\nwords to be completed.\u00a0 This means that dollar signs<br \/>\nin variable names that expand to directories will not<br \/>\nbe quoted; however, any dollar signs appearing in<br \/>\nfilenames will not be quoted, either.\u00a0 This is active<br \/>\nonly when bash is using backslashes to quote completed<br \/>\nfilenames.\u00a0 This variable is set by default, which is<br \/>\nthe default bash behavior in versions through 4.2.<br \/>\ndirexpand<br \/>\nIf set, bash replaces directory names with the results<br \/>\nof word expansion when performing filename completion.<br \/>\nThis changes the contents of the readline editing<br \/>\nbuffer.\u00a0 If not set, bash attempts to preserve what<br \/>\nthe user typed.<br \/>\ndirspell<br \/>\nIf set, bash attempts spelling correction on directory<br \/>\nnames during word completion if the directory name<br \/>\ninitially supplied does not exist.<br \/>\ndotglob If set, bash includes filenames beginning with a `.&#8217;<br \/>\nin the results of pathname expansion.<br \/>\nexecfail<br \/>\nIf set, a non-interactive shell will not exit if it<br \/>\ncannot execute the file specified as an argument to<br \/>\nthe exec builtin command.\u00a0 An interactive shell does<br \/>\nnot exit if exec fails.<br \/>\nexpand_aliases<br \/>\nIf set, aliases are expanded as described above under<br \/>\nALIASES.\u00a0 This option is enabled by default for<br \/>\ninteractive shells.<br \/>\nextdebug<br \/>\nIf set, behavior intended for use by debuggers is<br \/>\nenabled:<br \/>\n1.\u00a0\u00a0\u00a0\u00a0 The -F option to the declare builtin displays<br \/>\nthe source file name and line number<br \/>\ncorresponding to each function name supplied as<br \/>\nan argument.<br \/>\n2.\u00a0\u00a0\u00a0\u00a0 If the command run by the DEBUG trap returns a<br \/>\nnon-zero value, the next command is skipped and<br \/>\nnot executed.<br \/>\n3.\u00a0\u00a0\u00a0\u00a0 If the command run by the DEBUG trap returns a<br \/>\nvalue of 2, and the shell is executing in a<br \/>\nsubroutine (a shell function or a shell script<br \/>\nexecuted by the . or source builtins), a call<br \/>\nto return is simulated.<br \/>\n4.\u00a0\u00a0\u00a0\u00a0 BASH_ARGC and BASH_ARGV are updated as<br \/>\ndescribed in their descriptions above.<br \/>\n5.\u00a0\u00a0\u00a0\u00a0 Function tracing is enabled:\u00a0 command<br \/>\nsubstitution, shell functions, and subshells<br \/>\ninvoked with ( command ) inherit the DEBUG and<br \/>\nRETURN traps.<br \/>\n6.\u00a0\u00a0\u00a0\u00a0 Error tracing is enabled:\u00a0 command<br \/>\nsubstitution, shell functions, and subshells<br \/>\ninvoked with ( command ) inherit the ERR trap.<br \/>\nextglob If set, the extended pattern matching features<br \/>\ndescribed above under Pathname Expansion are enabled.<br \/>\nextquote<br \/>\nIf set, $&#8217;string&#8217; and $&#8221;string&#8221; quoting is performed<br \/>\nwithin ${parameter} expansions enclosed in double<br \/>\nquotes.\u00a0 This option is enabled by default.<br \/>\nfailglob<br \/>\nIf set, patterns which fail to match filenames during<br \/>\npathname expansion result in an expansion error.<br \/>\nforce_fignore<br \/>\nIf set, the suffixes specified by the FIGNORE shell<br \/>\nvariable cause words to be ignored when performing<br \/>\nword completion even if the ignored words are the only<br \/>\npossible completions.\u00a0 See SHELL VARIABLES above for a<br \/>\ndescription of FIGNORE.\u00a0 This option is enabled by<br \/>\ndefault.<br \/>\nglobasciiranges<br \/>\nIf set, range expressions used in pattern matching<br \/>\nbracket expressions (see Pattern Matching above)<br \/>\nbehave as if in the traditional C locale when<br \/>\nperforming comparisons.\u00a0 That is, the current locale&#8217;s<br \/>\ncollating sequence is not taken into account, so b<br \/>\nwill not collate between A and B, and upper-case and<br \/>\nlower-case ASCII characters will collate together.<br \/>\nglobstar<br \/>\nIf set, the pattern ** used in a pathname expansion<br \/>\ncontext will match all files and zero or more<br \/>\ndirectories and subdirectories.\u00a0 If the pattern is<br \/>\nfollowed by a \/, only directories and subdirectories<br \/>\nmatch.<br \/>\ngnu_errfmt<br \/>\nIf set, shell error messages are written in the<br \/>\nstandard GNU error message format.<br \/>\nhistappend<br \/>\nIf set, the history list is appended to the file named<br \/>\nby the value of the HISTFILE variable when the shell<br \/>\nexits, rather than overwriting the file.<br \/>\nhistreedit<br \/>\nIf set, and readline is being used, a user is given<br \/>\nthe opportunity to re-edit a failed history<br \/>\nsubstitution.<br \/>\nhistverify<br \/>\nIf set, and readline is being used, the results of<br \/>\nhistory substitution are not immediately passed to the<br \/>\nshell parser.\u00a0 Instead, the resulting line is loaded<br \/>\ninto the readline editing buffer, allowing further<br \/>\nmodification.<br \/>\nhostcomplete<br \/>\nIf set, and readline is being used, bash will attempt<br \/>\nto perform hostname completion when a word containing<br \/>\na @ is being completed (see Completing under READLINE<br \/>\nabove).\u00a0 This is enabled by default.<br \/>\nhuponexit<br \/>\nIf set, bash will send SIGHUP to all jobs when an<br \/>\ninteractive login shell exits.<br \/>\ninteractive_comments<br \/>\nIf set, allow a word beginning with # to cause that<br \/>\nword and all remaining characters on that line to be<br \/>\nignored in an interactive shell (see COMMENTS above).<br \/>\nThis option is enabled by default.<br \/>\nlastpipe<br \/>\nIf set, and job control is not active, the shell runs<br \/>\nthe last command of a pipeline not executed in the<br \/>\nbackground in the current shell environment.<br \/>\nlithist If set, and the cmdhist option is enabled, multi-line<br \/>\ncommands are saved to the history with embedded<br \/>\nnewlines rather than using semicolon separators where<br \/>\npossible.<br \/>\nlogin_shell<br \/>\nThe shell sets this option if it is started as a login<br \/>\nshell (see INVOCATION above).\u00a0 The value may not be<br \/>\nchanged.<br \/>\nmailwarn<br \/>\nIf set, and a file that bash is checking for mail has<br \/>\nbeen accessed since the last time it was checked, the<br \/>\nmessage &#8220;The mail in mailfile has been read&#8221; is<br \/>\ndisplayed.<br \/>\nno_empty_cmd_completion<br \/>\nIf set, and readline is being used, bash will not<br \/>\nattempt to search the PATH for possible completions<br \/>\nwhen completion is attempted on an empty line.<br \/>\nnocaseglob<br \/>\nIf set, bash matches filenames in a case-insensitive<br \/>\nfashion when performing pathname expansion (see<br \/>\nPathname Expansion above).<br \/>\nnocasematch<br \/>\nIf set, bash matches patterns in a case-insensitive<br \/>\nfashion when performing matching while executing case<br \/>\nor [[ conditional commands.<br \/>\nnullglob<br \/>\nIf set, bash allows patterns which match no files (see<br \/>\nPathname Expansion above) to expand to a null string,<br \/>\nrather than themselves.<br \/>\nprogcomp<br \/>\nIf set, the programmable completion facilities (see<br \/>\nProgrammable Completion above) are enabled.\u00a0 This<br \/>\noption is enabled by default.<br \/>\npromptvars<br \/>\nIf set, prompt strings undergo parameter expansion,<br \/>\ncommand substitution, arithmetic expansion, and quote<br \/>\nremoval after being expanded as described in PROMPTING<br \/>\nabove.\u00a0 This option is enabled by default.<br \/>\nrestricted_shell<br \/>\nThe shell sets this option if it is started in<br \/>\nrestricted mode (see RESTRICTED SHELL below).\u00a0 The<br \/>\nvalue may not be changed.\u00a0 This is not reset when the<br \/>\nstartup files are executed, allowing the startup files<br \/>\nto discover whether or not a shell is restricted.<br \/>\nshift_verbose<br \/>\nIf set, the shift builtin prints an error message when<br \/>\nthe shift count exceeds the number of positional<br \/>\nparameters.<br \/>\nsourcepath<br \/>\nIf set, the source (.) builtin uses the value of PATH<br \/>\nto find the directory containing the file supplied as<br \/>\nan argument.\u00a0 This option is enabled by default.<br \/>\nxpg_echo<br \/>\nIf set, the echo builtin expands backslash-escape<br \/>\nsequences by default.<\/p>\n<p>suspend [-f]<br \/>\nSuspend the execution of this shell until it receives a<br \/>\nSIGCONT signal.\u00a0 A login shell cannot be suspended; the -f<br \/>\noption can be used to override this and force the suspension.<br \/>\nThe return status is 0 unless the shell is a login shell and<br \/>\n-f is not supplied, or if job control is not enabled.<\/p>\n<p>test expr<br \/>\n[ expr ]<br \/>\nReturn a status of 0 (true) or 1 (false) depending on the<br \/>\nevaluation of the conditional expression expr.\u00a0 Each operator<br \/>\nand operand must be a separate argument.\u00a0 Expressions are<br \/>\ncomposed of the primaries described above under CONDITIONAL<br \/>\nEXPRESSIONS.\u00a0 test does not accept any options, nor does it<br \/>\naccept and ignore an argument of &#8212; as signifying the end of<br \/>\noptions.<\/p>\n<p>Expressions may be combined using the following operators,<br \/>\nlisted in decreasing order of precedence.\u00a0 The evaluation<br \/>\ndepends on the number of arguments; see below.\u00a0 Operator<br \/>\nprecedence is used when there are five or more arguments.<br \/>\n! expr True if expr is false.<br \/>\n( expr )<br \/>\nReturns the value of expr.\u00a0 This may be used to<br \/>\noverride the normal precedence of operators.<br \/>\nexpr1 -a expr2<br \/>\nTrue if both expr1 and expr2 are true.<br \/>\nexpr1 -o expr2<br \/>\nTrue if either expr1 or expr2 is true.<\/p>\n<p>test and [ evaluate conditional expressions using a set of<br \/>\nrules based on the number of arguments.<\/p>\n<p>0 arguments<br \/>\nThe expression is false.<br \/>\n1 argument<br \/>\nThe expression is true if and only if the argument is<br \/>\nnot null.<br \/>\n2 arguments<br \/>\nIf the first argument is !, the expression is true if<br \/>\nand only if the second argument is null.\u00a0 If the first<br \/>\nargument is one of the unary conditional operators<br \/>\nlisted above under CONDITIONAL EXPRESSIONS, the<br \/>\nexpression is true if the unary test is true.\u00a0 If the<br \/>\nfirst argument is not a valid unary conditional<br \/>\noperator, the expression is false.<br \/>\n3 arguments<br \/>\nThe following conditions are applied in the order<br \/>\nlisted.\u00a0 If the second argument is one of the binary<br \/>\nconditional operators listed above under CONDITIONAL<br \/>\nEXPRESSIONS, the result of the expression is the result<br \/>\nof the binary test using the first and third arguments<br \/>\nas operands.\u00a0 The -a and -o operators are considered<br \/>\nbinary operators when there are three arguments.\u00a0 If<br \/>\nthe first argument is !, the value is the negation of<br \/>\nthe two-argument test using the second and third<br \/>\narguments.\u00a0 If the first argument is exactly ( and the<br \/>\nthird argument is exactly ), the result is the one-<br \/>\nargument test of the second argument.\u00a0 Otherwise, the<br \/>\nexpression is false.<br \/>\n4 arguments<br \/>\nIf the first argument is !, the result is the negation<br \/>\nof the three-argument expression composed of the<br \/>\nremaining arguments.\u00a0 Otherwise, the expression is<br \/>\nparsed and evaluated according to precedence using the<br \/>\nrules listed above.<br \/>\n5 or more arguments<br \/>\nThe expression is parsed and evaluated according to<br \/>\nprecedence using the rules listed above.<\/p>\n<p>When used with test or [, the &lt; and &gt; operators sort<br \/>\nlexicographically using ASCII ordering.<\/p>\n<p>times\u00a0 Print the accumulated user and system times for the shell and<br \/>\nfor processes run from the shell.\u00a0 The return status is 0.<\/p>\n<p>trap [-lp] [[arg] sigspec &#8230;]<br \/>\nThe command arg is to be read and executed when the shell<br \/>\nreceives signal(s) sigspec.\u00a0 If arg is absent (and there is a<br \/>\nsingle sigspec) or -, each specified signal is reset to its<br \/>\noriginal disposition (the value it had upon entrance to the<br \/>\nshell).\u00a0 If arg is the null string the signal specified by<br \/>\neach sigspec is ignored by the shell and by the commands it<br \/>\ninvokes.\u00a0 If arg is not present and -p has been supplied, then<br \/>\nthe trap commands associated with each sigspec are displayed.<br \/>\nIf no arguments are supplied or if only -p is given, trap<br \/>\nprints the list of commands associated with each signal.\u00a0 The<br \/>\n-l option causes the shell to print a list of signal names and<br \/>\ntheir corresponding numbers.\u00a0 Each sigspec is either a signal<br \/>\nname defined in &lt;signal.h&gt;, or a signal number.\u00a0 Signal names<br \/>\nare case insensitive and the SIG prefix is optional.<\/p>\n<p>If a sigspec is EXIT (0) the command arg is executed on exit<br \/>\nfrom the shell.\u00a0 If a sigspec is DEBUG, the command arg is<br \/>\nexecuted before every simple command, for command, case<br \/>\ncommand, select command, every arithmetic for command, and<br \/>\nbefore the first command executes in a shell function (see<br \/>\nSHELL GRAMMAR above).\u00a0 Refer to the description of the<br \/>\nextdebug option to the shopt builtin for details of its effect<br \/>\non the DEBUG trap.\u00a0 If a sigspec is RETURN, the command arg is<br \/>\nexecuted each time a shell function or a script executed with<br \/>\nthe . or source builtins finishes executing.<\/p>\n<p>If a sigspec is ERR, the command arg is executed whenever a a<br \/>\npipeline (which may consist of a single simple command), a<br \/>\nlist, or a compound command returns a non-zero exit status,<br \/>\nsubject to the following conditions.\u00a0 The ERR trap is not<br \/>\nexecuted if the failed command is part of the command list<br \/>\nimmediately following a while or until keyword, part of the<br \/>\ntest in an if statement, part of a command executed in a &amp;&amp; or<br \/>\n|| list except the command following the final &amp;&amp; or ||, any<br \/>\ncommand in a pipeline but the last, or if the command&#8217;s return<br \/>\nvalue is being inverted using !.\u00a0 These are the same<br \/>\nconditions obeyed by the errexit (-e) option.<\/p>\n<p>Signals ignored upon entry to the shell cannot be trapped or<br \/>\nreset.\u00a0 Trapped signals that are not being ignored are reset<br \/>\nto their original values in a subshell or subshell environment<br \/>\nwhen one is created.\u00a0 The return status is false if any<br \/>\nsigspec is invalid; otherwise trap returns true.<\/p>\n<p>type [-aftpP] name [name &#8230;]<br \/>\nWith no options, indicate how each name would be interpreted<br \/>\nif used as a command name.\u00a0 If the -t option is used, type<br \/>\nprints a string which is one of alias, keyword, function,<br \/>\nbuiltin, or file if name is an alias, shell reserved word,<br \/>\nfunction, builtin, or disk file, respectively.\u00a0 If the name is<br \/>\nnot found, then nothing is printed, and an exit status of<br \/>\nfalse is returned.\u00a0 If the -p option is used, type either<br \/>\nreturns the name of the disk file that would be executed if<br \/>\nname were specified as a command name, or nothing if &#8220;type -t<br \/>\nname&#8221; would not return file.\u00a0 The -P option forces a PATH<br \/>\nsearch for each name, even if &#8220;type -t name&#8221; would not<br \/>\nreturn file.\u00a0 If a command is hashed, -p and -P print the<br \/>\nhashed value, which is not necessarily the file that appears<br \/>\nfirst in PATH.\u00a0 If the -a option is used, type prints all of<br \/>\nthe places that contain an executable named name.\u00a0 This<br \/>\nincludes aliases and functions, if and only if the -p option<br \/>\nis not also used.\u00a0 The table of hashed commands is not<br \/>\nconsulted when using -a.\u00a0 The -f option suppresses shell<br \/>\nfunction lookup, as with the command builtin.\u00a0 type returns<br \/>\ntrue if all of the arguments are found, false if any are not<br \/>\nfound.<\/p>\n<p>ulimit [-HSTabcdefilmnpqrstuvx [limit]]<br \/>\nProvides control over the resources available to the shell and<br \/>\nto processes started by it, on systems that allow such<br \/>\ncontrol.\u00a0 The -H and -S options specify that the hard or soft<br \/>\nlimit is set for the given resource.\u00a0 A hard limit cannot be<br \/>\nincreased by a non-root user once it is set; a soft limit may<br \/>\nbe increased up to the value of the hard limit.\u00a0 If neither -H<br \/>\nnor -S is specified, both the soft and hard limits are set.<br \/>\nThe value of limit can be a number in the unit specified for<br \/>\nthe resource or one of the special values hard, soft, or<br \/>\nunlimited, which stand for the current hard limit, the current<br \/>\nsoft limit, and no limit, respectively.\u00a0 If limit is omitted,<br \/>\nthe current value of the soft limit of the resource is<br \/>\nprinted, unless the -H option is given.\u00a0 When more than one<br \/>\nresource is specified, the limit name and unit are printed<br \/>\nbefore the value.\u00a0 Other options are interpreted as follows:<br \/>\n-a\u00a0\u00a0\u00a0\u00a0 All current limits are reported<br \/>\n-b\u00a0\u00a0\u00a0\u00a0 The maximum socket buffer size<br \/>\n-c\u00a0\u00a0\u00a0\u00a0 The maximum size of core files created<br \/>\n-d\u00a0\u00a0\u00a0\u00a0 The maximum size of a process&#8217;s data segment<br \/>\n-e\u00a0\u00a0\u00a0\u00a0 The maximum scheduling priority (&#8220;nice&#8221;)<br \/>\n-f\u00a0\u00a0\u00a0\u00a0 The maximum size of files written by the shell and its<br \/>\nchildren<br \/>\n-i\u00a0\u00a0\u00a0\u00a0 The maximum number of pending signals<br \/>\n-l\u00a0\u00a0\u00a0\u00a0 The maximum size that may be locked into memory<br \/>\n-m\u00a0\u00a0\u00a0\u00a0 The maximum resident set size (many systems do not<br \/>\nhonor this limit)<br \/>\n-n\u00a0\u00a0\u00a0\u00a0 The maximum number of open file descriptors (most<br \/>\nsystems do not allow this value to be set)<br \/>\n-p\u00a0\u00a0\u00a0\u00a0 The pipe size in 512-byte blocks (this may not be set)<br \/>\n-q\u00a0\u00a0\u00a0\u00a0 The maximum number of bytes in POSIX message queues<br \/>\n-r\u00a0\u00a0\u00a0\u00a0 The maximum real-time scheduling priority<br \/>\n-s\u00a0\u00a0\u00a0\u00a0 The maximum stack size<br \/>\n-t\u00a0\u00a0\u00a0\u00a0 The maximum amount of cpu time in seconds<br \/>\n-u\u00a0\u00a0\u00a0\u00a0 The maximum number of processes available to a single<br \/>\nuser<br \/>\n-v\u00a0\u00a0\u00a0\u00a0 The maximum amount of virtual memory available to the<br \/>\nshell and, on some systems, to its children<br \/>\n-x\u00a0\u00a0\u00a0\u00a0 The maximum number of file locks<br \/>\n-T\u00a0\u00a0\u00a0\u00a0 The maximum number of threads<\/p>\n<p>If limit is given, and the -a option is not used, limit is the<br \/>\nnew value of the specified resource.\u00a0 If no option is given,<br \/>\nthen -f is assumed.\u00a0 Values are in 1024-byte increments,<br \/>\nexcept for -t, which is in seconds; -p, which is in units of<br \/>\n512-byte blocks; and -T, -b, -n, and -u, which are unscaled<br \/>\nvalues.\u00a0 The return status is 0 unless an invalid option or<br \/>\nargument is supplied, or an error occurs while setting a new<br \/>\nlimit.<\/p>\n<p>umask [-p] [-S] [mode]<br \/>\nThe user file-creation mask is set to mode.\u00a0 If mode begins<br \/>\nwith a digit, it is interpreted as an octal number; otherwise<br \/>\nit is interpreted as a symbolic mode mask similar to that<br \/>\naccepted by chmod(1).\u00a0 If mode is omitted, the current value<br \/>\nof the mask is printed.\u00a0 The -S option causes the mask to be<br \/>\nprinted in symbolic form; the default output is an octal<br \/>\nnumber.\u00a0 If the -p option is supplied, and mode is omitted,<br \/>\nthe output is in a form that may be reused as input.\u00a0 The<br \/>\nreturn status is 0 if the mode was successfully changed or if<br \/>\nno mode argument was supplied, and false otherwise.<\/p>\n<p>unalias [-a] [name &#8230;]<br \/>\nRemove each name from the list of defined aliases.\u00a0 If -a is<br \/>\nsupplied, all alias definitions are removed.\u00a0 The return value<br \/>\nis true unless a supplied name is not a defined alias.<\/p>\n<p>unset [-fv] [-n] [name &#8230;]<br \/>\nFor each name, remove the corresponding variable or function.<br \/>\nIf the -v option is given, each name refers to a shell<br \/>\nvariable, and that variable is removed.\u00a0 Read-only variables<br \/>\nmay not be unset.\u00a0 If -f is specified, each name refers to a<br \/>\nshell function, and the function definition is removed.\u00a0 If<br \/>\nthe -n option is supplied, and name is a variable with the<br \/>\nnameref attribute, name will be unset rather than the variable<br \/>\nit references.\u00a0 -n has no effect if the -f option is supplied.<br \/>\nIf no options are supplied, each name refers to a variable; if<br \/>\nthere is no variable by that name, any function with that name<br \/>\nis unset.\u00a0 Each unset variable or function is removed from the<br \/>\nenvironment passed to subsequent commands.\u00a0 If any of<br \/>\nCOMP_WORDBREAKS, RANDOM, SECONDS, LINENO, HISTCMD, FUNCNAME,<br \/>\nGROUPS, or DIRSTACK are unset, they lose their special<br \/>\nproperties, even if they are subsequently reset.\u00a0 The exit<br \/>\nstatus is true unless a name is readonly.<\/p>\n<p>wait [-n] [n &#8230;]<br \/>\nWait for each specified child process and return its<br \/>\ntermination status.\u00a0 Each n may be a process ID or a job<br \/>\nspecification; if a job spec is given, all processes in that<br \/>\njob&#8217;s pipeline are waited for.\u00a0 If n is not given, all<br \/>\ncurrently active child processes are waited for, and the<br \/>\nreturn status is zero.\u00a0 If the -n option is supplied, wait<br \/>\nwaits for any job to terminate and returns its exit status.<br \/>\nIf n specifies a non-existent process or job, the return<br \/>\nstatus is 127.\u00a0 Otherwise, the return status is the exit<br \/>\nstatus of the last process or job waited for.<\/p>\n<p>RESTRICTED SHELL<\/p>\n<p>If bash is started with the name rbash, or the -r option is supplied<br \/>\nat invocation, the shell becomes restricted.\u00a0 A restricted shell is<br \/>\nused to set up an environment more controlled than the standard<br \/>\nshell.\u00a0 It behaves identically to bash with the exception that the<br \/>\nfollowing are disallowed or not performed:<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 changing directories with cd<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 setting or unsetting the values of SHELL, PATH, ENV, or<br \/>\nBASH_ENV<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 specifying command names containing \/<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 specifying a filename containing a \/ as an argument to the .<br \/>\nbuiltin command<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 specifying a filename containing a slash as an argument to the<br \/>\n-p option to the hash builtin command<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 importing function definitions from the shell environment at<br \/>\nstartup<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 parsing the value of SHELLOPTS from the shell environment at<br \/>\nstartup<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 redirecting output using the &gt;, &gt;|, &lt;&gt;, &gt;&amp;, &amp;&gt;, and &gt;&gt;<br \/>\nredirection operators<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 using the exec builtin command to replace the shell with<br \/>\nanother command<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 adding or deleting builtin commands with the -f and -d options<br \/>\nto the enable builtin command<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 using the enable builtin command to enable disabled shell<br \/>\nbuiltins<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 specifying the -p option to the command builtin command<\/p>\n<p>\u00b7\u00a0\u00a0\u00a0\u00a0\u00a0 turning off restricted mode with set +r or set +o restricted.<\/p>\n<p>These restrictions are enforced after any startup files are read.<\/p>\n<p>When a command that is found to be a shell script is executed (see<br \/>\nCOMMAND EXECUTION above), rbash turns off any restrictions in the<br \/>\nshell spawned to execute the script.<\/p>\n<p>SEE ALSO<\/p>\n<p>Bash Reference Manual, Brian Fox and Chet Ramey<br \/>\nThe Gnu Readline Library, Brian Fox and Chet Ramey<br \/>\nThe Gnu History Library, Brian Fox and Chet Ramey<br \/>\nPortable Operating System Interface (POSIX) Part 2: Shell and<br \/>\nUtilities, IEEE &#8212;<br \/>\nhttp:\/\/pubs.opengroup.org\/onlinepubs\/9699919799\/<br \/>\nhttp:\/\/tiswww.case.edu\/~chet\/bash\/POSIX &#8212; a description of posix<br \/>\nmode<br \/>\nsh(1), ksh(1), csh(1)<br \/>\nemacs(1), vi(1)<br \/>\nreadline(3)<\/p>\n<p>FILES<\/p>\n<p>\/bin\/bash<br \/>\nThe bash executable<br \/>\n\/etc\/profile<br \/>\nThe systemwide initialization file, executed for login shells<br \/>\n~\/.bash_profile<br \/>\nThe personal initialization file, executed for login shells<br \/>\n~\/.bashrc<br \/>\nThe individual per-interactive-shell startup file<br \/>\n~\/.bash_logout<br \/>\nThe individual login shell cleanup file, executed when a login<br \/>\nshell exits<br \/>\n~\/.inputrc<br \/>\nIndividual readline initialization file<\/p>\n<p>AUTHORS<\/p>\n<p>Brian Fox, Free Software Foundation<br \/>\nbfox@gnu.org<\/p>\n<p>Chet Ramey, Case Western Reserve University<br \/>\nchet.ramey@case.edu<\/p>\n<p>BUG REPORTS<\/p>\n<p>If you find a bug in bash, you should report it.\u00a0 But first, you<br \/>\nshould make sure that it really is a bug, and that it appears in the<br \/>\nlatest version of bash.\u00a0 The latest version is always available from<br \/>\nftp:\/\/ftp.gnu.org\/pub\/gnu\/bash\/.<\/p>\n<p>Once you have determined that a bug actually exists, use the bashbug<br \/>\ncommand to submit a bug report.\u00a0 If you have a fix, you are<br \/>\nencouraged to mail that as well!\u00a0 Suggestions and `philosophical&#8217; bug<br \/>\nreports may be mailed to\u00a0bug-bash@gnu.org\u00a0or posted to the Usenet<br \/>\nnewsgroup gnu.bash.bug.<\/p>\n<p>ALL bug reports should include:<\/p>\n<p>The version number of bash<br \/>\nThe hardware and operating system<br \/>\nThe compiler used to compile<br \/>\nA description of the bug behaviour<br \/>\nA short script or `recipe&#8217; which exercises the bug<\/p>\n<p>bashbug inserts the first three items automatically into the template<br \/>\nit provides for filing a bug report.<\/p>\n<p>Comments and bug reports concerning this manual page should be<br \/>\ndirected to\u00a0chet.ramey@case.edu.<\/p>\n<p>BUGS<\/p>\n<p>It&#8217;s too big and too slow.<\/p>\n<p>There are some subtle differences between bash and traditional<br \/>\nversions of sh, mostly because of the POSIX specification.<\/p>\n<p>Aliases are confusing in some uses.<\/p>\n<p>Shell builtin commands and functions are not stoppable\/restartable.<\/p>\n<p>Compound commands and command sequences of the form `a ; b ; c&#8217; are<br \/>\nnot handled gracefully when process suspension is attempted.\u00a0 When a<br \/>\nprocess is stopped, the shell immediately executes the next command<br \/>\nin the sequence.\u00a0 It suffices to place the sequence of commands<br \/>\nbetween parentheses to force it into a subshell, which may be stopped<br \/>\nas a unit.<\/p>\n<p>Array variables may not (yet) be exported.<\/p>\n<p>There may be only one active coprocess at a time.<\/p>\n<p>COLOPHON<\/p>\n<p>This page is part of the bash (Bourne again shell) project.<br \/>\nInformation about the project can be found at<br \/>\n\u27e8http:\/\/www.gnu.org\/software\/bash\/\u27e9.\u00a0 If you have a bug report for<br \/>\nthis manual page, see \u27e8http:\/\/www.gnu.org\/software\/bash\/\u27e9.\u00a0 This page<br \/>\nwas obtained from the project&#8217;s upstream Git repository<br \/>\n(git:\/\/git.savannah.gnu.org\/bash.git) on 2014-12-30.\u00a0 If you discover<br \/>\nany rendering problems in this HTML version of the page, or you<br \/>\nbelieve there is a better or more up-to-date source for the page, or<br \/>\nyou have corrections or improvements to the information in this<br \/>\nCOLOPHON (which is not part of the original manual page), send a mail<br \/>\nto\u00a0man-pages@man7.org<\/p>\n<p>GNU Bash 4.3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2014 February 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 BASH(1)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BASH(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 General Commands Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 BASH(1) NAME bash &#8211; GNU Bourne-Again SHell SYNOPSIS bash [options] [command_string | file] COPYRIGHT Bash is Copyright (C) 1989-2013 by the Free Software Foundation, Inc. DESCRIPTION Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file.\u00a0 Bash also incorporates useful features from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-280","post","type-post","status-publish","format-standard","hentry","category-shell"],"a3_pvc":{"activated":false,"total_views":0,"today_views":0},"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=280"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/280\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}