{
    "content": [
        {
            "type": "text",
            "text": "# bash(1) (man)\n\n**Summary:** bash - GNU Bourne-Again SHell\n\n**Synopsis:** bash [options] [commandstring | file]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -c | — | — | ment commandstring. If there are arguments after the commandstring, the first argument is assigned to $0 and any remaini |\n| -i | — | — |  |\n| -l | — | — |  |\n| -r | — | — | low). |\n| -s | — | — | then commands are read from the standard input. This option allows the positional parameters to be set when invoking an  |\n| -v | — | — |  |\n| -x | — | — |  |\n| -D | — | — | put. These are the strings that are subject to language translation when the cur‐ rent locale is not C or POSIX. This im |\n| — | --debugger | — | Arrange for the debugger profile to be executed before the shell starts. Turns on ex‐ tended debugging mode (see the des |\n| — | --dump-po-strings | — | Equivalent to -D, but the output is in the GNU gettext po (portable object) file for‐ mat. |\n| — | --dump-strings | — | Equivalent to -D. --help Display a usage message on standard output and exit successfully. --init-file file --rcfile fil |\n| — | --login | — | Equivalent to -l. |\n| — | --noediting | — | Do not use the GNU readline library to read command lines when the shell is interac‐ tive. |\n| — | --noprofile | — | Do not read either the system-wide startup file /etc/profile or any of the personal initialization files ~/.bashprofile, |\n| — | --posix | — | Change the behavior of bash where the default operation differs from the POSIX stan‐ dard to match the standard (posix m |\n| — | --restricted | — | The shell becomes restricted (see RESTRICTED SHELL below). |\n| — | --verbose | — | Equivalent to -v. |\n| — | --version | — | Show version information for this instance of bash on the standard output and exit successfully. |\n\n## See Also\n\n- sh(1)\n- ksh(1)\n- csh(1)\n- emacs(1)\n- vi(1)\n- readline(3)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **COPYRIGHT** (2 lines)\n- **DESCRIPTION** (8 lines)\n- **OPTIONS** (4 lines) — 18 subsections\n  - -c -c (4 lines)\n  - -i -i (1 lines)\n  - -l (1 lines)\n  - -r -r (1 lines)\n  - -s -s (3 lines)\n  - -v (1 lines)\n  - -x (1 lines)\n  - -D (16 lines)\n  - --debugger (3 lines)\n  - --dump-po-strings (2 lines)\n  - --dump-strings (8 lines)\n  - --login (2 lines)\n  - --noediting (3 lines)\n  - --noprofile (8 lines)\n  - --posix (4 lines)\n  - --restricted (2 lines)\n  - --verbose (2 lines)\n  - --version (3 lines)\n- **ARGUMENTS** (9 lines)\n- **INVOCATION** (66 lines)\n- **DEFINITIONS** (6 lines) — 2 subsections\n  - metacharacter (2 lines)\n  - control operator (3 lines)\n- **RESERVED WORDS** (5 lines) — 2 subsections\n  - ! case  coproc  do done elif else esac fi for function if in (1 lines)\n  - [[ ]] (1 lines)\n- **SHELL GRAMMAR** (1 lines) — 6 subsections\n  - Simple Commands (8 lines)\n  - Pipelines (35 lines)\n  - Lists (30 lines)\n  - Compound Commands (144 lines)\n  - Coprocesses (26 lines)\n  - Shell Function Definitions (20 lines)\n- **COMMENTS** (6 lines)\n- **QUOTING** (69 lines)\n- **PARAMETERS** (55 lines) — 5 subsections\n  - Positional Parameters (9 lines)\n  - Special Parameters (36 lines)\n  - Shell Variables (502 lines)\n  - histchars (11 lines)\n  - Arrays (83 lines)\n- **EXPANSION** (21 lines) — 10 subsections\n  - Brace Expansion (46 lines)\n  - Tilde Expansion (28 lines)\n  - Parameter Expansion (197 lines)\n  - Command Substitution (23 lines)\n  - Arithmetic Expansion (16 lines)\n  - Process Substitution (11 lines)\n  - Word Splitting (24 lines)\n  - Pathname Expansion (30 lines)\n  - Pattern Matching (59 lines)\n  - Quote Removal (3 lines)\n- **REDIRECTION** (63 lines) — 10 subsections\n  - Redirecting Input (8 lines)\n  - Redirecting Output (15 lines)\n  - Appending Redirected Output (8 lines)\n  - Redirecting Standard Output and Standard Error (16 lines)\n  - Appending Standard Output and Standard Error (13 lines)\n  - Here Documents (22 lines)\n  - Here Strings (9 lines)\n  - Duplicating File Descriptors (20 lines)\n  - Moving File Descriptors (14 lines)\n  - Opening File Descriptors for Reading and Writing (8 lines)\n- **ALIASES** (35 lines)\n- **FUNCTIONS** (65 lines)\n- **ARITHMETIC EVALUATION** (17 lines) — 1 subsections\n  - <= >= < > (35 lines)\n- **CONDITIONAL EXPRESSIONS** (19 lines) — 26 subsections\n  - -a (1 lines)\n  - -b (1 lines)\n  - -c (1 lines)\n  - -d (1 lines)\n  - -e (1 lines)\n  - -f (1 lines)\n  - -g (1 lines)\n  - -h (1 lines)\n  - -k (1 lines)\n  - -p (1 lines)\n  - -r (1 lines)\n  - -s (1 lines)\n  - -t (1 lines)\n  - -u (1 lines)\n  - -w (1 lines)\n  - -x (1 lines)\n  - -G (1 lines)\n  - -L (1 lines)\n  - -N (1 lines)\n  - -O (1 lines)\n  - -S (8 lines)\n  - -o (2 lines)\n  - -v (1 lines)\n  - -R (1 lines)\n  - -z (2 lines)\n  - -n (24 lines)\n- **SIMPLE COMMAND EXPANSION** (29 lines)\n- **COMMAND EXECUTION** (37 lines)\n- **COMMAND EXECUTION ENVIRONMENT** (63 lines)\n- **ENVIRONMENT** (23 lines)\n- **EXIT STATUS** (23 lines)\n- **SIGNALS** (25 lines)\n- **JOB CONTROL** (70 lines)\n- **PROMPTING** (51 lines)\n- **READLINE** (8 lines) — 164 subsections\n  - Readline Notation (17 lines)\n  - Readline Initialization (25 lines)\n  - Readline Key Bindings (61 lines)\n  - Readline Variables (11 lines)\n  - bell-style (audible) (3 lines)\n  - bind-tty-special-chars (On) (2 lines)\n  - blink-matching-paren (Off) (2 lines)\n  - colored-completion-prefix (Off) (3 lines)\n  - colored-stats (Off) (3 lines)\n  - comment-begin (``#'') (2 lines)\n  - completion-display-width (-1) (4 lines)\n  - completion-ignore-case (Off) (2 lines)\n  - completion-map-case (Off) (3 lines)\n  - completion-prefix-display-length (0) (4 lines)\n  - completion-query-items (100) (5 lines)\n  - convert-meta (On) (4 lines)\n  - disable-completion (Off) (2 lines)\n  - echo-control-characters (On) (2 lines)\n  - editing-mode (emacs) (2 lines)\n  - emacs-mode-string (@) (6 lines)\n  - enable-bracketed-paste (On) (4 lines)\n  - enable-keypad (Off) (2 lines)\n  - enable-meta-key (On) (3 lines)\n  - expand-tilde (Off) (1 lines)\n  - history-preserve-point (Off) (2 lines)\n  - history-size (unset) (6 lines)\n  - horizontal-scroll-mode (Off) (4 lines)\n  - input-meta (Off) (4 lines)\n  - isearch-terminators (``C-[C-J'') (3 lines)\n  - keymap (emacs) (4 lines)\n  - keyseq-timeout (500) (8 lines)\n  - mark-directories (On) (1 lines)\n  - mark-modified-lines (Off) (2 lines)\n  - mark-symlinked-directories (Off) (2 lines)\n  - match-hidden-files (On) (3 lines)\n  - menu-complete-display-prefix (Off) (2 lines)\n  - output-meta (Off) (3 lines)\n  - page-completions (On) (2 lines)\n  - print-completions-horizontally (Off) (2 lines)\n  - revert-all-at-newline (Off) (3 lines)\n  - show-all-if-ambiguous (Off) (3 lines)\n  - show-all-if-unmodified (Off) (4 lines)\n  - show-mode-in-prompt (Off) (3 lines)\n  - skip-completed-text (Off) (5 lines)\n  - vi-cmd-mode-string ((cmd)) (6 lines)\n  - vi-ins-mode-string ((ins)) (6 lines)\n  - visible-stats (Off) (3 lines)\n  - Readline Conditional Constructs (56 lines)\n  - $include (5 lines)\n  - Searching (28 lines)\n  - Readline Command Names (6 lines)\n  - Commands for Moving (1 lines)\n  - beginning-of-line (C-a) (1 lines)\n  - end-of-line (C-e) (1 lines)\n  - forward-char (C-f) (1 lines)\n  - backward-char (C-b) (1 lines)\n  - forward-word (M-f) (2 lines)\n  - backward-word (M-b) (2 lines)\n  - shell-forward-word (2 lines)\n  - shell-backward-word (2 lines)\n  - previous-screen-line (4 lines)\n  - next-screen-line (4 lines)\n  - clear-display (M-C-l) (2 lines)\n  - clear-screen (C-l) (2 lines)\n  - redraw-current-line (2 lines)\n  - Commands for Manipulating the History (1 lines)\n  - accept-line (Newline, Return) (3 lines)\n  - previous-history (C-p) (1 lines)\n  - next-history (C-n) (1 lines)\n  - beginning-of-history (M-<) (1 lines)\n  - end-of-history (M->) (1 lines)\n  - reverse-search-history (C-r) (2 lines)\n  - forward-search-history (C-s) (2 lines)\n  - non-incremental-reverse-search-history (M-p) (2 lines)\n  - non-incremental-forward-search-history (M-n) (2 lines)\n  - history-search-forward (2 lines)\n  - history-search-backward (2 lines)\n  - history-substring-search-backward (3 lines)\n  - history-substring-search-forward (3 lines)\n  - yank-nth-arg (M-C-y) (14 lines)\n  - shell-expand-line (M-C-e) (3 lines)\n  - history-expand-line (M-^) (2 lines)\n  - magic-space (2 lines)\n  - alias-expand-line (2 lines)\n  - history-and-alias-expand-line (3 lines)\n  - operate-and-get-next (C-o) (3 lines)\n  - edit-and-execute-command (C-x C-e) (4 lines)\n  - Commands for Changing Text (4 lines)\n  - delete-char (C-d) (2 lines)\n  - backward-delete-char (Rubout) (2 lines)\n  - forward-backward-delete-char (2 lines)\n  - quoted-insert (C-q, C-v) (2 lines)\n  - tab-insert (C-v TAB) (1 lines)\n  - self-insert (a, b, A, 1, !, ...) (1 lines)\n  - transpose-chars (C-t) (3 lines)\n  - transpose-words (M-t) (3 lines)\n  - upcase-word (M-u) (2 lines)\n  - downcase-word (M-l) (2 lines)\n  - capitalize-word (M-c) (2 lines)\n  - overwrite-mode (8 lines)\n  - Killing and Yanking (1 lines)\n  - kill-line (C-k) (1 lines)\n  - backward-kill-line (C-x Rubout) (1 lines)\n  - unix-line-discard (C-u) (2 lines)\n  - kill-whole-line (1 lines)\n  - kill-word (M-d) (2 lines)\n  - backward-kill-word (M-Rubout) (2 lines)\n  - shell-kill-word (2 lines)\n  - shell-backward-kill-word (2 lines)\n  - unix-word-rubout (C-w) (2 lines)\n  - unix-filename-rubout (2 lines)\n  - delete-horizontal-space (M-\\) (1 lines)\n  - kill-region (1 lines)\n  - copy-region-as-kill (1 lines)\n  - copy-backward-word (2 lines)\n  - copy-forward-word (2 lines)\n  - yank (C-y) (1 lines)\n  - yank-pop (M-y) (2 lines)\n  - Numeric Arguments (1 lines)\n  - digit-argument (M-0, M-1, ..., M--) (2 lines)\n  - universal-argument (9 lines)\n  - Completing (1 lines)\n  - complete (TAB) (5 lines)\n  - possible-completions (M-?) (4 lines)\n  - menu-complete (7 lines)\n  - menu-complete-backward (3 lines)\n  - delete-char-or-list (3 lines)\n  - complete-filename (M-/) (1 lines)\n  - possible-filename-completions (C-x /) (1 lines)\n  - complete-username (M-~) (1 lines)\n  - possible-username-completions (C-x ~) (1 lines)\n  - complete-variable (M-$) (1 lines)\n  - possible-variable-completions (C-x $) (2 lines)\n  - complete-hostname (M-@) (1 lines)\n  - possible-hostname-completions (C-x @) (1 lines)\n  - complete-command (M-!) (3 lines)\n  - possible-command-completions (C-x !) (1 lines)\n  - dynamic-complete-history (M-TAB) (2 lines)\n  - dabbrev-expand (2 lines)\n  - complete-into-braces (M-{) (3 lines)\n  - Keyboard Macros (1 lines)\n  - start-kbd-macro (C-x () (1 lines)\n  - end-kbd-macro (C-x )) (2 lines)\n  - call-last-kbd-macro (C-x e) (2 lines)\n  - print-last-kbd-macro () (2 lines)\n  - Miscellaneous (1 lines)\n  - re-read-init-file (C-x C-r) (2 lines)\n  - abort (C-g) (6 lines)\n  - prefix-meta (ESC) (3 lines)\n  - revert-line (M-r) (2 lines)\n  - tilde-expand (M-&) (1 lines)\n  - set-mark (C-@, M-<space>) (2 lines)\n  - exchange-point-and-mark (C-x C-x) (2 lines)\n  - character-search (C-]) (2 lines)\n  - character-search-backward (M-C-]) (2 lines)\n  - skip-csi-sequence (6 lines)\n  - insert-comment (M-#) (8 lines)\n  - glob-complete-word (M-g) (7 lines)\n  - glob-list-expansions (C-x g) (3 lines)\n  - dump-functions (3 lines)\n  - dump-variables (3 lines)\n  - dump-macros (3 lines)\n  - display-shell-version (C-x C-v) (2 lines)\n  - Programmable Completion (105 lines)\n- **HISTORY** (39 lines)\n- **HISTORY EXPANSION** (42 lines) — 4 subsections\n  - Event Designators (21 lines)\n  - Word Designators (6 lines)\n  - 0 (zero) (17 lines)\n  - Modifiers (27 lines)\n- **SHELL BUILTIN COMMANDS** (460 lines) — 2 subsections\n  - export -p (110 lines)\n  - history -c (930 lines)\n- **SHELL COMPATIBILITY MODE** (36 lines) — 8 subsections\n  - compat31 (3 lines)\n  - compat32 (5 lines)\n  - compat40 (5 lines)\n  - compat41 (7 lines)\n  - compat42 (8 lines)\n  - compat43 (10 lines)\n  - compat44 (10 lines)\n  - compat50 (10 lines)\n- **RESTRICTED SHELL** (40 lines)\n- **SEE ALSO** (10 lines)\n- **FILES** (17 lines)\n- **AUTHORS** (6 lines)\n- **BUG REPORTS** (23 lines)\n- **BUGS** (21 lines)\n\n## Full Content\n\n### NAME\n\nbash - GNU Bourne-Again SHell\n\n### SYNOPSIS\n\nbash [options] [commandstring | file]\n\n### COPYRIGHT\n\nBash is Copyright (C) 1989-2020 by the Free Software Foundation, Inc.\n\n### DESCRIPTION\n\nBash  is  an  sh-compatible command language interpreter that executes commands read from the\nstandard input or from a file.  Bash also incorporates useful features from the  Korn  and  C\nshells (ksh and csh).\n\nBash  is intended to be a conformant implementation of the Shell and Utilities portion of the\nIEEE POSIX specification (IEEE Standard 1003.1).  Bash can be configured to be  POSIX-confor‐\nmant by default.\n\n### OPTIONS\n\nAll  of  the  single-character shell options documented in the description of the set builtin\ncommand, including -o, can be used as options when the shell is invoked.  In  addition,  bash\ninterprets the following options when it is invoked:\n\n#### -c -c\n\nment commandstring.  If there are arguments after the  commandstring,  the  first\nargument  is  assigned  to $0 and any remaining arguments are assigned to the posi‐\ntional parameters.  The assignment to $0 sets the name of the shell, which is  used\nin warning and error messages.\n\n#### -i -i\n\n#### -l\n\n#### -r -r\n\nlow).\n\n#### -s -s\n\nthen  commands are read from the standard input.  This option allows the positional\nparameters to be set when invoking an  interactive  shell  or  when  reading  input\nthrough a pipe.\n\n#### -v\n\n#### -x\n\n#### -D\n\nput.  These are the strings that are subject to language translation when the  cur‐\nrent locale is not C or POSIX.  This implies the -n option; no commands will be ex‐\necuted.\n[-+]O [shoptoption]\nshoptoption is one of the shell options accepted by the shopt builtin  (see  SHELL\nBUILTIN COMMANDS below).  If shoptoption is present, -O sets the value of that op‐\ntion; +O unsets it.  If shoptoption is not supplied, the names and values  of  the\nshell options accepted by shopt are printed on the standard output.  If the invoca‐\ntion option is +O, the output is displayed in a format that may be reused as input.\n--        A -- signals the end of options and disables further option processing.  Any  argu‐\nments  after  the  --  are treated as filenames and arguments.  An argument of - is\nequivalent to --.\n\nBash also interprets a number of multi-character options.  These options must appear  on  the\ncommand line before the single-character options to be recognized.\n\n#### --debugger\n\nArrange for the debugger profile to be executed before the shell starts.  Turns on ex‐\ntended debugging mode (see the description of the extdebug option to the shopt builtin\nbelow).\n\n#### --dump-po-strings\n\nEquivalent  to -D, but the output is in the GNU gettext po (portable object) file for‐\nmat.\n\n#### --dump-strings\n\nEquivalent to -D.\n--help Display a usage message on standard output and exit successfully.\n--init-file file\n--rcfile file\nExecute  commands  from  file  instead  of  the  system   wide   initialization   file\n/etc/bash.bashrc  and the standard personal initialization file ~/.bashrc if the shell\nis interactive (see INVOCATION below).\n\n#### --login\n\nEquivalent to -l.\n\n#### --noediting\n\nDo not use the GNU readline library to read command lines when the shell  is  interac‐\ntive.\n\n#### --noprofile\n\nDo  not  read  either the system-wide startup file /etc/profile or any of the personal\ninitialization files ~/.bashprofile, ~/.bashlogin, or ~/.profile.  By default,  bash\nreads these files when it is invoked as a login shell (see INVOCATION below).\n\n--norc Do  not  read and execute the system wide initialization file /etc/bash.bashrc and the\npersonal initialization file ~/.bashrc if the shell is interactive.  This option is on\nby default if the shell is invoked as sh.\n\n#### --posix\n\nChange  the  behavior of bash where the default operation differs from the POSIX stan‐\ndard to match the standard (posix mode).  See SEE ALSO below for a reference to a doc‐\nument that details how posix mode affects bash's behavior.\n\n#### --restricted\n\nThe shell becomes restricted (see RESTRICTED SHELL below).\n\n#### --verbose\n\nEquivalent to -v.\n\n#### --version\n\nShow  version  information  for  this instance of bash on the standard output and exit\nsuccessfully.\n\n### ARGUMENTS\n\nIf arguments remain after option processing, and neither the -c nor the -s  option  has  been\nsupplied,  the  first argument is assumed to be the name of a file containing shell commands.\nIf bash is invoked in this fashion, $0 is set to the name of the file, and the positional pa‐\nrameters  are  set  to  the  remaining arguments.  Bash reads and executes commands from this\nfile, then exits.  Bash's exit status is the exit status of the last command executed in  the\nscript.  If no commands are executed, the exit status is 0.  An attempt is first made to open\nthe file in the current directory, and, if no file is found, then the shell searches the  di‐\nrectories in PATH for the script.\n\n### INVOCATION\n\nA  login  shell is one whose first character of argument zero is a -, or one started with the\n--login option.\n\nAn interactive shell is one started without non-option arguments (unless -s is specified) and\nwithout  the -c option whose standard input and error are both connected to terminals (as de‐\ntermined by isatty(3)), or one started with the -i option.  PS1 is set and $- includes  i  if\nbash is interactive, allowing a shell script or a startup file to test this state.\n\nThe  following  paragraphs describe how bash executes its startup files.  If any of the files\nexist but cannot be read, bash reports an error.  Tildes are expanded  in  filenames  as  de‐\nscribed below under Tilde Expansion in the EXPANSION section.\n\nWhen  bash  is  invoked as an interactive login shell, or as a non-interactive shell with the\n--login option, it first reads and executes commands from the file /etc/profile, if that file\nexists.   After  reading  that file, it looks for ~/.bashprofile, ~/.bashlogin, and ~/.pro‐\nfile, in that order, and reads and executes commands from the first one that  exists  and  is\nreadable.   The  --noprofile option may be used when the shell is started to inhibit this be‐\nhavior.\n\nWhen an interactive login shell exits, or a non-interactive login  shell  executes  the  exit\nbuiltin command, bash reads and executes commands from the file ~/.bashlogout, if it exists.\n\nWhen  an interactive shell that is not a login shell is started, bash reads and executes com‐\nmands from /etc/bash.bashrc and ~/.bashrc, if these files exist.  This may  be  inhibited  by\nusing  the  --norc option.  The --rcfile file option will force bash to read and execute com‐\nmands from file instead of /etc/bash.bashrc and ~/.bashrc.\n\nWhen bash is started non-interactively, to run a shell script, for example, it looks for  the\nvariable BASHENV in the environment, expands its value if it appears there, and uses the ex‐\npanded value as the name of a file to read and execute.  Bash behaves  as  if  the  following\ncommand were executed:\nif [ -n \"$BASHENV\" ]; then . \"$BASHENV\"; fi\nbut the value of the PATH variable is not used to search for the filename.\n\nIf  bash  is  invoked  with the name sh, it tries to mimic the startup behavior of historical\nversions of sh as closely as possible, while conforming to the POSIX standard as well.   When\ninvoked as an interactive login shell, or a non-interactive shell with the --login option, it\nfirst attempts to read and execute commands from /etc/profile and ~/.profile, in that  order.\nThe  --noprofile option may be used to inhibit this behavior.  When invoked as an interactive\nshell with the name sh, bash looks for the variable ENV, expands its value if it is  defined,\nand uses the expanded value as the name of a file to read and execute.  Since a shell invoked\nas sh does not attempt to read and execute commands from any other startup files,  the  --rc‐‐\nfile option has no effect.  A non-interactive shell invoked with the name sh does not attempt\nto read any other startup files.  When invoked as  sh,  bash  enters  posix  mode  after  the\nstartup files are read.\n\nWhen  bash  is started in posix mode, as with the --posix command line option, it follows the\nPOSIX standard for startup files.  In this mode, interactive shells expand the  ENV  variable\nand  commands are read and executed from the file whose name is the expanded value.  No other\nstartup files are read.\n\nBash attempts to determine when it is being run with its standard input connected to  a  net‐\nwork  connection,  as  when  executed by the remote shell daemon, usually rshd, or the secure\nshell daemon sshd.  If bash determines it is being run in this fashion, it reads and executes\ncommands from ~/.bashrc and ~/.bashrc, if these files exist and are readable.  It will not do\nthis if invoked as sh.  The --norc option may be used to inhibit this behavior, and the --rc‐‐\nfile option may be used to force another file to be read, but neither rshd nor sshd generally\ninvoke the shell with those options or allow them to be specified.\n\nIf the shell is started with the effective user (group) id not equal to the real user (group)\nid, and the -p option is not supplied, no startup files are read, shell functions are not in‐\nherited from the environment, the SHELLOPTS, BASHOPTS, CDPATH, and GLOBIGNORE  variables,  if\nthey  appear  in  the  environment, are ignored, and the effective user id is set to the real\nuser id.  If the -p option is supplied at invocation, the startup behavior is the  same,  but\nthe effective user id is not reset.\n\n### DEFINITIONS\n\nThe following definitions are used throughout the rest of this document.\nblank  A space or tab.\nword   A  sequence  of  characters considered as a single unit by the shell.  Also known as a\ntoken.\nname   A word consisting only of alphanumeric characters and underscores, and beginning  with\nan alphabetic character or an underscore.  Also referred to as an identifier.\n\n#### metacharacter\n\nA character that, when unquoted, separates words.  One of the following:\n|  & ; ( ) < > space tab newline\n\n#### control operator\n\nA token that performs a control function.  It is one of the following symbols:\n|| & && ; ;; ;& ;;& ( ) | |& <newline>\n\n### RESERVED WORDS\n\nReserved  words  are words that have a special meaning to the shell.  The following words are\nrecognized as reserved when unquoted and either the first word of a command (see SHELL  GRAM‐‐\nMAR  below), the third word of a case or select command (only in is valid), or the third word\nof a for command (only in and do are valid):\n\n#### ! case  coproc  do done elif else esac fi for function if in select then until while { } time\n\n#### [[ ]]\n\n### SHELL GRAMMAR\n\n#### Simple Commands\n\nA  simple  command is a sequence of optional variable assignments followed by blank-separated\nwords and redirections, and terminated by a control operator.  The first word  specifies  the\ncommand  to  be  executed, and is passed as argument zero.  The remaining words are passed as\narguments to the invoked command.\n\nThe return value of a simple command is its exit status, or 128+n if the  command  is  termi‐\nnated by signal n.\n\n#### Pipelines\n\nA  pipeline is a sequence of one or more commands separated by one of the control operators |\nor |&.  The format for a pipeline is:\n\n[time [-p]] [ ! ] command [ [|⎪|&] command2 ... ]\n\nThe standard output of command is connected via a pipe to the  standard  input  of  command2.\nThis  connection is performed before any redirections specified by the command (see REDIRECT‐‐\nION below).  If |& is used, command's standard error, in addition to its standard output,  is\nconnected  to  command2's  standard input through the pipe; it is shorthand for 2>&1 |.  This\nimplicit redirection of the standard error to the standard  output  is  performed  after  any\nredirections specified by the command.\n\nThe  return  status of a pipeline is the exit status of the last command, unless the pipefail\noption is enabled.  If pipefail is enabled, the pipeline's return status is the value of  the\nlast  (rightmost)  command  to exit with a non-zero status, or zero if all commands exit suc‐\ncessfully.  If the reserved word !  precedes a pipeline, the exit status of that pipeline  is\nthe logical negation of the exit status as described above.  The shell waits for all commands\nin the pipeline to terminate before returning a value.\n\nIf the time reserved word precedes a pipeline, the elapsed as well as user  and  system  time\nconsumed  by  its execution are reported when the pipeline terminates.  The -p option changes\nthe output format to that specified by POSIX.  When the shell is in posix mode, it  does  not\nrecognize  time as a reserved word if the next token begins with a `-'.  The TIMEFORMAT vari‐\nable may be set to a format string that specifies how the timing information should  be  dis‐\nplayed; see the description of TIMEFORMAT under Shell Variables below.\n\nWhen  the shell is in posix mode, time may be followed by a newline.  In this case, the shell\ndisplays the total user and system time consumed by the shell and its children.  The TIMEFOR‐‐\nMAT variable may be used to specify the format of the time information.\n\nEach command in a pipeline is executed as a separate process (i.e., in a subshell).  See COM‐‐\nMAND EXECUTION ENVIRONMENT for a description of a subshell environment.  If the lastpipe  op‐\ntion  is  enabled using the shopt builtin (see the description of shopt below), the last ele‐\nment of a pipeline may be run by the shell process.\n\n#### Lists\n\nA list is a sequence of one or more pipelines separated by one of the operators ;, &, &&,  or\n||, and optionally terminated by one of ;, &, or <newline>.\n\nOf  these  list  operators,  && and || have equal precedence, followed by ; and &, which have\nequal precedence.\n\nA sequence of one or more newlines may appear in a list instead of  a  semicolon  to  delimit\ncommands.\n\nIf  a  command is terminated by the control operator &, the shell executes the command in the\nbackground in a subshell.  The shell does not wait for the command to finish, and the  return\nstatus  is 0.  These are referred to as asynchronous commands.  Commands separated by a ; are\nexecuted sequentially; the shell waits for each command to terminate  in  turn.   The  return\nstatus is the exit status of the last command executed.\n\nAND  and  OR  lists are sequences of one or more pipelines separated by the && and || control\noperators, respectively.  AND and OR lists are executed with left associativity.  An AND list\nhas the form\n\ncommand1 && command2\n\ncommand2 is executed if, and only if, command1 returns an exit status of zero (success).\n\nAn OR list has the form\n\ncommand1 || command2\n\ncommand2  is  executed  if, and only if, command1 returns a non-zero exit status.  The return\nstatus of AND and OR lists is the exit status of the last command executed in the list.\n\n#### Compound Commands\n\nA compound command is one of the following.  In most cases a list in a command's  description\nmay be separated from the rest of the command by one or more newlines, and may be followed by\na newline in place of a semicolon.\n\n(list) list is executed in a subshell environment (see COMMAND EXECUTION ENVIRONMENT  below).\nVariable  assignments  and builtin commands that affect the shell's environment do not\nremain in effect after the command completes.  The return status is the exit status of\nlist.\n\n{ list; }\nlist  is  simply  executed  in the current shell environment.  list must be terminated\nwith a newline or semicolon.  This is known as a group command.  The return status  is\nthe exit status of list.  Note that unlike the metacharacters ( and ), { and } are re‐\nserved words and must occur where a reserved  word  is  permitted  to  be  recognized.\nSince  they  do not cause a word break, they must be separated from list by whitespace\nor another shell metacharacter.\n\n((expression))\nThe expression is evaluated according to the rules described  below  under  ARITHMETIC\nEVALUATION.   If the value of the expression is non-zero, the return status is 0; oth‐\nerwise the return status is 1.  This is exactly equivalent to let \"expression\".\n\n[[ expression ]]\nReturn a status of 0 or 1 depending on the evaluation of  the  conditional  expression\nexpression.   Expressions  are  composed of the primaries described below under CONDI‐‐\nTIONAL EXPRESSIONS.  Word splitting and pathname expansion are not  performed  on  the\nwords between the [[ and ]]; tilde expansion, parameter and variable expansion, arith‐\nmetic expansion, command substitution, process substitution,  and  quote  removal  are\nperformed.  Conditional operators such as -f must be unquoted to be recognized as pri‐\nmaries.\n\nWhen used with [[, the < and > operators sort lexicographically using the current  lo‐\ncale.\n\nSee  the  description  of the test builtin command (section SHELL BUILTIN COMMANDS below) for\nthe handling of parameters (i.e.  missing parameters).\n\nWhen the == and != operators are used, the string to the right of the operator is  considered\na  pattern  and  matched according to the rules described below under Pattern Matching, as if\nthe extglob shell option were enabled.  The = operator is equivalent to ==.  If  the  nocase‐‐\nmatch  shell  option  is enabled, the match is performed without regard to the case of alpha‐\nbetic characters.  The return value is 0 if the string matches (==) or does  not  match  (!=)\nthe pattern, and 1 otherwise.  Any part of the pattern may be quoted to force the quoted por‐\ntion to be matched as a string.\n\nAn additional binary operator, =~, is available, with the same precedence as == and !=.  When\nit  is  used,  the string to the right of the operator is considered a POSIX extended regular\nexpression and matched accordingly (using the POSIX regcomp and  regexec  interfaces  usually\ndescribed  in regex(3)).  The return value is 0 if the string matches the pattern, and 1 oth‐\nerwise.  If the regular expression is syntactically incorrect, the  conditional  expression's\nreturn  value is 2.  If the nocasematch shell option is enabled, the match is performed with‐\nout regard to the case of alphabetic characters.  Any part of the pattern may  be  quoted  to\nforce  the  quoted portion to be matched as a string.  Bracket expressions in regular expres‐\nsions must be treated carefully, since normal quoting characters lose their meanings  between\nbrackets.   If  the  pattern  is  stored  in a shell variable, quoting the variable expansion\nforces the entire pattern to be matched as a string.\n\nThe pattern will match if it matches any part of the string.  Anchor the pattern using the  ^\nand  $  regular expression operators to force it to match the entire string.  The array vari‐\nable BASHREMATCH records which parts of the string matched  the  pattern.   The  element  of\nBASHREMATCH  with index 0 contains the portion of the string matching the entire regular ex‐\npression.  Substrings matched by parenthesized subexpressions within the  regular  expression\nare  saved in the remaining BASHREMATCH indices. The element of BASHREMATCH with index n is\nthe portion of the string matching the nth parenthesized subexpression.\n\nExpressions may be combined using the following operators,  listed  in  decreasing  order  of\nprecedence:\n\n( expression )\nReturns  the  value  of  expression.   This  may be used to override the normal\nprecedence of operators.\n! expression\nTrue if expression is false.\nexpression1 && expression2\nTrue if both expression1 and expression2 are true.\nexpression1 || expression2\nTrue if either expression1 or expression2 is true.\n\nThe && and || operators do not evaluate expression2 if the  value  of  expression1  is\nsufficient to determine the return value of the entire conditional expression.\n\nfor name [ [ in [ word ... ] ] ; ] do list ; done\nThe  list of words following in is expanded, generating a list of items.  The variable\nname is set to each element of this list in turn, and list is executed each time.   If\nthe in word is omitted, the for command executes list once for each positional parame‐\nter that is set (see PARAMETERS below).  The return status is the exit status  of  the\nlast  command that executes.  If the expansion of the items following in results in an\nempty list, no commands are executed, and the return status is 0.\n\nfor (( expr1 ; expr2 ; expr3 )) ; do list ; done\nFirst, the arithmetic expression expr1 is evaluated according to the  rules  described\nbelow  under ARITHMETIC EVALUATION.  The arithmetic expression expr2 is then evaluated\nrepeatedly until it evaluates to zero.  Each time expr2 evaluates to a non-zero value,\nlist  is executed and the arithmetic expression expr3 is evaluated.  If any expression\nis omitted, it behaves as if it evaluates to 1.  The return value is the  exit  status\nof  the  last  command in list that is executed, or false if any of the expressions is\ninvalid.\n\nselect name [ in word ] ; do list ; done\nThe list of words following in is expanded, generating a list of items.   The  set  of\nexpanded words is printed on the standard error, each preceded by a number.  If the in\nword is omitted, the positional parameters are printed (see  PARAMETERS  below).   The\nPS3  prompt  is  then  displayed and a line read from the standard input.  If the line\nconsists of a number corresponding to one of the displayed words, then  the  value  of\nname  is  set  to that word.  If the line is empty, the words and prompt are displayed\nagain.  If EOF is read, the command completes.  Any other value read causes name to be\nset  to null.  The line read is saved in the variable REPLY.  The list is executed af‐\nter each selection until a break command is executed.  The exit status  of  select  is\nthe exit status of the last command executed in list, or zero if no commands were exe‐\ncuted.\n\ncase word in [ [(] pattern [ | pattern ] ... ) list ;; ] ... esac\nA case command first expands word, and tries to match it against each pattern in turn,\nusing the matching rules described under Pattern Matching below.  The word is expanded\nusing tilde expansion, parameter and variable expansion, arithmetic expansion, command\nsubstitution,  process  substitution  and quote removal.  Each pattern examined is ex‐\npanded using tilde expansion, parameter and variable expansion, arithmetic  expansion,\ncommand  substitution,  and  process substitution.  If the nocasematch shell option is\nenabled, the match is performed without regard to the case of  alphabetic  characters.\nWhen  a  match  is  found,  the corresponding list is executed.  If the ;; operator is\nused, no subsequent matches are attempted after the first pattern match.  Using ;&  in\nplace of ;; causes execution to continue with the list associated with the next set of\npatterns.  Using ;;& in place of ;; causes the shell to test the next pattern list  in\nthe statement, if any, and execute any associated list on a successful match, continu‐\ning the case statement execution as if the pattern list had  not  matched.   The  exit\nstatus  is  zero  if no pattern matches.  Otherwise, it is the exit status of the last\ncommand executed in list.\n\nif list; then list; [ elif list; then list; ] ... [ else list; ] fi\nThe if list is executed.  If its exit status is zero, the then list is executed.  Oth‐\nerwise, each elif list is executed in turn, and if its exit status is zero, the corre‐\nsponding then list is executed and the command completes.  Otherwise, the else list is\nexecuted,  if  present.   The  exit status is the exit status of the last command exe‐\ncuted, or zero if no condition tested true.\n\nwhile list-1; do list-2; done\nuntil list-1; do list-2; done\nThe while command continuously executes the list list-2 as long as the last command in\nthe list list-1 returns an exit status of zero.  The until command is identical to the\nwhile command, except that the test is negated: list-2 is executed as long as the last\ncommand  in  list-1  returns a non-zero exit status.  The exit status of the while and\nuntil commands is the exit status of the last command executed in list-2, or  zero  if\nnone was executed.\n\n#### Coprocesses\n\nA coprocess is a shell command preceded by the coproc reserved word.  A coprocess is executed\nasynchronously in a subshell, as if the command had been terminated with the & control opera‐\ntor, with a two-way pipe established between the executing shell and the coprocess.\n\nThe format for a coprocess is:\n\ncoproc [NAME] command [redirections]\n\nThis  creates  a  coprocess named NAME.  If NAME is not supplied, the default name is COPROC.\nNAME must not be supplied if command is a simple command (see above); otherwise, it is inter‐\npreted  as  the  first word of the simple command.  When the coprocess is executed, the shell\ncreates an array variable (see Arrays below) named NAME  in  the  context  of  the  executing\nshell.   The  standard  output of command is connected via a pipe to a file descriptor in the\nexecuting shell, and that file descriptor is assigned to NAME[0].  The standard input of com‐\nmand  is  connected via a pipe to a file descriptor in the executing shell, and that file de‐\nscriptor is assigned to NAME[1].  This pipe is established before any redirections  specified\nby the command (see REDIRECTION below).  The file descriptors can be utilized as arguments to\nshell commands and redirections using standard word expansions.  Other than those created  to\nexecute  command  and  process  substitutions, the file descriptors are not available in sub‐\nshells.  The process ID of the shell spawned to execute the coprocess  is  available  as  the\nvalue  of the variable NAMEPID.  The wait builtin command may be used to wait for the copro‐\ncess to terminate.\n\nSince the coprocess is created as an asynchronous command, the coproc command always  returns\nsuccess.  The return status of a coprocess is the exit status of command.\n\n#### Shell Function Definitions\n\nA  shell  function  is an object that is called like a simple command and executes a compound\ncommand with a new set of positional parameters.  Shell functions are declared as follows:\n\nfname () compound-command [redirection]\nfunction fname [()] compound-command [redirection]\nThis defines a function named fname.  The reserved word function is optional.  If  the\nfunction  reserved  word  is  supplied, the parentheses are optional.  The body of the\nfunction is the compound command compound-command (see Compound Commands above).  That\ncommand  is  usually a list of commands between { and }, but may be any command listed\nunder Compound Commands above, with one exception: If the function  reserved  word  is\nused, but the parentheses are not supplied, the braces are required.  compound-command\nis executed whenever fname is specified as the name of  a  simple  command.   When  in\nposix  mode,  fname  must  be a valid shell name and may not be the name of one of the\nPOSIX special builtins.  In default mode, a function name can be  any  unquoted  shell\nword that does not contain $.  Any redirections (see REDIRECTION below) specified when\na function is defined are performed when the function is executed.  The exit status of\na function definition is zero unless a syntax error occurs or a readonly function with\nthe same name already exists.  When executed, the exit status of  a  function  is  the\nexit status of the last command executed in the body.  (See FUNCTIONS below.)\n\n### COMMENTS\n\nIn  a non-interactive shell, or an interactive shell in which the interactivecomments option\nto the shopt builtin is enabled (see SHELL BUILTIN COMMANDS below), a word beginning  with  #\ncauses  that  word  and  all remaining characters on that line to be ignored.  An interactive\nshell without the interactivecomments option enabled does not allow comments.  The  interac‐‐\ntivecomments option is on by default in interactive shells.\n\n### QUOTING\n\nQuoting  is  used  to remove the special meaning of certain characters or words to the shell.\nQuoting can be used to disable special treatment for special characters, to prevent  reserved\nwords from being recognized as such, and to prevent parameter expansion.\n\nEach  of  the  metacharacters listed above under DEFINITIONS has special meaning to the shell\nand must be quoted if it is to represent itself.\n\nWhen the command history expansion facilities are being used (see HISTORY  EXPANSION  below),\nthe history expansion character, usually !, must be quoted to prevent history expansion.\n\nThere are three quoting mechanisms: the escape character, single quotes, and double quotes.\n\nA  non-quoted  backslash  (\\) is the escape character.  It preserves the literal value of the\nnext character that follows, with the exception of <newline>.  If a \\<newline> pair  appears,\nand  the  backslash  is  not  itself quoted, the \\<newline> is treated as a line continuation\n(that is, it is removed from the input stream and effectively ignored).\n\nEnclosing characters in single quotes preserves the literal value of  each  character  within\nthe  quotes.   A  single  quote  may not occur between single quotes, even when preceded by a\nbackslash.\n\nEnclosing characters in double quotes preserves the literal value of  all  characters  within\nthe  quotes,  with the exception of $, `, \\, and, when history expansion is enabled, !.  When\nthe shell is in posix mode, the ! has no special meaning within double quotes, even when his‐\ntory expansion is enabled.  The characters $ and ` retain their special meaning within double\nquotes.  The backslash retains its special meaning only when followed by one of the following\ncharacters:  $,  `, \", \\, or <newline>.  A double quote may be quoted within double quotes by\npreceding it with a backslash.  If enabled, history expansion will be performed unless  an  !\nappearing  in  double quotes is escaped using a backslash.  The backslash preceding the !  is\nnot removed.\n\nThe special parameters * and @ have special meaning when in double quotes (see PARAMETERS be‐\nlow).\n\nWords  of  the  form $'string' are treated specially.  The word expands to string, with back‐\nslash-escaped characters replaced as specified by the ANSI C standard.  Backslash escape  se‐\nquences, if present, are decoded as follows:\n\\a     alert (bell)\n\\b     backspace\n\\e\n\\E     an escape character\n\\f     form feed\n\\n     new line\n\\r     carriage return\n\\t     horizontal tab\n\\v     vertical tab\n\\\\     backslash\n\\'     single quote\n\\\"     double quote\n\\?     question mark\n\\nnn   the  eight-bit character whose value is the octal value nnn (one to three octal\ndigits)\n\\xHH   the eight-bit character whose value is the hexadecimal value HH (one or two hex\ndigits)\n\\uHHHH the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH\n(one to four hex digits)\n\\UHHHHHHHH\nthe Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHH‐\nHHHHH (one to eight hex digits)\n\\cx    a control-x character\n\nThe expanded result is single-quoted, as if the dollar sign had not been present.\n\nA  double-quoted  string  preceded  by  a dollar sign ($\"string\") will cause the string to be\ntranslated according to the current locale.  The gettext infrastructure performs the  message\ncatalog lookup and translation, using the LCMESSAGES and TEXTDOMAIN shell variables.  If the\ncurrent locale is C or POSIX, or if there are no translations available, the dollar  sign  is\nignored.  If the string is translated and replaced, the replacement is double-quoted.\n\n### PARAMETERS\n\nA  parameter is an entity that stores values.  It can be a name, a number, or one of the spe‐\ncial characters listed below under Special Parameters.  A variable is a parameter denoted  by\na  name.   A variable has a value and zero or more attributes.  Attributes are assigned using\nthe declare builtin command (see declare below in SHELL BUILTIN COMMANDS).\n\nA parameter is set if it has been assigned a value.  The null string is a valid value.   Once\na variable is set, it may be unset only by using the unset builtin command (see SHELL BUILTIN\nCOMMANDS below).\n\nA variable may be assigned to by a statement of the form\n\nname=[value]\n\nIf value is not given, the variable is assigned the null string.  All  values  undergo  tilde\nexpansion,  parameter and variable expansion, command substitution, arithmetic expansion, and\nquote removal (see EXPANSION below).  If the variable has its  integer  attribute  set,  then\nvalue  is  evaluated  as  an arithmetic expression even if the $((...)) expansion is not used\n(see Arithmetic Expansion below).  Word splitting is not performed,  with  the  exception  of\n\"$@\"  as explained below under Special Parameters.  Pathname expansion is not performed.  As‐\nsignment statements may also appear as arguments to  the  alias,  declare,  typeset,  export,\nreadonly,  and  local  builtin  commands  (declaration  commands).  When in posix mode, these\nbuiltins may appear in a command after one or more instances of the command builtin  and  re‐\ntain these assignment statement properties.\n\nIn  the context where an assignment statement is assigning a value to a shell variable or ar‐\nray index, the += operator can be used to append to or add to the variable's previous  value.\nThis includes arguments to builtin commands such as declare that accept assignment statements\n(declaration commands).  When += is applied to a variable for which the integer attribute has\nbeen  set, value is evaluated as an arithmetic expression and added to the variable's current\nvalue, which is also evaluated.  When += is applied to an array variable using  compound  as‐\nsignment  (see  Arrays below), the variable's value is not unset (as it is when using =), and\nnew values are appended to the array beginning at one greater than the array's maximum  index\n(for  indexed  arrays)  or added as additional key-value pairs in an associative array.  When\napplied to a string-valued variable, value is expanded and appended to the variable's value.\n\nA variable can be assigned the nameref attribute using the -n option to the declare or  local\nbuiltin  commands (see the descriptions of declare and local below) to create a nameref, or a\nreference to another variable.  This allows variables to be manipulated indirectly.  Whenever\nthe nameref variable is referenced, assigned to, unset, or has its attributes modified (other\nthan using or changing the nameref attribute itself), the operation is actually performed  on\nthe  variable  specified  by the nameref variable's value.  A nameref is commonly used within\nshell functions to refer to a variable whose name is passed as an argument to  the  function.\nFor instance, if a variable name is passed to a shell function as its first argument, running\ndeclare -n ref=$1\ninside the function creates a nameref variable ref whose value is the variable name passed as\nthe first argument.  References and assignments to ref, and changes to  its  attributes,  are\ntreated  as  references,  assignments, and attribute modifications to the variable whose name\nwas passed as $1.  If the control variable in a for loop has the nameref attribute, the  list\nof  words can be a list of shell variables, and a name reference will be established for each\nword in the list, in turn, when the loop is executed.  Array variables cannot  be  given  the\nnameref  attribute.  However, nameref variables can reference array variables and subscripted\narray variables.  Namerefs can be unset using the -n option to the unset builtin.  Otherwise,\nif  unset is executed with the name of a nameref variable as an argument, the variable refer‐\nenced by the nameref variable will be unset.\n\n#### Positional Parameters\n\nA positional parameter is a parameter denoted by one or more digits, other  than  the  single\ndigit  0.   Positional parameters are assigned from the shell's arguments when it is invoked,\nand may be reassigned using the set builtin command.  Positional parameters may  not  be  as‐\nsigned  to  with  assignment  statements.  The positional parameters are temporarily replaced\nwhen a shell function is executed (see FUNCTIONS below).\n\nWhen a positional parameter consisting of more than a single digit is expanded,  it  must  be\nenclosed in braces (see EXPANSION below).\n\n#### Special Parameters\n\nThe  shell treats several parameters specially.  These parameters may only be referenced; as‐\nsignment to them is not allowed.\n*      Expands to the positional parameters, starting from one.  When the  expansion  is  not\nwithin  double  quotes, each positional parameter expands to a separate word.  In con‐\ntexts where it is performed, those words are subject to  further  word  splitting  and\npathname  expansion.   When the expansion occurs within double quotes, it expands to a\nsingle word with the value of each parameter separated by the first character  of  the\nIFS  special  variable.   That  is,  \"$*\" is equivalent to \"$1c$2c...\", where c is the\nfirst character of the value of the IFS variable.  If IFS is unset, the parameters are\nseparated  by  spaces.   If IFS is null, the parameters are joined without intervening\nseparators.\n@      Expands to the positional parameters, starting  from  one.   In  contexts  where  word\nsplitting  is performed, this expands each positional parameter to a separate word; if\nnot within double quotes, these words are subject  to  word  splitting.   In  contexts\nwhere  word  splitting is not performed, this expands to a single word with each posi‐\ntional parameter separated by a  space.   When  the  expansion  occurs  within  double\nquotes,  each  parameter  expands  to a separate word.  That is, \"$@\" is equivalent to\n\"$1\" \"$2\" ...  If the double-quoted expansion occurs within a word, the  expansion  of\nthe  first  parameter  is joined with the beginning part of the original word, and the\nexpansion of the last parameter is joined with the last part  of  the  original  word.\nWhen there are no positional parameters, \"$@\" and $@ expand to nothing (i.e., they are\nremoved).\n#      Expands to the number of positional parameters in decimal.\n?      Expands to the exit status of the most recently executed foreground pipeline.\n-      Expands to the current option flags as specified upon invocation, by the  set  builtin\ncommand, or those set by the shell itself (such as the -i option).\n$      Expands  to  the process ID of the shell.  In a () subshell, it expands to the process\nID of the current shell, not the subshell.\n!      Expands to the process ID of the job most recently placed into the background, whether\nexecuted as an asynchronous command or using the bg builtin (see JOB CONTROL below).\n0      Expands  to  the  name of the shell or shell script.  This is set at shell initializa‐\ntion.  If bash is invoked with a file of commands, $0 is set to the name of that file.\nIf  bash is started with the -c option, then $0 is set to the first argument after the\nstring to be executed, if one is present.  Otherwise, it is set to the  filename  used\nto invoke bash, as given by argument zero.\n\n#### Shell Variables\n\nThe following variables are set by the shell:\n\nAt  shell  startup, set to the pathname used to invoke the shell or shell script being\nexecuted as passed in the environment or argument list.  Subsequently, expands to  the\nlast  argument to the previous simple command executed in the foreground, after expan‐\nsion.  Also set to the full pathname used to invoke each command executed  and  placed\nin the environment exported to that command.  When checking mail, this parameter holds\nthe name of the mail file currently being checked.\nBASH   Expands to the full filename used to invoke this instance of bash.\nBASHOPTS\nA colon-separated list of enabled shell options.  Each word in the list is a valid ar‐\ngument  for the -s option to the shopt builtin command (see SHELL BUILTIN COMMANDS be‐\nlow).  The options appearing in BASHOPTS are those reported as on by shopt.   If  this\nvariable is in the environment when bash starts up, each shell option in the list will\nbe enabled before reading any startup files.  This variable is read-only.\nBASHPID\nExpands to the process ID of the current bash process.  This  differs  from  $$  under\ncertain  circumstances,  such  as subshells that do not require bash to be re-initial‐\nized.  Assignments to BASHPID have no effect.  If BASHPID is unset, it loses its  spe‐\ncial properties, even if it is subsequently reset.\nBASHALIASES\nAn associative array variable whose members correspond to the internal list of aliases\nas maintained by the alias builtin.  Elements added to this array appear in the  alias\nlist; however, unsetting array elements currently does not cause aliases to be removed\nfrom the alias list.  If BASHALIASES is unset, it loses its special properties,  even\nif it is subsequently reset.\nBASHARGC\nAn  array variable whose values are the number of parameters in each frame of the cur‐\nrent bash execution call stack.  The number of parameters to  the  current  subroutine\n(shell function or script executed with . or source) is at the top of the stack.  When\na subroutine is executed, the number of parameters passed is  pushed  onto  BASHARGC.\nThe  shell sets BASHARGC only when in extended debugging mode (see the description of\nthe extdebug option to the shopt builtin below).  Setting extdebug after the shell has\nstarted  to  execute  a script, or referencing this variable when extdebug is not set,\nmay result in inconsistent values.\nBASHARGV\nAn array variable containing all of the parameters in the current bash execution  call\nstack.   The  final  parameter of the last subroutine call is at the top of the stack;\nthe first parameter of the initial call is at the bottom.  When a subroutine  is  exe‐\ncuted,  the  parameters  supplied are pushed onto BASHARGV.  The shell sets BASHARGV\nonly when in extended debugging mode (see the description of the  extdebug  option  to\nthe  shopt  builtin below).  Setting extdebug after the shell has started to execute a\nscript, or referencing this variable when extdebug is not set, may result in inconsis‐\ntent values.\nBASHARGV0\nWhen referenced, this variable expands to the name of the shell or shell script (iden‐\ntical to $0; see the  description  of  special  parameter  0  above).   Assignment  to\nBASHARGV0  causes the value assigned to also be assigned to $0.  If BASHARGV0 is un‐\nset, it loses its special properties, even if it is subsequently reset.\nBASHCMDS\nAn associative array variable whose members correspond to the internal hash  table  of\ncommands  as  maintained  by the hash builtin.  Elements added to this array appear in\nthe hash table; however, unsetting array elements currently  does  not  cause  command\nnames  to be removed from the hash table.  If BASHCMDS is unset, it loses its special\nproperties, even if it is subsequently reset.\nBASHCOMMAND\nThe command currently being executed or about to be executed, unless the shell is exe‐\ncuting a command as the result of a trap, in which case it is the command executing at\nthe time of the trap.  If BASHCOMMAND is unset, it loses its special properties, even\nif it is subsequently reset.\nBASHEXECUTIONSTRING\nThe command argument to the -c invocation option.\nBASHLINENO\nAn array variable whose members are the line numbers in source files where each corre‐\nsponding member of FUNCNAME was invoked.  ${BASHLINENO[$i]} is the line number in the\nsource    file   (${BASHSOURCE[$i+1]})   where   ${FUNCNAME[$i]}   was   called   (or\n${BASHLINENO[$i-1]} if referenced within another shell function).  Use LINENO to  ob‐\ntain the current line number.\nBASHLOADABLESPATH\nA  colon-separated  list of directories in which the shell looks for dynamically load‐\nable builtins specified by the enable command.\nBASHREMATCH\nAn array variable whose members are assigned by the =~ binary operator to the [[  con‐\nditional  command.  The element with index 0 is the portion of the string matching the\nentire regular expression.  The element with index n is  the  portion  of  the  string\nmatching the nth parenthesized subexpression.\nBASHSOURCE\nAn array variable whose members are the source filenames where the corresponding shell\nfunction names in the FUNCNAME array variable are defined.  The shell function ${FUNC‐‐\nNAME[$i]}    is   defined   in   the   file   ${BASHSOURCE[$i]}   and   called   from\n${BASHSOURCE[$i+1]}.\nBASHSUBSHELL\nIncremented by one within each subshell or subshell environment when the shell  begins\nexecuting in that environment.  The initial value is 0.  If BASHSUBSHELL is unset, it\nloses its special properties, even if it is subsequently reset.\nBASHVERSINFO\nA readonly array variable whose members hold version information for this instance  of\nbash.  The values assigned to the array members are as follows:\nBASHVERSINFO[0]        The major version number (the release).\nBASHVERSINFO[1]        The minor version number (the version).\nBASHVERSINFO[2]        The patch level.\nBASHVERSINFO[3]        The build version.\nBASHVERSINFO[4]        The release status (e.g., beta1).\nBASHVERSINFO[5]        The value of MACHTYPE.\nBASHVERSION\nExpands to a string describing the version of this instance of bash.\nCOMPCWORD\nAn  index into ${COMPWORDS} of the word containing the current cursor position.  This\nvariable is available only in shell functions invoked by the  programmable  completion\nfacilities (see Programmable Completion below).\nCOMPKEY\nThe  key  (or final key of a key sequence) used to invoke the current completion func‐\ntion.\nCOMPLINE\nThe current command line.  This variable is available only in shell functions and  ex‐\nternal  commands  invoked  by the programmable completion facilities (see Programmable\nCompletion below).\nCOMPPOINT\nThe index of the current cursor position relative to the beginning of the current com‐\nmand.   If the current cursor position is at the end of the current command, the value\nof this variable is equal to ${#COMPLINE}.  This variable is available only in  shell\nfunctions and external commands invoked by the programmable completion facilities (see\nProgrammable Completion below).\nCOMPTYPE\nSet to an integer value corresponding to the type of completion attempted that  caused\na completion function to be called: TAB, for normal completion, ?, for listing comple‐\ntions after successive tabs, !, for listing alternatives on partial  word  completion,\n@, to list completions if the word is not unmodified, or %, for menu completion.  This\nvariable is available only in shell functions and external  commands  invoked  by  the\nprogrammable completion facilities (see Programmable Completion below).\nCOMPWORDBREAKS\nThe  set  of  characters that the readline library treats as word separators when per‐\nforming word completion.  If COMPWORDBREAKS is unset, it loses  its  special  proper‐\nties, even if it is subsequently reset.\nCOMPWORDS\nAn array variable (see Arrays below) consisting of the individual words in the current\ncommand line.  The line is  split  into  words  as  readline  would  split  it,  using\nCOMPWORDBREAKS  as  described  above.  This variable is available only in shell func‐\ntions invoked by the programmable completion facilities (see  Programmable  Completion\nbelow).\nCOPROC An  array  variable (see Arrays below) created to hold the file descriptors for output\nfrom and input to an unnamed coprocess (see Coprocesses above).\nDIRSTACK\nAn array variable (see Arrays below) containing the current contents of the  directory\nstack.   Directories  appear  in the stack in the order they are displayed by the dirs\nbuiltin.  Assigning to members of this array variable may be used to  modify  directo‐\nries already in the stack, but the pushd and popd builtins must be used to add and re‐\nmove directories.  Assignment to this variable will not change the current  directory.\nIf  DIRSTACK is unset, it loses its special properties, even if it is subsequently re‐\nset.\nEPOCHREALTIME\nEach time this parameter is referenced, it expands to the number of seconds since  the\nUnix Epoch (see time(3)) as a floating point value with micro-second granularity.  As‐\nsignments to EPOCHREALTIME are ignored.  If EPOCHREALTIME is unset, it loses its  spe‐\ncial properties, even if it is subsequently reset.\nEPOCHSECONDS\nEach  time this parameter is referenced, it expands to the number of seconds since the\nUnix Epoch (see time(3)).  Assignments to EPOCHSECONDS are ignored.   If  EPOCHSECONDS\nis unset, it loses its special properties, even if it is subsequently reset.\nEUID   Expands  to  the  effective user ID of the current user, initialized at shell startup.\nThis variable is readonly.\nFUNCNAME\nAn array variable containing the names of all shell functions currently in the  execu‐\ntion  call  stack.   The  element  with index 0 is the name of any currently-executing\nshell function.  The bottom-most element (the one with the highest index)  is  \"main\".\nThis variable exists only when a shell function is executing.  Assignments to FUNCNAME\nhave no effect.  If FUNCNAME is unset, it loses its special properties, even if it  is\nsubsequently reset.\n\nThis  variable can be used with BASHLINENO and BASHSOURCE.  Each element of FUNCNAME\nhas corresponding elements in BASHLINENO and BASHSOURCE to describe the call  stack.\nFor  instance,  ${FUNCNAME[$i]}  was called from the file ${BASHSOURCE[$i+1]} at line\nnumber ${BASHLINENO[$i]}.  The caller builtin displays the current call  stack  using\nthis information.\nGROUPS An array variable containing the list of groups of which the current user is a member.\nAssignments to GROUPS have no effect.  If GROUPS is unset, it loses its special  prop‐\nerties, even if it is subsequently reset.\nHISTCMD\nThe history number, or index in the history list, of the current command.  Assignments\nto HISTCMD are ignored.  If HISTCMD is unset, it loses its special properties, even if\nit is subsequently reset.\nHOSTNAME\nAutomatically set to the name of the current host.\nHOSTTYPE\nAutomatically  set  to  a  string that uniquely describes the type of machine on which\nbash is executing.  The default is system-dependent.\nLINENO Each time this parameter is referenced, the shell substitutes a decimal number  repre‐\nsenting  the current sequential line number (starting with 1) within a script or func‐\ntion.  When not in a script or function, the value substituted is not guaranteed to be\nmeaningful.  If LINENO is unset, it loses its special properties, even if it is subse‐\nquently reset.\nMACHTYPE\nAutomatically set to a string that fully describes the system type on  which  bash  is\nexecuting,  in  the standard GNU cpu-company-system format.  The default is system-de‐\npendent.\nMAPFILE\nAn array variable (see Arrays below) created to hold the  text  read  by  the  mapfile\nbuiltin when no variable name is supplied.\nOLDPWD The previous working directory as set by the cd command.\nOPTARG The  value  of  the last option argument processed by the getopts builtin command (see\nSHELL BUILTIN COMMANDS below).\nOPTIND The index of the next argument to be processed by the  getopts  builtin  command  (see\nSHELL BUILTIN COMMANDS below).\nOSTYPE Automatically set to a string that describes the operating system on which bash is ex‐\necuting.  The default is system-dependent.\nPIPESTATUS\nAn array variable (see Arrays below) containing a list of exit status values from  the\nprocesses  in the most-recently-executed foreground pipeline (which may contain only a\nsingle command).\nPPID   The process ID of the shell's parent.  This variable is readonly.\nPWD    The current working directory as set by the cd command.\nRANDOM Each time this parameter is referenced, it expands to a random integer between  0  and\n32767.   Assigning  a  value to RANDOM initializes (seeds) the sequence of random num‐\nbers.  If RANDOM is unset, it loses its special properties, even if it is subsequently\nreset.\nREADLINELINE\nThe  contents  of  the readline line buffer, for use with \"bind -x\" (see SHELL BUILTIN\nCOMMANDS below).\nREADLINEMARK\nThe position of the mark (saved insertion point) in the readline line buffer, for  use\nwith  \"bind -x\" (see SHELL BUILTIN COMMANDS below).  The characters between the inser‐\ntion point and the mark are often called the region.\nREADLINEPOINT\nThe position of the insertion point in the readline line buffer, for  use  with  \"bind\n-x\" (see SHELL BUILTIN COMMANDS below).\nREPLY  Set  to  the line of input read by the read builtin command when no arguments are sup‐\nplied.\nSECONDS\nEach time this parameter is referenced, the number of seconds since  shell  invocation\nis  returned.   If  a value is assigned to SECONDS, the value returned upon subsequent\nreferences is the number of seconds since the assignment plus the value assigned.  The\nnumber  of  seconds  at  shell invocation and the current time is always determined by\nquerying the system clock.  If SECONDS is unset, it loses its special properties, even\nif it is subsequently reset.\nSHELLOPTS\nA colon-separated list of enabled shell options.  Each word in the list is a valid ar‐\ngument for the -o option to the set builtin command (see SHELL  BUILTIN  COMMANDS  be‐\nlow).  The options appearing in SHELLOPTS are those reported as on by set -o.  If this\nvariable is in the environment when bash starts up, each shell option in the list will\nbe enabled before reading any startup files.  This variable is read-only.\nSHLVL  Incremented by one each time an instance of bash is started.\nSRANDOM\nThis variable expands to a 32-bit pseudo-random number each time it is referenced. The\nrandom number generator is not linear on systems that support /dev/urandom or arc4ran‐\ndom,  so  each  returned  number has no relationship to the numbers preceding it.  The\nrandom number generator cannot be seeded, so assignments to this variable have no  ef‐\nfect.   If  SRANDOM  is  unset,  it loses its special properties, even if it is subse‐\nquently reset.\nUID    Expands to the user ID of the current user, initialized at shell startup.  This  vari‐\nable is readonly.\n\nThe  following  variables are used by the shell.  In some cases, bash assigns a default value\nto a variable; these cases are noted below.\n\nBASHCOMPAT\nThe value is used to set the shell's compatibility  level.   See  SHELL  COMPATIBILITY\nMODE  below  for  a description of the various compatibility levels and their effects.\nThe value may be a decimal number (e.g., 4.2) or an integer (e.g.,  42)  corresponding\nto  the  desired  compatibility  level.   If  BASHCOMPAT is unset or set to the empty\nstring, the compatibility level is set to the default for  the  current  version.   If\nBASHCOMPAT  is  set to a value that is not one of the valid compatibility levels, the\nshell prints an error message and sets the compatibility level to the default for  the\ncurrent  version.   The  valid values correspond to the compatibility levels described\nbelow under BSHELLCOMPATIBILITYMODE.  For example, 4.2 and 42 are  valid  values  that\ncorrespond  to  the  compat42 shopt option and set the compatibility level to 42.  The\ncurrent version is also a valid value.\nBASHENV\nIf this parameter is set when bash is executing a shell script, its  value  is  inter‐\npreted  as  a  filename  containing commands to initialize the shell, as in ~/.bashrc.\nThe value of BASHENV is subjected to parameter expansion, command  substitution,  and\narithmetic  expansion  before  being  interpreted  as a filename.  PATH is not used to\nsearch for the resultant filename.\nBASHXTRACEFD\nIf set to an integer corresponding to a valid file descriptor,  bash  will  write  the\ntrace  output  generated when set -x is enabled to that file descriptor.  The file de‐\nscriptor is closed when BASHXTRACEFD is unset or assigned  a  new  value.   Unsetting\nBASHXTRACEFD  or  assigning it the empty string causes the trace output to be sent to\nthe standard error.  Note that setting BASHXTRACEFD to 2 (the standard error file de‐\nscriptor) and then unsetting it will result in the standard error being closed.\nCDPATH The  search path for the cd command.  This is a colon-separated list of directories in\nwhich the shell looks for destination directories specified by the cd command.  A sam‐\nple value is \".:~:/usr\".\nCHILDMAX\nSet the number of exited child status values for the shell to remember.  Bash will not\nallow this value to be decreased below a POSIX-mandated minimum, and there is a  maxi‐\nmum  value (currently 8192) that this may not exceed.  The minimum value is system-de‐\npendent.\nCOLUMNS\nUsed by the select compound command to determine the terminal width when printing  se‐\nlection  lists.   Automatically set if the checkwinsize option is enabled or in an in‐\nteractive shell upon receipt of a SIGWINCH.\nCOMPREPLY\nAn array variable from which bash reads the possible completions generated by a  shell\nfunction  invoked by the programmable completion facility (see Programmable Completion\nbelow).  Each array element contains one possible completion.\nEMACS  If bash finds this variable in the environment when the shell starts with  value  \"t\",\nit  assumes that the shell is running in an Emacs shell buffer and disables line edit‐\ning.\nENV    Expanded and executed similarly to BASHENV (see INVOCATION above) when an interactive\nshell is invoked in posix mode.\nEXECIGNORE\nA  colon-separated  list of shell patterns (see Pattern Matching) defining the list of\nfilenames to be ignored by command search using  PATH.   Files  whose  full  pathnames\nmatch  one  of  these patterns are not considered executable files for the purposes of\ncompletion and command execution via PATH lookup.  This does not affect  the  behavior\nof  the  [,  test,  and [[ commands.  Full pathnames in the command hash table are not\nsubject to EXECIGNORE.  Use this variable to ignore shared library files that have the\nexecutable  bit  set,  but  are not executable files.  The pattern matching honors the\nsetting of the extglob shell option.\nFCEDIT The default editor for the fc builtin command.\nFIGNORE\nA colon-separated list of suffixes to ignore when performing filename completion  (see\nREADLINE below).  A filename whose suffix matches one of the entries in FIGNORE is ex‐\ncluded from the list of matched filenames.  A  sample  value  is  \".o:~\"  (Quoting  is\nneeded when assigning a value to this variable, which contains tildes).\nFUNCNEST\nIf  set  to  a numeric value greater than 0, defines a maximum function nesting level.\nFunction invocations that exceed this nesting level will cause the current command  to\nabort.\nGLOBIGNORE\nA  colon-separated  list  of  patterns defining the set of file names to be ignored by\npathname expansion.  If a file name matched  by  a  pathname  expansion  pattern  also\nmatches one of the patterns in GLOBIGNORE, it is removed from the list of matches.\nHISTCONTROL\nA  colon-separated  list  of  values controlling how commands are saved on the history\nlist.  If the list of values includes ignorespace, lines  which  begin  with  a  space\ncharacter  are  not  saved  in  the  history list.  A value of ignoredups causes lines\nmatching the previous history entry to not be saved.  A value of ignoreboth is  short‐\nhand  for  ignorespace and ignoredups.  A value of erasedups causes all previous lines\nmatching the current line to be removed from the history  list  before  that  line  is\nsaved.   Any value not in the above list is ignored.  If HISTCONTROL is unset, or does\nnot include a valid value, all lines read by the shell parser are saved on the history\nlist, subject to the value of HISTIGNORE.  The second and subsequent lines of a multi-\nline compound command are not tested, and are added to the history regardless  of  the\nvalue of HISTCONTROL.\nHISTFILE\nThe  name  of the file in which command history is saved (see HISTORY below).  The de‐\nfault value is ~/.bashhistory.  If unset, the command history is  not  saved  when  a\nshell exits.\nHISTFILESIZE\nThe  maximum number of lines contained in the history file.  When this variable is as‐\nsigned a value, the history file is truncated, if necessary, to contain no  more  than\nthat  number  of lines by removing the oldest entries.  The history file is also trun‐\ncated to this size after writing it when a shell exits.  If the value is 0,  the  his‐\ntory  file is truncated to zero size.  Non-numeric values and numeric values less than\nzero inhibit truncation.  The shell sets the default value to the  value  of  HISTSIZE\nafter reading any startup files.\nHISTIGNORE\nA  colon-separated list of patterns used to decide which command lines should be saved\non the history list.  Each pattern is anchored at the beginning of the line  and  must\nmatch the complete line (no implicit `*' is appended).  Each pattern is tested against\nthe line after the checks specified by HISTCONTROL are applied.  In  addition  to  the\nnormal  shell pattern matching characters, `&' matches the previous history line.  `&'\nmay be escaped using a backslash; the backslash is removed before attempting a  match.\nThe  second  and subsequent lines of a multi-line compound command are not tested, and\nare added to the history regardless of the value of HISTIGNORE.  The pattern  matching\nhonors the setting of the extglob shell option.\nHISTSIZE\nThe number of commands to remember in the command history (see HISTORY below).  If the\nvalue is 0, commands are not saved in the history list.  Numeric values less than zero\nresult  in  every  command  being  saved on the history list (there is no limit).  The\nshell sets the default value to 500 after reading any startup files.\nHISTTIMEFORMAT\nIf this variable is set and not null, its value is used as a format string  for  strf‐\ntime(3)  to  print  the time stamp associated with each history entry displayed by the\nhistory builtin.  If this variable is set, time stamps are written to the history file\nso they may be preserved across shell sessions.  This uses the history comment charac‐\nter to distinguish timestamps from other history lines.\nHOME   The home directory of the current user; the default argument for the cd  builtin  com‐\nmand.  The value of this variable is also used when performing tilde expansion.\nHOSTFILE\nContains  the name of a file in the same format as /etc/hosts that should be read when\nthe shell needs to complete a hostname.  The list of possible hostname completions may\nbe  changed while the shell is running; the next time hostname completion is attempted\nafter the value is changed, bash adds the contents of the new  file  to  the  existing\nlist.   If  HOSTFILE  is set, but has no value, or does not name a readable file, bash\nattempts to read /etc/hosts to obtain the list of possible hostname completions.  When\nHOSTFILE is unset, the hostname list is cleared.\nIFS    The  Internal  Field  Separator that is used for word splitting after expansion and to\nsplit lines  into  words  with  the  read  builtin  command.   The  default  value  is\n``<space><tab><newline>''.\nIGNOREEOF\nControls the action of an interactive shell on receipt of an EOF character as the sole\ninput.  If set, the value is the number of consecutive EOF characters  which  must  be\ntyped as the first characters on an input line before bash exits.  If the variable ex‐\nists but does not have a numeric value, or has no value, the default value is 10.   If\nit does not exist, EOF signifies the end of input to the shell.\nINPUTRC\nThe  filename for the readline startup file, overriding the default of ~/.inputrc (see\nREADLINE below).\nINSIDEEMACS\nIf this variable appears in the environment when the shell starts, bash  assumes  that\nit  is running inside an Emacs shell buffer and may disable line editing, depending on\nthe value of TERM.\nLANG   Used to determine the locale category for any category not specifically selected  with\na variable starting with LC.\nLCALL This  variable overrides the value of LANG and any other LC variable specifying a lo‐\ncale category.\nLCCOLLATE\nThis variable determines the collation order used when sorting the results of pathname\nexpansion,  and determines the behavior of range expressions, equivalence classes, and\ncollating sequences within pathname expansion and pattern matching.\nLCCTYPE\nThis variable determines the interpretation of characters and the behavior of  charac‐\nter classes within pathname expansion and pattern matching.\nLCMESSAGES\nThis  variable  determines the locale used to translate double-quoted strings preceded\nby a $.\nLCNUMERIC\nThis variable determines the locale category used for number formatting.\nLCTIME\nThis variable determines the locale category used for data and time formatting.\nLINES  Used by the select compound command to determine the column length for printing selec‐\ntion lists.  Automatically set if the checkwinsize option is enabled or in an interac‐\ntive shell upon receipt of a SIGWINCH.\nMAIL   If this parameter is set to a file or directory name and the MAILPATH variable is  not\nset,  bash  informs  the user of the arrival of mail in the specified file or Maildir-\nformat directory.\nMAILCHECK\nSpecifies how often (in seconds) bash checks for mail.  The  default  is  60  seconds.\nWhen  it  is  time  to check for mail, the shell does so before displaying the primary\nprompt.  If this variable is unset, or set to a value that is  not  a  number  greater\nthan or equal to zero, the shell disables mail checking.\nMAILPATH\nA colon-separated list of filenames to be checked for mail.  The message to be printed\nwhen mail arrives in a particular file may be specified  by  separating  the  filename\nfrom  the message with a `?'.  When used in the text of the message, $ expands to the\nname of the current mailfile.  Example:\nMAILPATH='/var/mail/bfox?\"You have mail\":~/shell-mail?\"$ has mail!\"'\nBash can be configured to supply a default value for this variable (there is no  value\nby  default), but the location of the user mail files that it uses is system dependent\n(e.g., /var/mail/$USER).\nOPTERR If set to the value 1, bash displays error messages generated by the  getopts  builtin\ncommand  (see SHELL BUILTIN COMMANDS below).  OPTERR is initialized to 1 each time the\nshell is invoked or a shell script is executed.\nPATH   The search path for commands.  It is a colon-separated list of  directories  in  which\nthe  shell looks for commands (see COMMAND EXECUTION below).  A zero-length (null) di‐\nrectory name in the value of PATH indicates the current directory.  A  null  directory\nname  may  appear as two adjacent colons, or as an initial or trailing colon.  The de‐\nfault path is system-dependent, and is set by the administrator who installs bash.   A\ncommon value is ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''.\nPOSIXLYCORRECT\nIf  this  variable is in the environment when bash starts, the shell enters posix mode\nbefore reading the startup files, as if the --posix invocation option  had  been  sup‐\nplied.   If  it  is set while the shell is running, bash enables posix mode, as if the\ncommand set -o posix had been executed.  When the shell enters  posix  mode,  it  sets\nthis variable if it was not already set.\nPROMPTCOMMAND\nIf this variable is set, and is an array, the value of each set element is executed as\na command prior to issuing each primary prompt.  If this is set but not an array vari‐\nable, its value is used as a command to execute instead.\nPROMPTDIRTRIM\nIf  set to a number greater than zero, the value is used as the number of trailing di‐\nrectory components to retain when expanding the \\w and \\W prompt string  escapes  (see\nPROMPTING below).  Characters removed are replaced with an ellipsis.\nPS0    The  value of this parameter is expanded (see PROMPTING below) and displayed by inter‐\nactive shells after reading a command and before the command is executed.\nPS1    The value of this parameter is expanded (see PROMPTING below) and used as the  primary\nprompt string.  The default value is ``\\s-\\v\\$ ''.\nPS2    The  value  of this parameter is expanded as with PS1 and used as the secondary prompt\nstring.  The default is ``> ''.\nPS3    The value of this parameter is used as the prompt for the select  command  (see  SHELL\nGRAMMAR above).\nPS4    The  value  of  this parameter is expanded as with PS1 and the value is printed before\neach command bash displays during an execution trace.  The first character of the  ex‐\npanded  value  of PS4 is replicated multiple times, as necessary, to indicate multiple\nlevels of indirection.  The default is ``+ ''.\nSHELL  This variable expands to the full pathname to the shell.  If it is not  set  when  the\nshell starts, bash assigns to it the full pathname of the current user's login shell.\nTIMEFORMAT\nThe  value  of this parameter is used as a format string specifying how the timing in‐\nformation for pipelines prefixed with the time reserved word should be displayed.  The\n%  character  introduces  an escape sequence that is expanded to a time value or other\ninformation.  The escape sequences and their meanings are as follows; the  braces  de‐\nnote optional portions.\n%%        A literal %.\n%[p][l]R  The elapsed time in seconds.\n%[p][l]U  The number of CPU seconds spent in user mode.\n%[p][l]S  The number of CPU seconds spent in system mode.\n%P        The CPU percentage, computed as (%U + %S) / %R.\n\nThe  optional  p  is a digit specifying the precision, the number of fractional digits\nafter a decimal point.  A value of 0 causes no decimal point or fraction to be output.\nAt  most  three  places  after the decimal point may be specified; values of p greater\nthan 3 are changed to 3.  If p is not specified, the value 3 is used.\n\nThe optional l specifies a longer format, including minutes, of  the  form  MMmSS.FFs.\nThe value of p determines whether or not the fraction is included.\n\nIf   this   variable   is   not   set,   bash   acts   as   if   it   had   the  value\n$'\\nreal\\t%3lR\\nuser\\t%3lU\\nsys\\t%3lS'.  If the value is null, no  timing  information\nis displayed.  A trailing newline is added when the format string is displayed.\nTMOUT  If  set  to a value greater than zero, TMOUT is treated as the default timeout for the\nread builtin.  The select command terminates if input does not arrive after TMOUT sec‐\nonds  when input is coming from a terminal.  In an interactive shell, the value is in‐\nterpreted as the number of seconds to wait for a line of input after issuing the  pri‐\nmary  prompt.   Bash terminates after waiting for that number of seconds if a complete\nline of input does not arrive.\nTMPDIR If set, bash uses its value as the name of a directory in which bash creates temporary\nfiles for the shell's use.\nautoresume\nThis variable controls how the shell interacts with the user and job control.  If this\nvariable is set, single word simple commands without redirections are treated as  can‐\ndidates  for resumption of an existing stopped job.  There is no ambiguity allowed; if\nthere is more than one job beginning with the string typed, the job most recently  ac‐\ncessed  is  selected.  The name of a stopped job, in this context, is the command line\nused to start it.  If set to the value exact, the string supplied must match the  name\nof  a  stopped  job exactly; if set to substring, the string supplied needs to match a\nsubstring of the name of a stopped job.  The substring  value  provides  functionality\nanalogous  to  the  %?   job  identifier (see JOB CONTROL below).  If set to any other\nvalue, the supplied string must be a prefix of a stopped  job's  name;  this  provides\nfunctionality analogous to the %string job identifier.\n\n#### histchars\n\nThe two or three characters which control history expansion and tokenization (see HIS‐‐\nTORY EXPANSION below).  The first character is the history  expansion  character,  the\ncharacter  which  signals  the start of a history expansion, normally `!'.  The second\ncharacter is the quick substitution character, which is used as shorthand for  re-run‐\nning the previous command entered, substituting one string for another in the command.\nThe default is `^'.  The optional third character is  the  character  which  indicates\nthat  the  remainder  of  the line is a comment when found as the first character of a\nword, normally `#'.  The history comment character causes history substitution  to  be\nskipped  for the remaining words on the line.  It does not necessarily cause the shell\nparser to treat the rest of the line as a comment.\n\n#### Arrays\n\nBash provides one-dimensional indexed and associative array variables.  Any variable  may  be\nused  as an indexed array; the declare builtin will explicitly declare an array.  There is no\nmaximum limit on the size of an array, nor any requirement that members  be  indexed  or  as‐\nsigned  contiguously.  Indexed arrays are referenced using integers (including arithmetic ex‐\npressions) and are zero-based; associative arrays are  referenced  using  arbitrary  strings.\nUnless otherwise noted, indexed array indices must be non-negative integers.\n\nAn  indexed  array  is  created automatically if any variable is assigned to using the syntax\nname[subscript]=value.  The subscript is treated as an arithmetic expression that must evalu‐\nate  to  a  number.   To  explicitly declare an indexed array, use declare -a name (see SHELL\nBUILTIN COMMANDS below).  declare -a name[subscript] is also accepted; the subscript  is  ig‐\nnored.\n\nAssociative arrays are created using declare -A name.\n\nAttributes  may  be  specified for an array variable using the declare and readonly builtins.\nEach attribute applies to all members of an array.\n\nArrays are assigned to using compound assignments of the form name=(value1 ... valuen), where\neach  value  may be of the form [subscript]=string.  Indexed array assignments do not require\nanything but string.  Each value in the list is expanded using all the shell  expansions  de‐\nscribed  below  under  EXPANSION.  When assigning to indexed arrays, if the optional brackets\nand subscript are supplied, that index is assigned to; otherwise the index of the element as‐\nsigned is the last index assigned to by the statement plus one.  Indexing starts at zero.\n\nWhen  assigning to an associative array, the words in a compound assignment may be either as‐\nsignment statements, for which the subscript is required, or a list of words that  is  inter‐\npreted  as  a  sequence  of alternating keys and values: name=( key1 value1 key2 value2 ...).\nThese are treated identically to name=( [key1]=value1 [key2]=value2 ...).  The first word  in\nthe  list  determines how the remaining words are interpreted; all assignments in a list must\nbe of the same type.  When using key/value pairs, the keys may not be missing or empty; a fi‐\nnal missing value is treated like the empty string.\n\nThis  syntax  is  also accepted by the declare builtin.  Individual array elements may be as‐\nsigned to using the name[subscript]=value syntax introduced above.  When assigning to an  in‐\ndexed array, if name is subscripted by a negative number, that number is interpreted as rela‐\ntive to one greater than the maximum index of name, so negative indices count back  from  the\nend of the array, and an index of -1 references the last element.\n\nAny  element of an array may be referenced using ${name[subscript]}.  The braces are required\nto avoid conflicts with pathname expansion.  If subscript is @ or *, the word expands to  all\nmembers  of  name.   These subscripts differ only when the word appears within double quotes.\nIf the word is double-quoted, ${name[*]} expands to a single word with the value of each  ar‐\nray  member  separated by the first character of the IFS special variable, and ${name[@]} ex‐\npands each element of name to a separate word.  When there are no array  members,  ${name[@]}\nexpands  to  nothing.   If the double-quoted expansion occurs within a word, the expansion of\nthe first parameter is joined with the beginning part of the original word, and the expansion\nof  the  last parameter is joined with the last part of the original word.  This is analogous\nto the expansion  of  the  special  parameters  *  and  @  (see  Special  Parameters  above).\n${#name[subscript]} expands to the length of ${name[subscript]}.  If subscript is * or @, the\nexpansion is the number of elements in the array.  If the subscript used to reference an ele‐\nment  of an indexed array evaluates to a number less than zero, it is interpreted as relative\nto one greater than the maximum index of the array, so negative indices count back  from  the\nend of the array, and an index of -1 references the last element.\n\nReferencing an array variable without a subscript is equivalent to referencing the array with\na subscript of 0.  Any reference to a variable using a valid subscript  is  legal,  and  bash\nwill create an array if necessary.\n\nAn  array  variable  is  considered  set  if a subscript has been assigned a value.  The null\nstring is a valid value.\n\nIt is possible to obtain the keys (indices) of an array as well as the  values.   ${!name[@]}\nand ${!name[*]} expand to the indices assigned in array variable name.  The treatment when in\ndouble quotes is similar to the expansion of the special parameters @  and  *  within  double\nquotes.\n\nThe  unset  builtin is used to destroy arrays.  unset name[subscript] destroys the array ele‐\nment at index subscript, for both indexed and associative arrays.  Negative subscripts to in‐\ndexed  arrays  are  interpreted  as  described above.  Unsetting the last element of an array\nvariable does not unset the variable.  unset name, where name is an array, or unset name[sub‐\nscript], where subscript is * or @, removes the entire array.\n\nWhen  using a variable name with a subscript as an argument to a command, such as with unset,\nwithout using the word expansion syntax described above, the argument is subject to  pathname\nexpansion.  If pathname expansion is not desired, the argument should be quoted.\n\nThe declare, local, and readonly builtins each accept a -a option to specify an indexed array\nand a -A option to specify an associative array.  If both  options  are  supplied,  -A  takes\nprecedence.   The  read  builtin  accepts a -a option to assign a list of words read from the\nstandard input to an array.  The set and declare builtins display array values in a way  that\nallows them to be reused as assignments.\n\n### EXPANSION\n\nExpansion  is  performed  on  the command line after it has been split into words.  There are\nseven kinds of expansion performed: brace expansion, tilde expansion, parameter and  variable\nexpansion,  command  substitution,  arithmetic expansion, word splitting, and pathname expan‐\nsion.\n\nThe order of expansions is: brace expansion; tilde expansion, parameter and  variable  expan‐\nsion,  arithmetic expansion, and command substitution (done in a left-to-right fashion); word\nsplitting; and pathname expansion.\n\nOn systems that can support it, there is an additional expansion available: process substitu‐\ntion.   This  is performed at the same time as tilde, parameter, variable, and arithmetic ex‐\npansion and command substitution.\n\nAfter these expansions are performed, quote characters present in the original word  are  re‐\nmoved unless they have been quoted themselves (quote removal).\n\nOnly brace expansion, word splitting, and pathname expansion can increase the number of words\nof the expansion; other expansions expand a single word to a single word.   The  only  excep‐\ntions  to  this  are  the  expansions  of  \"$@\"  and \"${name[@]}\", and, in most cases, $* and\n${name[*]} as explained above (see PARAMETERS).\n\n#### Brace Expansion\n\nBrace expansion is a mechanism by which arbitrary strings may be generated.   This  mechanism\nis similar to pathname expansion, but the filenames generated need not exist.  Patterns to be\nbrace expanded take the form of an optional preamble, followed by either a series  of  comma-\nseparated  strings or a sequence expression between a pair of braces, followed by an optional\npostscript.  The preamble is prefixed to each string contained within  the  braces,  and  the\npostscript is then appended to each resulting string, expanding left to right.\n\nBrace  expansions may be nested.  The results of each expanded string are not sorted; left to\nright order is preserved.  For example, a{d,c,b}e expands into `ade ace abe'.\n\nA sequence expression takes the form {x..y[..incr]}, where x and y  are  either  integers  or\nsingle  characters,  and  incr, an optional increment, is an integer.  When integers are sup‐\nplied, the expression expands to each number between x and y, inclusive.   Supplied  integers\nmay  be prefixed with 0 to force each term to have the same width.  When either x or y begins\nwith a zero, the shell attempts to force all generated terms to contain the  same  number  of\ndigits,  zero-padding  where necessary.  When characters are supplied, the expression expands\nto each character lexicographically between x and y, inclusive, using the default  C  locale.\nNote  that both x and y must be of the same type.  When the increment is supplied, it is used\nas the difference between each term.  The default increment is 1 or -1 as appropriate.\n\nBrace expansion is performed before any other expansions, and any characters special to other\nexpansions  are  preserved  in  the result.  It is strictly textual.  Bash does not apply any\nsyntactic interpretation to the context of the expansion or the text between the braces.\n\nA correctly-formed brace expansion must contain unquoted opening and closing braces,  and  at\nleast one unquoted comma or a valid sequence expression.  Any incorrectly formed brace expan‐\nsion is left unchanged.  A { or , may be quoted with a backslash to prevent its being consid‐\nered  part of a brace expression.  To avoid conflicts with parameter expansion, the string ${\nis not considered eligible for brace expansion, and inhibits brace expansion until the  clos‐\ning }.\n\nThis  construct  is  typically  used as shorthand when the common prefix of the strings to be\ngenerated is longer than in the above example:\n\nmkdir /usr/local/src/bash/{old,new,dist,bugs}\nor\nchown root /usr/{ucb/{ex,edit},lib/{ex?.?*,howex}}\n\nBrace expansion introduces a slight incompatibility with historical versions of sh.  sh  does\nnot  treat  opening  or closing braces specially when they appear as part of a word, and pre‐\nserves them in the output.  Bash removes braces from words as a consequence of  brace  expan‐\nsion.  For example, a word entered to sh as file{1,2} appears identically in the output.  The\nsame word is output as file1 file2 after expansion by bash.  If strict compatibility with  sh\nis  desired,  start  bash with the +B option or disable brace expansion with the +B option to\nthe set command (see SHELL BUILTIN COMMANDS below).\n\n#### Tilde Expansion\n\nIf a word begins with an unquoted tilde character (`~'), all of the characters preceding  the\nfirst  unquoted  slash  (or  all  characters, if there is no unquoted slash) are considered a\ntilde-prefix.  If none of the characters in the tilde-prefix are quoted,  the  characters  in\nthe  tilde-prefix  following  the  tilde are treated as a possible login name.  If this login\nname is the null string, the tilde is replaced with the value of the  shell  parameter  HOME.\nIf  HOME is unset, the home directory of the user executing the shell is substituted instead.\nOtherwise, the tilde-prefix is replaced with the home directory associated with the specified\nlogin name.\n\nIf the tilde-prefix is a `~+', the value of the shell variable PWD replaces the tilde-prefix.\nIf the tilde-prefix is a `~-', the value of the shell variable OLDPWD, if it is set, is  sub‐\nstituted.   If  the characters following the tilde in the tilde-prefix consist of a number N,\noptionally prefixed by a `+' or a `-', the tilde-prefix is replaced  with  the  corresponding\nelement  from  the directory stack, as it would be displayed by the dirs builtin invoked with\nthe tilde-prefix as an argument.  If the characters following the tilde in  the  tilde-prefix\nconsist of a number without a leading `+' or `-', `+' is assumed.\n\nIf the login name is invalid, or the tilde expansion fails, the word is unchanged.\n\nEach  variable assignment is checked for unquoted tilde-prefixes immediately following a : or\nthe first =.  In these cases, tilde expansion is also performed.  Consequently, one  may  use\nfilenames with tildes in assignments to PATH, MAILPATH, and CDPATH, and the shell assigns the\nexpanded value.\n\nBash also performs tilde expansion on words satisfying the conditions of variable assignments\n(as described above under PARAMETERS) when they appear as arguments to simple commands.  Bash\ndoes not do this, except for the declaration commands listed above, when in posix mode.\n\n#### Parameter Expansion\n\nThe `$' character introduces parameter expansion, command substitution, or arithmetic  expan‐\nsion.   The  parameter name or symbol to be expanded may be enclosed in braces, which are op‐\ntional but serve to protect the variable to be expanded from characters immediately following\nit which could be interpreted as part of the name.\n\nWhen  braces  are used, the matching ending brace is the first `}' not escaped by a backslash\nor within a quoted string, and not within an embedded arithmetic expansion, command substitu‐\ntion, or parameter expansion.\n\n${parameter}\nThe  value  of  parameter is substituted.  The braces are required when parameter is a\npositional parameter with more than one digit, or when  parameter  is  followed  by  a\ncharacter  which  is  not  to  be interpreted as part of its name.  The parameter is a\nshell parameter as described above PARAMETERS) or an array reference (Arrays).\n\nIf the first character of parameter is an exclamation point  (!),  and  parameter  is  not  a\nnameref,  it  introduces a level of indirection.  Bash uses the value formed by expanding the\nrest of parameter as the new parameter; this is then expanded and that value is used  in  the\nrest of the expansion, rather than the expansion of the original parameter.  This is known as\nindirect expansion.  The value is subject to tilde expansion,  parameter  expansion,  command\nsubstitution,  and arithmetic expansion.  If parameter is a nameref, this expands to the name\nof the parameter referenced by parameter instead of performing the complete  indirect  expan‐\nsion.  The exceptions to this are the expansions of ${!prefix*} and ${!name[@]} described be‐\nlow.  The exclamation point must immediately follow the left brace in order to introduce  in‐\ndirection.\n\nIn  each of the cases below, word is subject to tilde expansion, parameter expansion, command\nsubstitution, and arithmetic expansion.\n\nWhen not performing substring expansion, using the forms documented below  (e.g.,  :-),  bash\ntests for a parameter that is unset or null.  Omitting the colon results in a test only for a\nparameter that is unset.\n\n${parameter:-word}\nUse Default Values.  If parameter is unset or null, the expansion of word  is  substi‐\ntuted.  Otherwise, the value of parameter is substituted.\n${parameter:=word}\nAssign  Default  Values.   If parameter is unset or null, the expansion of word is as‐\nsigned to parameter.  The value of parameter is then substituted.  Positional  parame‐\nters and special parameters may not be assigned to in this way.\n${parameter:?word}\nDisplay  Error if Null or Unset.  If parameter is null or unset, the expansion of word\n(or a message to that effect if word is not present) is written to the standard  error\nand  the shell, if it is not interactive, exits.  Otherwise, the value of parameter is\nsubstituted.\n${parameter:+word}\nUse Alternate Value.  If parameter is null or unset, nothing is substituted, otherwise\nthe expansion of word is substituted.\n${parameter:offset}\n${parameter:offset:length}\nSubstring  Expansion.   Expands  to  up to length characters of the value of parameter\nstarting at the character specified by offset.  If parameter is @,  an  indexed  array\nsubscripted  by  @ or *, or an associative array name, the results differ as described\nbelow.  If length is omitted, expands to the  substring  of  the  value  of  parameter\nstarting  at  the character specified by offset and extending to the end of the value.\nlength and offset are arithmetic expressions (see ARITHMETIC EVALUATION below).\n\nIf offset evaluates to a number less than zero, the value is  used  as  an  offset  in\ncharacters  from  the  end of the value of parameter.  If length evaluates to a number\nless than zero, it is interpreted as an offset in characters from the end of the value\nof  parameter  rather than a number of characters, and the expansion is the characters\nbetween offset and that result.  Note that a negative offset must  be  separated  from\nthe colon by at least one space to avoid being confused with the :- expansion.\n\nIf  parameter is @, the result is length positional parameters beginning at offset.  A\nnegative offset is taken relative to one greater than the greatest positional  parame‐\nter,  so  an offset of -1 evaluates to the last positional parameter.  It is an expan‐\nsion error if length evaluates to a number less than zero.\n\nIf parameter is an indexed array name subscripted by @ or *, the result is the  length\nmembers  of the array beginning with ${parameter[offset]}.  A negative offset is taken\nrelative to one greater than the maximum index of the specified array.  It is  an  ex‐\npansion error if length evaluates to a number less than zero.\n\nSubstring expansion applied to an associative array produces undefined results.\n\nSubstring  indexing  is zero-based unless the positional parameters are used, in which\ncase the indexing starts at 1 by default.  If offset is 0, and the positional  parame‐\nters are used, $0 is prefixed to the list.\n\n${!prefix*}\n${!prefix@}\nNames  matching prefix.  Expands to the names of variables whose names begin with pre‐\nfix, separated by the first character of the IFS special variable.  When @ is used and\nthe  expansion  appears within double quotes, each variable name expands to a separate\nword.\n\n${!name[@]}\n${!name[*]}\nList of array keys.  If name is an array variable, expands to the list  of  array  in‐\ndices  (keys)  assigned in name.  If name is not an array, expands to 0 if name is set\nand null otherwise.  When @ is used and the expansion appears  within  double  quotes,\neach key expands to a separate word.\n\n${#parameter}\nParameter  length.  The length in characters of the value of parameter is substituted.\nIf parameter is * or @, the value substituted is the number of positional  parameters.\nIf parameter is an array name subscripted by * or @, the value substituted is the num‐\nber of elements in the array.  If parameter is an indexed array name subscripted by  a\nnegative  number, that number is interpreted as relative to one greater than the maxi‐\nmum index of parameter, so negative indices count back from the end of the array,  and\nan index of -1 references the last element.\n\n${parameter#word}\n${parameter##word}\nRemove  matching prefix pattern.  The word is expanded to produce a pattern just as in\npathname expansion, and matched against the expanded  value  of  parameter  using  the\nrules described under Pattern Matching below.  If the pattern matches the beginning of\nthe value of parameter, then the result of the expansion is the expanded value of  pa‐\nrameter  with  the  shortest matching pattern (the ``#'' case) or the longest matching\npattern (the ``##'' case) deleted.  If parameter is @ or *, the pattern removal opera‐\ntion  is applied to each positional parameter in turn, and the expansion is the resul‐\ntant list.  If parameter is an array variable subscripted with @ or *, the pattern re‐\nmoval  operation  is applied to each member of the array in turn, and the expansion is\nthe resultant list.\n\n${parameter%word}\n${parameter%%word}\nRemove matching suffix pattern.  The word is expanded to produce a pattern just as  in\npathname  expansion,  and  matched  against  the expanded value of parameter using the\nrules described under Pattern Matching below.  If the pattern matches a trailing  por‐\ntion  of  the expanded value of parameter, then the result of the expansion is the ex‐\npanded value of parameter with the shortest matching pattern (the ``%'' case)  or  the\nlongest  matching pattern (the ``%%'' case) deleted.  If parameter is @ or *, the pat‐\ntern removal operation is applied to each positional parameter in turn, and the expan‐\nsion  is  the resultant list.  If parameter is an array variable subscripted with @ or\n*, the pattern removal operation is applied to each member of the array in  turn,  and\nthe expansion is the resultant list.\n\n${parameter/pattern/string}\nPattern  substitution.   The pattern is expanded to produce a pattern just as in path‐\nname expansion, Parameter is expanded and the longest match  of  pattern  against  its\nvalue is replaced with string.  The match is performed using the rules described under\nPattern Matching below.  If pattern begins with /, all matches of pattern are replaced\nwith string.  Normally only the first match is replaced.  If pattern begins with #, it\nmust match at the beginning of the expanded value of  parameter.   If  pattern  begins\nwith  %,  it  must  match at the end of the expanded value of parameter.  If string is\nnull, matches of pattern are deleted and the / following pattern may be  omitted.   If\nthe  nocasematch shell option is enabled, the match is performed without regard to the\ncase of alphabetic characters.  If parameter is @ or *, the substitution operation  is\napplied to each positional parameter in turn, and the expansion is the resultant list.\nIf parameter is an array variable subscripted with @ or *, the substitution  operation\nis  applied  to  each  member of the array in turn, and the expansion is the resultant\nlist.\n\n${parameter^pattern}\n${parameter^^pattern}\n${parameter,pattern}\n${parameter,,pattern}\nCase modification.  This expansion modifies the case of alphabetic characters  in  pa‐\nrameter.   The pattern is expanded to produce a pattern just as in pathname expansion.\nEach character in the expanded value of parameter is tested against pattern,  and,  if\nit  matches  the  pattern,  its  case is converted.  The pattern should not attempt to\nmatch more than one character.  The ^ operator  converts  lowercase  letters  matching\npattern to uppercase; the , operator converts matching uppercase letters to lowercase.\nThe ^^ and ,, expansions convert each matched character in the expanded value;  the  ^\nand , expansions match and convert only the first character in the expanded value.  If\npattern is omitted, it is treated like a ?, which matches every character.  If parame‐\nter is @ or *, the case modification operation is applied to each positional parameter\nin turn, and the expansion is the resultant list.  If parameter is an  array  variable\nsubscripted  with @ or *, the case modification operation is applied to each member of\nthe array in turn, and the expansion is the resultant list.\n\n${parameter@operator}\nParameter transformation.  The expansion is either a transformation of  the  value  of\nparameter  or  information about parameter itself, depending on the value of operator.\nEach operator is a single letter:\n\nU      The expansion is a string that is the value of parameter with lowercase  alpha‐\nbetic characters converted to uppercase.\nu      The expansion is a string that is the value of parameter with the first charac‐\nter converted to uppercase, if it is alphabetic.\nL      The expansion is a string that is the value of parameter with uppercase  alpha‐\nbetic characters converted to lowercase.\nQ      The  expansion  is  a  string that is the value of parameter quoted in a format\nthat can be reused as input.\nE      The expansion is a string that is the value of parameter with backslash  escape\nsequences expanded as with the $'...' quoting mechanism.\nP      The  expansion is a string that is the result of expanding the value of parame‐\nter as if it were a prompt string (see PROMPTING below).\nA      The expansion is a string in the form of an  assignment  statement  or  declare\ncommand  that,  if  evaluated,  will recreate parameter with its attributes and\nvalue.\nK      Produces a possibly-quoted version of the value of parameter,  except  that  it\nprints  the  values  of  indexed and associative arrays as a sequence of quoted\nkey-value pairs (see Arrays above).\na      The expansion is a string consisting of flag  values  representing  parameter's\nattributes.\n\nIf parameter is @ or *, the operation is applied to each positional parameter in turn,\nand the expansion is the resultant list.  If  parameter  is  an  array  variable  sub‐\nscripted  with  @  or *, the operation is applied to each member of the array in turn,\nand the expansion is the resultant list.\n\nThe result of the expansion is subject to word splitting and pathname expansion as de‐\nscribed below.\n\n#### Command Substitution\n\nCommand  substitution  allows the output of a command to replace the command name.  There are\ntwo forms:\n\n$(command)\nor\n`command`\n\nBash performs the expansion by executing command in a subshell environment and replacing  the\ncommand  substitution  with  the  standard  output of the command, with any trailing newlines\ndeleted.  Embedded newlines are not deleted, but they may be removed during  word  splitting.\nThe command substitution $(cat file) can be replaced by the equivalent but faster $(< file).\n\nWhen  the  old-style  backquote  form  of substitution is used, backslash retains its literal\nmeaning except when followed by $, `, or \\.  The first backquote not preceded by a  backslash\nterminates  the command substitution.  When using the $(command) form, all characters between\nthe parentheses make up the command; none are treated specially.\n\nCommand substitutions may be nested.  To nest when using the backquoted form, escape the  in‐\nner backquotes with backslashes.\n\nIf  the  substitution appears within double quotes, word splitting and pathname expansion are\nnot performed on the results.\n\n#### Arithmetic Expansion\n\nArithmetic expansion allows the evaluation of an arithmetic expression and  the  substitution\nof the result.  The format for arithmetic expansion is:\n\n$((expression))\n\nThe old format $[expression] is deprecated and will be removed in upcoming versions of bash.\n\nThe  expression  is treated as if it were within double quotes, but a double quote inside the\nparentheses is not treated specially.  All tokens in the  expression  undergo  parameter  and\nvariable  expansion,  command  substitution, and quote removal.  The result is treated as the\narithmetic expression to be evaluated.  Arithmetic expansions may be nested.\n\nThe evaluation is performed according to the rules listed below under ARITHMETIC  EVALUATION.\nIf  expression  is  invalid, bash prints a message indicating failure and no substitution oc‐\ncurs.\n\n#### Process Substitution\n\nProcess substitution allows a process's input or output to be referred to using  a  filename.\nIt takes the form of <(list) or >(list).  The process list is run asynchronously, and its in‐\nput or output appears as a filename.  This filename is passed as an argument to  the  current\ncommand  as  the  result  of the expansion.  If the >(list) form is used, writing to the file\nwill provide input for list.  If the <(list) form is used, the file  passed  as  an  argument\nshould  be  read  to obtain the output of list.  Process substitution is supported on systems\nthat support named pipes (FIFOs) or the /dev/fd method of naming open files.\n\nWhen available, process substitution is performed simultaneously with parameter and  variable\nexpansion, command substitution, and arithmetic expansion.\n\n#### Word Splitting\n\nThe  shell scans the results of parameter expansion, command substitution, and arithmetic ex‐\npansion that did not occur within double quotes for word splitting.\n\nThe shell treats each character of IFS as a delimiter, and splits the results  of  the  other\nexpansions  into  words using these characters as field terminators.  If IFS is unset, or its\nvalue is exactly <space><tab><newline>, the default, then sequences of  <space>,  <tab>,  and\n<newline> at the beginning and end of the results of the previous expansions are ignored, and\nany sequence of IFS characters not at the beginning or end serves to delimit words.   If  IFS\nhas  a  value other than the default, then sequences of the whitespace characters space, tab,\nand newline are ignored at the beginning and end of the word, as long as the whitespace char‐\nacter is in the value of IFS (an IFS whitespace character).  Any character in IFS that is not\nIFS whitespace, along with any adjacent IFS whitespace characters, delimits a field.   A  se‐\nquence  of  IFS whitespace characters is also treated as a delimiter.  If the value of IFS is\nnull, no word splitting occurs.\n\nExplicit null arguments (\"\" or '') are retained and passed to commands as empty strings.  Un‐\nquoted  implicit null arguments, resulting from the expansion of parameters that have no val‐\nues, are removed.  If a parameter with no value is expanded within double quotes, a null  ar‐\ngument  results  and  is  retained and passed to a command as an empty string.  When a quoted\nnull argument appears as part of a word whose expansion is non-null, the null argument is re‐\nmoved.  That is, the word -d'' becomes -d after word splitting and null argument removal.\n\nNote that if no expansion occurs, no splitting is performed.\n\n#### Pathname Expansion\n\nAfter word splitting, unless the -f option has been set, bash scans each word for the charac‐\nters *, ?, and [.  If one of these characters appears, and is not quoted, then  the  word  is\nregarded  as a pattern, and replaced with an alphabetically sorted list of filenames matching\nthe pattern (see Pattern Matching below).  If no matching filenames are found, and the  shell\noption  nullglob  is not enabled, the word is left unchanged.  If the nullglob option is set,\nand no matches are found, the word is removed.  If the failglob shell option is set,  and  no\nmatches are found, an error message is printed and the command is not executed.  If the shell\noption nocaseglob is enabled, the match is performed without regard to the case of alphabetic\ncharacters.   Note  that  when using range expressions like [a-z] (see below), letters of the\nother case may be included, depending on the setting of LCCOLLATE.  When a pattern  is  used\nfor  pathname expansion, the character ``.''  at the start of a name or immediately following\na slash must be matched explicitly, unless the shell option dotglob is  set.   The  filenames\n``.''   and  ``..''   must  always  be  matched explicitly, even if dotglob is set.  In other\ncases, the ``.''  character is not treated specially.  When matching a  pathname,  the  slash\ncharacter  must always be matched explicitly by a slash in the pattern, but in other matching\ncontexts it can be matched by a special pattern character as described  below  under  Pattern\nMatching.   See the description of shopt below under SHELL BUILTIN COMMANDS for a description\nof the nocaseglob, nullglob, failglob, and dotglob shell options.\n\nThe GLOBIGNORE shell variable may be used to restrict the set of file names matching  a  pat‐\ntern.  If GLOBIGNORE is set, each matching file name that also matches one of the patterns in\nGLOBIGNORE is removed from the list of matches.  If the nocaseglob option is set, the  match‐\ning  against  the  patterns in GLOBIGNORE is performed without regard to case.  The filenames\n``.''  and ``..''  are always ignored when GLOBIGNORE is set and not null.  However,  setting\nGLOBIGNORE  to  a  non-null value has the effect of enabling the dotglob shell option, so all\nother filenames beginning with a ``.''  will match.  To get  the  old  behavior  of  ignoring\nfilenames  beginning  with a ``.'', make ``.*''  one of the patterns in GLOBIGNORE.  The dot‐‐\nglob option is disabled when GLOBIGNORE is unset.  The pattern matching honors the setting of\nthe extglob shell option.\n\n#### Pattern Matching\n\nAny  character that appears in a pattern, other than the special pattern characters described\nbelow, matches itself.  The NUL character may not occur in a pattern.   A  backslash  escapes\nthe following character; the escaping backslash is discarded when matching.  The special pat‐\ntern characters must be quoted if they are to be matched literally.\n\nThe special pattern characters have the following meanings:\n\n*      Matches any string, including the null string.  When the globstar shell  option\nis enabled, and * is used in a pathname expansion context, two adjacent *s used\nas a single pattern will match all files and zero or more directories and  sub‐\ndirectories.   If  followed by a /, two adjacent *s will match only directories\nand subdirectories.\n?      Matches any single character.\n[...]  Matches any one of the enclosed characters.  A pair of characters separated  by\na hyphen denotes a range expression; any character that falls between those two\ncharacters, inclusive, using the current locale's collating sequence and  char‐\nacter  set,  is matched.  If the first character following the [ is a !  or a ^\nthen any character not enclosed is matched.  The sorting order of characters in\nrange  expressions  is  determined  by the current locale and the values of the\nLCCOLLATE or LCALL shell variables, if set.  To obtain the traditional inter‐\npretation  of range expressions, where [a-d] is equivalent to [abcd], set value\nof the LCALL shell variable to C, or enable the globasciiranges shell  option.\nA  -  may be matched by including it as the first or last character in the set.\nA ] may be matched by including it as the first character in the set.\n\nWithin [ and ], character classes can be specified using the syntax  [:class:],\nwhere class is one of the following classes defined in the POSIX standard:\nalnum  alpha  ascii  blank cntrl digit graph lower print punct space upper word\nxdigit\nA character class matches any character belonging  to  that  class.   The  word\ncharacter class matches letters, digits, and the character .\n\nWithin  [  and ], an equivalence class can be specified using the syntax [=c=],\nwhich matches all characters with the same collation weight (as defined by  the\ncurrent locale) as the character c.\n\nWithin [ and ], the syntax [.symbol.] matches the collating symbol symbol.\n\nIf  the  extglob  shell  option  is enabled using the shopt builtin, several extended pattern\nmatching operators are recognized.  In the following description, a pattern-list is a list of\none or more patterns separated by a |.  Composite patterns may be formed using one or more of\nthe following sub-patterns:\n\n?(pattern-list)\nMatches zero or one occurrence of the given patterns\n*(pattern-list)\nMatches zero or more occurrences of the given patterns\n+(pattern-list)\nMatches one or more occurrences of the given patterns\n@(pattern-list)\nMatches one of the given patterns\n!(pattern-list)\nMatches anything except one of the given patterns\n\nComplicated extended pattern matching against long strings is slow, especially when the  pat‐\nterns  contain alternations and the strings contain multiple matches.  Using separate matches\nagainst shorter strings, or using arrays of strings instead of a single long string,  may  be\nfaster.\n\n#### Quote Removal\n\nAfter  the  preceding expansions, all unquoted occurrences of the characters \\, ', and \" that\ndid not result from one of the above expansions are removed.\n\n### REDIRECTION\n\nBefore a command is executed, its input and output may be redirected using a special notation\ninterpreted  by  the  shell.   Redirection  allows  commands'  file handles to be duplicated,\nopened, closed, made to refer to different files, and can change the files the command  reads\nfrom and writes to.  Redirection may also be used to modify file handles in the current shell\nexecution environment.  The following redirection operators may precede  or  appear  anywhere\nwithin  a  simple  command  or may follow a command.  Redirections are processed in the order\nthey appear, from left to right.\n\nEach redirection that may be preceded by a file descriptor number may instead be preceded  by\na  word  of  the  form {varname}.  In this case, for each redirection operator except >&- and\n<&-, the shell will allocate a file descriptor greater than or equal to 10 and assign  it  to\nvarname.   If  >&- or <&- is preceded by {varname}, the value of varname defines the file de‐\nscriptor to close.  If {varname} is supplied, the redirection persists beyond  the  scope  of\nthe command, allowing the shell programmer to manage the file descriptor himself.\n\nIn  the following descriptions, if the file descriptor number is omitted, and the first char‐\nacter of the redirection operator is <, the redirection refers to the  standard  input  (file\ndescriptor  0).   If  the  first  character of the redirection operator is >, the redirection\nrefers to the standard output (file descriptor 1).\n\nThe word following the redirection operator in the following descriptions,  unless  otherwise\nnoted,  is  subjected  to brace expansion, tilde expansion, parameter and variable expansion,\ncommand substitution, arithmetic expansion,  quote  removal,  pathname  expansion,  and  word\nsplitting.  If it expands to more than one word, bash reports an error.\n\nNote that the order of redirections is significant.  For example, the command\n\nls > dirlist 2>&1\n\ndirects both standard output and standard error to the file dirlist, while the command\n\nls 2>&1 > dirlist\n\ndirects  only  the standard output to file dirlist, because the standard error was duplicated\nfrom the standard output before the standard output was redirected to dirlist.\n\nBash handles several filenames specially when they are used in redirections, as described  in\nthe following table.  If the operating system on which bash is running provides these special\nfiles, bash will use them; otherwise it will emulate them internally with  the  behavior  de‐\nscribed below.\n\n/dev/fd/fd\nIf fd is a valid integer, file descriptor fd is duplicated.\n/dev/stdin\nFile descriptor 0 is duplicated.\n/dev/stdout\nFile descriptor 1 is duplicated.\n/dev/stderr\nFile descriptor 2 is duplicated.\n/dev/tcp/host/port\nIf  host  is  a valid hostname or Internet address, and port is an integer port\nnumber or service name, bash attempts to open the corresponding TCP socket.\n/dev/udp/host/port\nIf host is a valid hostname or Internet address, and port is  an  integer  port\nnumber or service name, bash attempts to open the corresponding UDP socket.\n\nA failure to open or create a file causes the redirection to fail.\n\nRedirections using file descriptors greater than 9 should be used with care, as they may con‐\nflict with file descriptors the shell uses internally.\n\nNote that the exec builtin command can make redirections take effect in the current shell.\n\n#### Redirecting Input\n\nRedirection of input causes the file whose name results from the  expansion  of  word  to  be\nopened  for  reading  on file descriptor n, or the standard input (file descriptor 0) if n is\nnot specified.\n\nThe general format for redirecting input is:\n\n[n]<word\n\n#### Redirecting Output\n\nRedirection of output causes the file whose name results from the expansion  of  word  to  be\nopened  for  writing on file descriptor n, or the standard output (file descriptor 1) if n is\nnot specified.  If the file does not exist it is created; if it does exist it is truncated to\nzero size.\n\nThe general format for redirecting output is:\n\n[n]>word\n\nIf  the  redirection  operator is >, and the noclobber option to the set builtin has been en‐\nabled, the redirection will fail if the file whose name results from the  expansion  of  word\nexists and is a regular file.  If the redirection operator is >|, or the redirection operator\nis > and the noclobber option to the set builtin command is not enabled, the  redirection  is\nattempted even if the file named by word exists.\n\n#### Appending Redirected Output\n\nRedirection  of  output in this fashion causes the file whose name results from the expansion\nof word to be opened for appending on file descriptor n, or the  standard  output  (file  de‐\nscriptor 1) if n is not specified.  If the file does not exist it is created.\n\nThe general format for appending output is:\n\n[n]>>word\n\n#### Redirecting Standard Output and Standard Error\n\nThis  construct  allows  both  the standard output (file descriptor 1) and the standard error\noutput (file descriptor 2) to be redirected to the file whose name is the expansion of word.\n\nThere are two formats for redirecting standard output and standard error:\n\n&>word\nand\n>&word\n\nOf the two forms, the first is preferred.  This is semantically equivalent to\n\n>word 2>&1\n\nWhen using the second form, word may not expand to a number or -.  If it  does,  other  redi‐\nrection operators apply (see Duplicating File Descriptors below) for compatibility reasons.\n\n#### Appending Standard Output and Standard Error\n\nThis  construct  allows  both  the standard output (file descriptor 1) and the standard error\noutput (file descriptor 2) to be appended to the file whose name is the expansion of word.\n\nThe format for appending standard output and standard error is:\n\n&>>word\n\nThis is semantically equivalent to\n\n>>word 2>&1\n\n(see Duplicating File Descriptors below).\n\n#### Here Documents\n\nThis type of redirection instructs the shell to read input from the current  source  until  a\nline  containing  only delimiter (with no trailing blanks) is seen.  All of the lines read up\nto that point are then used as the standard input (or file descriptor n if  n  is  specified)\nfor a command.\n\nThe format of here-documents is:\n\n[n]<<[-]word\nhere-document\ndelimiter\n\nNo  parameter and variable expansion, command substitution, arithmetic expansion, or pathname\nexpansion is performed on word.  If any part of word is quoted, the delimiter is  the  result\nof  quote  removal  on word, and the lines in the here-document are not expanded.  If word is\nunquoted, all lines of the here-document are subjected to parameter expansion,  command  sub‐\nstitution, and arithmetic expansion, the character sequence \\<newline> is ignored, and \\ must\nbe used to quote the characters \\, $, and `.\n\nIf the redirection operator is <<-, then all leading tab characters are stripped  from  input\nlines  and the line containing delimiter.  This allows here-documents within shell scripts to\nbe indented in a natural fashion.\n\n#### Here Strings\n\nA variant of here documents, the format is:\n\n[n]<<<word\n\nThe word undergoes tilde expansion, parameter and variable expansion,  command  substitution,\narithmetic  expansion, and quote removal.  Pathname expansion and word splitting are not per‐\nformed.  The result is supplied as a single string, with a newline appended, to  the  command\non its standard input (or file descriptor n if n is specified).\n\n#### Duplicating File Descriptors\n\nThe redirection operator\n\n[n]<&word\n\nis used to duplicate input file descriptors.  If word expands to one or more digits, the file\ndescriptor denoted by n is made to be a copy of that file descriptor.  If the digits in  word\ndo  not specify a file descriptor open for input, a redirection error occurs.  If word evalu‐\nates to -, file descriptor n is closed.  If n is not specified, the standard input (file  de‐\nscriptor 0) is used.\n\nThe operator\n\n[n]>&word\n\nis  used similarly to duplicate output file descriptors.  If n is not specified, the standard\noutput (file descriptor 1) is used.  If the digits in word do not specify a  file  descriptor\nopen  for  output,  a redirection error occurs.  If word evaluates to -, file descriptor n is\nclosed.  As a special case, if n is omitted, and word does not expand to one or  more  digits\nor -, the standard output and standard error are redirected as described previously.\n\n#### Moving File Descriptors\n\nThe redirection operator\n\n[n]<&digit-\n\nmoves  the file descriptor digit to file descriptor n, or the standard input (file descriptor\n0) if n is not specified.  digit is closed after being duplicated to n.\n\nSimilarly, the redirection operator\n\n[n]>&digit-\n\nmoves the file descriptor digit to file descriptor n, or the standard output (file descriptor\n1) if n is not specified.\n\n#### Opening File Descriptors for Reading and Writing\n\nThe redirection operator\n\n[n]<>word\n\ncauses the file whose name is the expansion of word to be opened for both reading and writing\non file descriptor n, or on file descriptor 0 if n is not specified.  If the  file  does  not\nexist, it is created.\n\n### ALIASES\n\nAliases  allow  a  string to be substituted for a word when it is used as the first word of a\nsimple command.  The shell maintains a list of aliases that may be set  and  unset  with  the\nalias  and  unalias  builtin  commands (see SHELL BUILTIN COMMANDS below).  The first word of\neach simple command, if unquoted, is checked to see if it has an alias.  If so, that word  is\nreplaced  by  the  text  of  the  alias.   The characters /, $, `, and = and any of the shell\nmetacharacters or quoting characters listed above may not appear in an alias name.   The  re‐\nplacement  text may contain any valid shell input, including shell metacharacters.  The first\nword of the replacement text is tested for aliases, but a word that is identical to an  alias\nbeing expanded is not expanded a second time.  This means that one may alias ls to ls -F, for\ninstance, and bash does not try to recursively expand the  replacement  text.   If  the  last\ncharacter  of  the  alias value is a blank, then the next command word following the alias is\nalso checked for alias expansion.\n\nAliases are created and listed with the alias command, and removed with the unalias command.\n\nThere is no mechanism for using arguments in the replacement text.  If arguments are  needed,\na shell function should be used (see FUNCTIONS below).\n\nAliases  are  not expanded when the shell is not interactive, unless the expandaliases shell\noption is set using shopt (see the description of shopt under SHELL BUILTIN COMMANDS below).\n\nThe rules concerning the definition and use of aliases are somewhat confusing.   Bash  always\nreads at least one complete line of input, and all lines that make up a compound command, be‐\nfore executing any of the commands on that line or the compound  command.   Aliases  are  ex‐\npanded  when  a command is read, not when it is executed.  Therefore, an alias definition ap‐\npearing on the same line as another command does not take effect until the next line of input\nis  read.   The  commands following the alias definition on that line are not affected by the\nnew alias.  This behavior is also an issue when functions are executed.  Aliases are expanded\nwhen  a  function  definition  is read, not when the function is executed, because a function\ndefinition is itself a command.  As a consequence, aliases defined  in  a  function  are  not\navailable until after that function is executed.  To be safe, always put alias definitions on\na separate line, and do not use alias in compound commands.\n\nFor almost every purpose, aliases are superseded by shell functions.\n\n### FUNCTIONS\n\nA shell function, defined as described above under SHELL GRAMMAR, stores a series of commands\nfor later execution.  When the name of a shell function is used as a simple command name, the\nlist of commands associated with that function name is executed.  Functions are  executed  in\nthe  context of the current shell; no new process is created to interpret them (contrast this\nwith the execution of a shell script).  When a function is executed,  the  arguments  to  the\nfunction  become  the positional parameters during its execution.  The special parameter # is\nupdated to reflect the change.  Special parameter 0 is unchanged.  The first element  of  the\nFUNCNAME variable is set to the name of the function while the function is executing.\n\nAll other aspects of the shell execution environment are identical between a function and its\ncaller with these exceptions: the DEBUG and RETURN traps (see the  description  of  the  trap\nbuiltin  under  SHELL  BUILTIN COMMANDS below) are not inherited unless the function has been\ngiven the trace attribute (see the description of the declare builtin below) or the -o  func‐‐\ntrace shell option has been enabled with the set builtin (in which case all functions inherit\nthe DEBUG and RETURN traps), and the ERR trap is not inherited unless the -o  errtrace  shell\noption has been enabled.\n\nVariables  local to the function may be declared with the local builtin command.  Ordinarily,\nvariables and their values are shared between the function and its caller.  If a variable  is\ndeclared  local, the variable's visible scope is restricted to that function and its children\n(including the functions it calls).  Local variables \"shadow\" variables with  the  same  name\ndeclared  at  previous scopes.  For instance, a local variable declared in a function hides a\nglobal variable of the same name: references and assignments refer  to  the  local  variable,\nleaving  the  global  variable unmodified.  When the function returns, the global variable is\nonce again visible.\n\nThe shell uses dynamic scoping to control a variable's visibility within functions.  With dy‐\nnamic  scoping,  visible  variables and their values are a result of the sequence of function\ncalls that caused execution to reach the current function.  The value of a  variable  that  a\nfunction  sees  depends  on  its  value within its caller, if any, whether that caller is the\n\"global\" scope or another shell function.  This is also the value that a local variable  dec‐\nlaration \"shadows\", and the value that is restored when the function returns.\n\nFor  example,  if  a variable var is declared as local in function func1, and func1 calls an‐\nother function func2, references to var made from within func2  will  resolve  to  the  local\nvariable var from func1, shadowing any global variable named var.\n\nThe  unset builtin also acts using the same dynamic scope: if a variable is local to the cur‐\nrent scope, unset will unset it; otherwise the unset will refer to the variable found in  any\ncalling scope as described above.  If a variable at the current local scope is unset, it will\nremain so until it is reset in that scope or until the function returns.  Once  the  function\nreturns,  any instance of the variable at a previous scope will become visible.  If the unset\nacts on a variable at a previous scope, any instance of a variable with that  name  that  had\nbeen shadowed will become visible.\n\nThe  FUNCNEST  variable, if set to a numeric value greater than 0, defines a maximum function\nnesting level.  Function invocations that exceed the limit cause the entire command to abort.\n\nIf the builtin command return is executed in a function, the function completes and execution\nresumes  with  the next command after the function call.  Any command associated with the RE‐‐\nTURN trap is executed before execution resumes.  When a function completes, the values of the\npositional  parameters  and the special parameter # are restored to the values they had prior\nto the function's execution.\n\nFunction names and definitions may be listed with the -f option to  the  declare  or  typeset\nbuiltin commands.  The -F option to declare or typeset will list the function names only (and\noptionally the source file and line number, if the extdebug shell option is enabled).   Func‐\ntions may be exported so that subshells automatically have them defined with the -f option to\nthe export builtin.  A function definition may be deleted using the -f option  to  the  unset\nbuiltin.\n\nFunctions  may  be  recursive.   The  FUNCNEST variable may be used to limit the depth of the\nfunction call stack and restrict the number of function invocations.  By default, no limit is\nimposed on the number of recursive calls.\n\n### ARITHMETIC EVALUATION\n\nThe shell allows arithmetic expressions to be evaluated, under certain circumstances (see the\nlet and declare builtin commands, the (( compound command, and Arithmetic Expansion).  Evalu‐\nation  is  done  in  fixed-width integers with no check for overflow, though division by 0 is\ntrapped and flagged as an error.  The operators and their precedence, associativity, and val‐\nues  are the same as in the C language.  The following list of operators is grouped into lev‐\nels of equal-precedence operators.  The levels are listed in order of decreasing precedence.\n\nid++ id--\nvariable post-increment and post-decrement\n- +    unary minus and plus\n++id --id\nvariable pre-increment and pre-decrement\n! ~    logical and bitwise negation\nexponentiation\n* / %  multiplication, division, remainder\n+ -    addition, subtraction\n<< >>  left and right bitwise shifts\n\n#### <= >= < >\n\ncomparison\n== !=  equality and inequality\n&      bitwise AND\n^      bitwise exclusive OR\n|      bitwise OR\n&&     logical AND\n||     logical OR\nexpr?expr:expr\nconditional operator\n= *= /= %= += -= <<= >>= &= ^= |=\nassignment\nexpr1 , expr2\ncomma\n\nShell variables are allowed as operands; parameter expansion is performed before the  expres‐\nsion  is  evaluated.   Within  an  expression, shell variables may also be referenced by name\nwithout using the parameter expansion syntax.  A shell variable that is null or unset  evalu‐\nates to 0 when referenced by name without using the parameter expansion syntax.  The value of\na variable is evaluated as an arithmetic expression when it is referenced, or when a variable\nwhich  has  been  given  the  integer attribute using declare -i is assigned a value.  A null\nvalue evaluates to 0.  A shell variable need not have its integer attribute turned on  to  be\nused in an expression.\n\nInteger  constants follow the C language definition, without suffixes or character constants.\nConstants with a leading 0 are interpreted as octal numbers.  A  leading  0x  or  0X  denotes\nhexadecimal.  Otherwise, numbers take the form [base#]n, where the optional base is a decimal\nnumber between 2 and 64 representing the arithmetic base, and n is a number in that base.  If\nbase#  is  omitted, then base 10 is used.  When specifying n, if a non-digit is required, the\ndigits greater than 9 are represented by the lowercase letters, the uppercase letters, @, and\n,  in  that order.  If base is less than or equal to 36, lowercase and uppercase letters may\nbe used interchangeably to represent numbers between 10 and 35.\n\nOperators are evaluated in order of precedence.  Sub-expressions in parentheses are evaluated\nfirst and may override the precedence rules above.\n\n### CONDITIONAL EXPRESSIONS\n\nConditional  expressions  are used by the [[ compound command and the test and [ builtin com‐\nmands to test file attributes and perform string and arithmetic comparisons.  The test and  [\ncommands  determine  their behavior based on the number of arguments; see the descriptions of\nthose commands for any other command-specific actions.\n\nExpressions are formed from the following unary or binary primaries.   Bash  handles  several\nfilenames specially when they are used in expressions.  If the operating system on which bash\nis running provides these special files, bash will use them; otherwise it will  emulate  them\ninternally  with  this  behavior: If any file argument to one of the primaries is of the form\n/dev/fd/n, then file descriptor n is checked.  If the file argument to one of  the  primaries\nis  one of /dev/stdin, /dev/stdout, or /dev/stderr, file descriptor 0, 1, or 2, respectively,\nis checked.\n\nUnless otherwise specified, primaries that operate on files follow symbolic links and operate\non the target of the link, rather than the link itself.\n\nWhen  used  with  [[,  the < and > operators sort lexicographically using the current locale.\nThe test command sorts using ASCII ordering.\n\n#### -a\n\nTrue if file exists.\n\n#### -b\n\nTrue if file exists and is a block special file.\n\n#### -c\n\nTrue if file exists and is a character special file.\n\n#### -d\n\nTrue if file exists and is a directory.\n\n#### -e\n\nTrue if file exists.\n\n#### -f\n\nTrue if file exists and is a regular file.\n\n#### -g\n\nTrue if file exists and is set-group-id.\n\n#### -h\n\nTrue if file exists and is a symbolic link.\n\n#### -k\n\nTrue if file exists and its ``sticky'' bit is set.\n\n#### -p\n\nTrue if file exists and is a named pipe (FIFO).\n\n#### -r\n\nTrue if file exists and is readable.\n\n#### -s\n\nTrue if file exists and has a size greater than zero.\n\n#### -t\n\n#### -u\n\nTrue if file exists and its set-user-id bit is set.\n\n#### -w\n\nTrue if file exists and is writable.\n\n#### -x\n\nTrue if file exists and is executable.\n\n#### -G\n\nTrue if file exists and is owned by the effective group id.\n\n#### -L\n\nTrue if file exists and is a symbolic link.\n\n#### -N\n\nTrue if file exists and has been modified since it was last read.\n\n#### -O\n\nTrue if file exists and is owned by the effective user id.\n\n#### -S\n\nTrue if file exists and is a socket.\nfile1 -ef file2\nTrue if file1 and file2 refer to the same device and inode numbers.\nfile1 -nt file2\nTrue if file1 is newer (according to modification date) than file2, or if file1 exists\nand file2 does not.\nfile1 -ot file2\nTrue if file1 is older than file2, or if file2 exists and file1 does not.\n\n#### -o\n\nTrue  if  the  shell option optname is enabled.  See the list of options under the de‐\nscription of the -o option to the set builtin below.\n\n#### -v\n\nTrue if the shell variable varname is set (has been assigned a value).\n\n#### -R\n\nTrue if the shell variable varname is set and is a name reference.\n\n#### -z\n\nTrue if the length of string is zero.\nstring\n\n#### -n\n\nTrue if the length of string is non-zero.\n\nstring1 == string2\nstring1 = string2\nTrue if the strings are equal.  = should be used with the test command for POSIX  con‐\nformance.   When used with the [[ command, this performs pattern matching as described\nabove (Compound Commands).\n\nstring1 != string2\nTrue if the strings are not equal.\n\nstring1 < string2\nTrue if string1 sorts before string2 lexicographically.\n\nstring1 > string2\nTrue if string1 sorts after string2 lexicographically.\n\narg1 OP arg2\nOP is one of -eq, -ne, -lt, -le, -gt, or -ge.  These arithmetic binary  operators  re‐\nturn true if arg1 is equal to, not equal to, less than, less than or equal to, greater\nthan, or greater than or equal to arg2, respectively.  Arg1 and arg2 may  be  positive\nor  negative  integers.  When used with the [[ command, Arg1 and Arg2 are evaluated as\narithmetic expressions (see ARITHMETIC EVALUATION above).\n\n### SIMPLE COMMAND EXPANSION\n\nWhen a simple command is executed, the shell performs the following expansions,  assignments,\nand redirections, from left to right, in the following order.\n\n1.     The words that the parser has marked as variable assignments (those preceding the com‐\nmand name) and redirections are saved for later processing.\n\n2.     The words that are not variable assignments or  redirections  are  expanded.   If  any\nwords  remain  after  expansion, the first word is taken to be the name of the command\nand the remaining words are the arguments.\n\n3.     Redirections are performed as described above under REDIRECTION.\n\n4.     The text after the = in each variable assignment undergoes tilde expansion,  parameter\nexpansion,  command substitution, arithmetic expansion, and quote removal before being\nassigned to the variable.\n\nIf no command name results, the variable assignments affect the  current  shell  environment.\nOtherwise,  the variables are added to the environment of the executed command and do not af‐\nfect the current shell environment.  If any of the assignments attempts to assign a value  to\na readonly variable, an error occurs, and the command exits with a non-zero status.\n\nIf  no  command name results, redirections are performed, but do not affect the current shell\nenvironment.  A redirection error causes the command to exit with a non-zero status.\n\nIf there is a command name left after expansion, execution proceeds as described below.  Oth‐\nerwise,  the  command  exits.  If one of the expansions contained a command substitution, the\nexit status of the command is the exit status of the last command substitution performed.  If\nthere were no command substitutions, the command exits with a status of zero.\n\n### COMMAND EXECUTION\n\nAfter  a command has been split into words, if it results in a simple command and an optional\nlist of arguments, the following actions are taken.\n\nIf the command name contains no slashes, the shell attempts to locate it.  If there exists  a\nshell  function  by  that name, that function is invoked as described above in FUNCTIONS.  If\nthe name does not match a function, the shell searches for it in the list of shell  builtins.\nIf a match is found, that builtin is invoked.\n\nIf the name is neither a shell function nor a builtin, and contains no slashes, bash searches\neach element of the PATH for a directory containing an executable file by  that  name.   Bash\nuses  a  hash  table to remember the full pathnames of executable files (see hash under SHELL\nBUILTIN COMMANDS below).  A full search of the directories in PATH is performed only  if  the\ncommand  is  not  found in the hash table.  If the search is unsuccessful, the shell searches\nfor a defined shell function named commandnotfoundhandle.  If that function exists, it  is\ninvoked  in  a separate execution environment with the original command and the original com‐\nmand's arguments as its arguments, and the function's exit status becomes the exit status  of\nthat  subshell.   If  that function is not defined, the shell prints an error message and re‐\nturns an exit status of 127.\n\nIf the search is successful, or if the command name contains one or more slashes,  the  shell\nexecutes  the  named  program  in a separate execution environment.  Argument 0 is set to the\nname given, and the remaining arguments to the command are set to  the  arguments  given,  if\nany.\n\nIf  this  execution fails because the file is not in executable format, and the file is not a\ndirectory, it is assumed to be a shell script, a file containing shell commands.  A  subshell\nis  spawned to execute it.  This subshell reinitializes itself, so that the effect is as if a\nnew shell had been invoked to handle the script, with the exception  that  the  locations  of\ncommands  remembered by the parent (see hash below under SHELL BUILTIN COMMANDS) are retained\nby the child.\n\nIf the program is a file beginning with #!, the remainder of the first line specifies an  in‐\nterpreter for the program.  The shell executes the specified interpreter on operating systems\nthat do not handle this executable format themselves.  The arguments to the interpreter  con‐\nsist  of  a  single optional argument following the interpreter name on the first line of the\nprogram, followed by the name of the program, followed by the command arguments, if any.\n\n### COMMAND EXECUTION ENVIRONMENT\n\nThe shell has an execution environment, which consists of the following:\n\n•      open files inherited by the shell at invocation, as modified by redirections  supplied\nto the exec builtin\n\n•      the  current working directory as set by cd, pushd, or popd, or inherited by the shell\nat invocation\n\n•      the file creation mode mask as set by umask or inherited from the shell's parent\n\n•      current traps set by trap\n\n•      shell parameters that are set by variable assignment or with set or inherited from the\nshell's parent in the environment\n\n•      shell  functions  defined during execution or inherited from the shell's parent in the\nenvironment\n\n•      options enabled at invocation (either by default or with command-line arguments) or by\nset\n\n•      options enabled by shopt\n\n•      shell aliases defined with alias\n\n•      various  process  IDs,  including  those  of background jobs, the value of $$, and the\nvalue of PPID\n\nWhen a simple command other than a builtin or shell function is to be executed, it is invoked\nin  a separate execution environment that consists of the following.  Unless otherwise noted,\nthe values are inherited from the shell.\n\n\n•      the shell's open files, plus any modifications and additions specified by redirections\nto the command\n\n•      the current working directory\n\n•      the file creation mode mask\n\n•      shell variables and functions marked for export, along with variables exported for the\ncommand, passed in the environment\n\n•      traps caught by the shell are reset to the values inherited from the  shell's  parent,\nand traps ignored by the shell are ignored\n\nA  command  invoked in this separate environment cannot affect the shell's execution environ‐\nment.\n\nCommand substitution, commands grouped with parentheses, and asynchronous  commands  are  in‐\nvoked  in  a  subshell  environment that is a duplicate of the shell environment, except that\ntraps caught by the shell are reset to the values that the shell inherited from its parent at\ninvocation.   Builtin  commands that are invoked as part of a pipeline are also executed in a\nsubshell environment.  Changes made to the subshell environment cannot affect the shell's ex‐\necution environment.\n\nSubshells  spawned  to  execute command substitutions inherit the value of the -e option from\nthe parent shell.  When not in posix mode, bash clears the -e option in such subshells.\n\nIf a command is followed by a & and job control is not active, the default standard input for\nthe  command  is  the empty file /dev/null.  Otherwise, the invoked command inherits the file\ndescriptors of the calling shell as modified by redirections.\n\n### ENVIRONMENT\n\nWhen a program is invoked it is given an array of strings called the environment.  This is  a\nlist of name-value pairs, of the form name=value.\n\nThe  shell  provides  several  ways  to manipulate the environment.  On invocation, the shell\nscans its own environment and creates a parameter for each name found, automatically  marking\nit for export to child processes.  Executed commands inherit the environment.  The export and\ndeclare -x commands allow parameters and functions to be added to and deleted from the  envi‐\nronment.   If  the value of a parameter in the environment is modified, the new value becomes\npart of the environment, replacing the old.  The environment inherited by any  executed  com‐\nmand  consists of the shell's initial environment, whose values may be modified in the shell,\nless any pairs removed by the unset command, plus any additions via the export and declare -x\ncommands.\n\nThe  environment for any simple command or function may be augmented temporarily by prefixing\nit with parameter assignments, as described above in PARAMETERS.  These assignment statements\naffect only the environment seen by that command.\n\nIf  the  -k option is set (see the set builtin command below), then all parameter assignments\nare placed in the environment for a command, not just those that precede the command name.\n\nWhen bash invokes an external command, the variable  is set to the full filename of the com‐\nmand and passed to that command in its environment.\n\n### EXIT STATUS\n\nThe  exit  status  of an executed command is the value returned by the waitpid system call or\nequivalent function.  Exit statuses fall between 0 and 255, though, as explained  below,  the\nshell  may  use  values  above 125 specially.  Exit statuses from shell builtins and compound\ncommands are also limited to this range.  Under certain circumstances,  the  shell  will  use\nspecial values to indicate specific failure modes.\n\nFor  the  shell's  purposes, a command which exits with a zero exit status has succeeded.  An\nexit status of zero indicates success.  A non-zero exit status  indicates  failure.   When  a\ncommand terminates on a fatal signal N, bash uses the value of 128+N as the exit status.\n\nIf  a  command is not found, the child process created to execute it returns a status of 127.\nIf a command is found but is not executable, the return status is 126.\n\nIf a command fails because of an error during expansion or redirection, the  exit  status  is\ngreater than zero.\n\nShell  builtin commands return a status of 0 (true) if successful, and non-zero (false) if an\nerror occurs while they execute.  All builtins return an exit status of 2 to indicate  incor‐\nrect usage, generally invalid options or missing arguments.\n\nBash  itself  returns the exit status of the last command executed, unless a syntax error oc‐\ncurs, in which case it exits with a non-zero value.  See also the exit builtin command below.\n\n### SIGNALS\n\nWhen bash is interactive, in the absence of any traps, it ignores SIGTERM  (so  that  kill  0\ndoes  not  kill  an  interactive  shell),  and SIGINT is caught and handled (so that the wait\nbuiltin is interruptible).  In all cases, bash ignores SIGQUIT.  If job control is in effect,\nbash ignores SIGTTIN, SIGTTOU, and SIGTSTP.\n\nNon-builtin  commands  run  by  bash  have signal handlers set to the values inherited by the\nshell from its parent.  When job control is not in effect, asynchronous commands ignore  SIG‐‐\nINT and SIGQUIT in addition to these inherited handlers.  Commands run as a result of command\nsubstitution ignore the keyboard-generated job control signals SIGTTIN, SIGTTOU, and SIGTSTP.\n\nThe shell exits by default upon receipt of a SIGHUP.  Before exiting,  an  interactive  shell\nresends  the SIGHUP to all jobs, running or stopped.  Stopped jobs are sent SIGCONT to ensure\nthat they receive the SIGHUP.  To prevent the shell from sending the signal to  a  particular\njob, it should be removed from the jobs table with the disown builtin (see SHELL BUILTIN COM‐‐\nMANDS below) or marked to not receive SIGHUP using disown -h.\n\nIf the huponexit shell option has been set with shopt, bash sends a SIGHUP to all  jobs  when\nan interactive login shell exits.\n\nIf  bash is waiting for a command to complete and receives a signal for which a trap has been\nset, the trap will not be executed until the command completes.  When bash is waiting for  an\nasynchronous  command  via  the  wait builtin, the reception of a signal for which a trap has\nbeen set will cause the wait builtin to return immediately with an exit status  greater  than\n128, immediately after which the trap is executed.\n\n### JOB CONTROL\n\nJob  control  refers  to the ability to selectively stop (suspend) the execution of processes\nand continue (resume) their execution at a later point.  A user typically employs this facil‐\nity  via  an interactive interface supplied jointly by the operating system kernel's terminal\ndriver and bash.\n\nThe shell associates a job with each pipeline.  It keeps a table of currently executing jobs,\nwhich  may  be  listed  with the jobs command.  When bash starts a job asynchronously (in the\nbackground), it prints a line that looks like:\n\n[1] 25647\n\nindicating that this job is job number 1 and that the process ID of the last process  in  the\npipeline  associated  with  this job is 25647.  All of the processes in a single pipeline are\nmembers of the same job.  Bash uses the job abstraction as the basis for job control.\n\nTo facilitate the implementation of the user interface to job control, the  operating  system\nmaintains  the  notion of a current terminal process group ID.  Members of this process group\n(processes whose process group ID is equal to the current terminal process group ID)  receive\nkeyboard-generated signals such as SIGINT.  These processes are said to be in the foreground.\nBackground processes are those whose process group ID differs from the terminal's; such  pro‐\ncesses  are  immune  to keyboard-generated signals.  Only foreground processes are allowed to\nread from or, if the user so specifies with stty tostop, write to the  terminal.   Background\nprocesses  which  attempt  to read from (write to when stty tostop is in effect) the terminal\nare sent a SIGTTIN (SIGTTOU) signal by the kernel's terminal driver,  which,  unless  caught,\nsuspends the process.\n\nIf  the operating system on which bash is running supports job control, bash contains facili‐\nties to use it.  Typing the suspend character (typically ^Z, Control-Z) while  a  process  is\nrunning  causes  that  process to be stopped and returns control to bash.  Typing the delayed\nsuspend character (typically ^Y, Control-Y) causes the process to be stopped when it attempts\nto  read  input from the terminal, and control to be returned to bash.  The user may then ma‐\nnipulate the state of this job, using the bg command to continue it in the background, the fg\ncommand  to continue it in the foreground, or the kill command to kill it.  A ^Z takes effect\nimmediately, and has the additional side effect of causing pending output and typeahead to be\ndiscarded.\n\nThere  are a number of ways to refer to a job in the shell.  The character % introduces a job\nspecification (jobspec).  Job number n may be referred to as %n.  A job may also be  referred\nto using a prefix of the name used to start it, or using a substring that appears in its com‐\nmand line.  For example, %ce refers to a stopped job whose command name begins with ce.  If a\nprefix  matches  more  than  one  job, bash reports an error.  Using %?ce, on the other hand,\nrefers to any job containing the string ce in its command line.   If  the  substring  matches\nmore  than one job, bash reports an error.  The symbols %% and %+ refer to the shell's notion\nof the current job, which is the last job stopped while it was in the foreground  or  started\nin  the  background.  The previous job may be referenced using %-.  If there is only a single\njob, %+ and %- can both be used to refer to that job.  In output pertaining  to  jobs  (e.g.,\nthe output of the jobs command), the current job is always flagged with a +, and the previous\njob with a -.  A single % (with no accompanying job specification) also refers to the current\njob.\n\nSimply  naming  a  job  can be used to bring it into the foreground: %1 is a synonym for ``fg\n%1'', bringing job 1 from the background into the foreground.  Similarly,  ``%1  &''  resumes\njob 1 in the background, equivalent to ``bg %1''.\n\nThe  shell learns immediately whenever a job changes state.  Normally, bash waits until it is\nabout to print a prompt before reporting changes in a job's status so as to not interrupt any\nother  output.   If  the  -b  option to the set builtin command is enabled, bash reports such\nchanges immediately.  Any trap on SIGCHLD is executed for each child that exits.\n\nIf an attempt to exit bash is made while jobs are stopped (or, if the checkjobs shell  option\nhas  been enabled using the shopt builtin, running), the shell prints a warning message, and,\nif the checkjobs option is enabled, lists the jobs and their statuses.  The jobs command  may\nthen  be used to inspect their status.  If a second attempt to exit is made without an inter‐\nvening command, the shell does not print another warning, and any  stopped  jobs  are  termi‐\nnated.\n\nWhen the shell is waiting for a job or process using the wait builtin, and job control is en‐\nabled, wait will return when the job changes state. The -f option causes wait to  wait  until\nthe job or process terminates before returning.\n\n### PROMPTING\n\nWhen executing interactively, bash displays the primary prompt PS1 when it is ready to read a\ncommand, and the secondary prompt PS2 when it needs more input to complete a  command.   Bash\ndisplays  PS0  after  it  reads  a command but before executing it.  Bash displays PS4 as de‐\nscribed above before tracing each command when the -x option is enabled.  Bash  allows  these\nprompt strings to be customized by inserting a number of backslash-escaped special characters\nthat are decoded as follows:\n\\a     an ASCII bell character (07)\n\\d     the date in \"Weekday Month Date\" format (e.g., \"Tue May 26\")\n\\D{format}\nthe format is passed to strftime(3) and the result is inserted into the  prompt\nstring;  an empty format results in a locale-specific time representation.  The\nbraces are required\n\\e     an ASCII escape character (033)\n\\h     the hostname up to the first `.'\n\\H     the hostname\n\\j     the number of jobs currently managed by the shell\n\\l     the basename of the shell's terminal device name\n\\n     newline\n\\r     carriage return\n\\s     the name of the shell, the basename of $0  (the  portion  following  the  final\nslash)\n\\t     the current time in 24-hour HH:MM:SS format\n\\T     the current time in 12-hour HH:MM:SS format\n\\@     the current time in 12-hour am/pm format\n\\A     the current time in 24-hour HH:MM format\n\\u     the username of the current user\n\\v     the version of bash (e.g., 2.00)\n\\V     the release of bash, version + patch level (e.g., 2.00.0)\n\\w     the  current  working  directory, with $HOME abbreviated with a tilde (uses the\nvalue of the PROMPTDIRTRIM variable)\n\\W     the basename of the current working directory, with $HOME  abbreviated  with  a\ntilde\n\\!     the history number of this command\n\\#     the command number of this command\n\\$     if the effective UID is 0, a #, otherwise a $\n\\nnn   the character corresponding to the octal number nnn\n\\\\     a backslash\n\\[     begin  a  sequence  of  non-printing characters, which could be used to embed a\nterminal control sequence into the prompt\n\\]     end a sequence of non-printing characters\n\nThe command number and the history number are usually different: the history number of a com‐\nmand  is  its position in the history list, which may include commands restored from the his‐\ntory file (see HISTORY below), while the command number is the position in  the  sequence  of\ncommands  executed  during the current shell session.  After the string is decoded, it is ex‐\npanded via parameter expansion, command substitution, arithmetic  expansion,  and  quote  re‐\nmoval,  subject to the value of the promptvars shell option (see the description of the shopt\ncommand under SHELL BUILTIN COMMANDS below).  This can have unwanted side effects if  escaped\nportions  of  the  string appear within command substitution or contain characters special to\nword expansion.\n\n### READLINE\n\nThis is the library that handles reading input when using an interactive  shell,  unless  the\n--noediting option is given at shell invocation.  Line editing is also used when using the -e\noption to the read builtin.  By default, the line editing commands are similar  to  those  of\nEmacs.   A vi-style line editing interface is also available.  Line editing can be enabled at\nany time using the -o emacs or -o vi options to the set builtin (see SHELL  BUILTIN  COMMANDS\nbelow).   To  turn off line editing after the shell is running, use the +o emacs or +o vi op‐\ntions to the set builtin.\n\n#### Readline Notation\n\nIn this section, the Emacs-style notation is used to denote keystrokes.  Control keys are de‐\nnoted by C-key, e.g., C-n means Control-N.  Similarly, meta keys are denoted by M-key, so M-x\nmeans Meta-X.  (On keyboards without a meta key, M-x means ESC x, i.e., press the Escape  key\nthen  the x key.  This makes ESC the meta prefix.  The combination M-C-x means ESC-Control-x,\nor press the Escape key then hold the Control key while pressing the x key.)\n\nReadline commands may be given numeric arguments, which  normally  act  as  a  repeat  count.\nSometimes,  however,  it is the sign of the argument that is significant.  Passing a negative\nargument to a command that acts in the forward direction (e.g., kill-line) causes  that  com‐\nmand  to  act  in a backward direction.  Commands whose behavior with arguments deviates from\nthis are noted below.\n\nWhen a command is described as killing text, the text deleted is saved  for  possible  future\nretrieval  (yanking).   The killed text is saved in a kill ring.  Consecutive kills cause the\ntext to be accumulated into one unit, which can be yanked all at once.  Commands which do not\nkill text separate the chunks of text on the kill ring.\n\n#### Readline Initialization\n\nReadline is customized by putting commands in an initialization file (the inputrc file).  The\nname of this file is taken from the value of the INPUTRC variable.  If that variable  is  un‐\nset, the default is ~/.inputrc.  If that file  does not exist or cannot be read, the ultimate\ndefault is /etc/inputrc.  When a program which uses the readline library starts up, the  ini‐\ntialization  file  is read, and the key bindings and variables are set.  There are only a few\nbasic constructs allowed in the readline  initialization  file.   Blank  lines  are  ignored.\nLines  beginning  with  a # are comments.  Lines beginning with a $ indicate conditional con‐\nstructs.  Other lines denote key bindings and variable settings.\n\nThe default key-bindings may be changed with an inputrc file.  Other programs that  use  this\nlibrary may add their own commands and bindings.\n\nFor example, placing\n\nM-Control-u: universal-argument\nor\nC-Meta-u: universal-argument\ninto the inputrc would make M-C-u execute the readline command universal-argument.\n\nThe  following  symbolic character names are recognized: RUBOUT, DEL, ESC, LFD, NEWLINE, RET,\nRETURN, SPC, SPACE, and TAB.\n\nIn addition to command names, readline allows keys to be bound to a string that  is  inserted\nwhen the key is pressed (a macro).\n\n#### Readline Key Bindings\n\nThe  syntax for controlling key bindings in the inputrc file is simple.  All that is required\nis the name of the command or the text of a macro and a key sequence to which  it  should  be\nbound.   The  name may be specified in one of two ways: as a symbolic key name, possibly with\nMeta- or Control- prefixes, or as a key sequence.\n\nWhen using the form keyname:function-name or macro, keyname is the name of a key spelled  out\nin English.  For example:\n\nControl-u: universal-argument\nMeta-Rubout: backward-kill-word\nControl-o: \"> output\"\n\nIn  the above example, C-u is bound to the function universal-argument, M-DEL is bound to the\nfunction backward-kill-word, and C-o is bound to run the macro expressed on  the  right  hand\nside (that is, to insert the text ``> output'' into the line).\n\nIn  the  second  form,  \"keyseq\":function-name or macro, keyseq differs from keyname above in\nthat strings denoting an entire key sequence may be specified by placing the sequence  within\ndouble  quotes.   Some  GNU Emacs style key escapes can be used, as in the following example,\nbut the symbolic character names are not recognized.\n\n\"\\C-u\": universal-argument\n\"\\C-x\\C-r\": re-read-init-file\n\"\\e[11~\": \"Function Key 1\"\n\nIn this example, C-u is again bound to the function universal-argument.  C-x C-r is bound  to\nthe  function  re-read-init-file,  and ESC [ 1 1 ~ is bound to insert the text ``Function Key\n1''.\n\nThe full set of GNU Emacs style escape sequences is\n\\C-    control prefix\n\\M-    meta prefix\n\\e     an escape character\n\\\\     backslash\n\\\"     literal \"\n\\'     literal '\n\nIn addition to the GNU Emacs style escape sequences, a second set  of  backslash  escapes  is\navailable:\n\\a     alert (bell)\n\\b     backspace\n\\d     delete\n\\f     form feed\n\\n     newline\n\\r     carriage return\n\\t     horizontal tab\n\\v     vertical tab\n\\nnn   the  eight-bit  character whose value is the octal value nnn (one to three dig‐\nits)\n\\xHH   the eight-bit character whose value is the hexadecimal value HH (one or two hex\ndigits)\n\nWhen  entering  the text of a macro, single or double quotes must be used to indicate a macro\ndefinition.  Unquoted text is assumed to be a function name.  In the macro  body,  the  back‐\nslash  escapes described above are expanded.  Backslash will quote any other character in the\nmacro text, including \" and '.\n\nBash allows the current readline key bindings to be  displayed  or  modified  with  the  bind\nbuiltin command.  The editing mode may be switched during interactive use by using the -o op‐\ntion to the set builtin command (see SHELL BUILTIN COMMANDS below).\n\n#### Readline Variables\n\nReadline has variables that can be used to further customize its behavior.  A variable may be\nset in the inputrc file with a statement of the form\n\nset variable-name value\nor using the bind builtin command (see SHELL BUILTIN COMMANDS below).\n\nExcept  where  noted,  readline  variables  can  take the values On or Off (without regard to\ncase).  Unrecognized variable names are ignored.  When a variable value  is  read,  empty  or\nnull  values,  \"on\"  (case-insensitive),  and \"1\" are equivalent to On.  All other values are\nequivalent to Off.  The variables and their default values are:\n\n#### bell-style (audible)\n\nControls what happens when readline wants to ring the terminal bell.  If set to  none,\nreadline never rings the bell.  If set to visible, readline uses a visible bell if one\nis available.  If set to audible, readline attempts to ring the terminal's bell.\n\n#### bind-tty-special-chars (On)\n\nIf set to On, readline attempts to bind the control characters  treated  specially  by\nthe kernel's terminal driver to their readline equivalents.\n\n#### blink-matching-paren (Off)\n\nIf  set  to On, readline attempts to briefly move the cursor to an opening parenthesis\nwhen a closing parenthesis is inserted.\n\n#### colored-completion-prefix (Off)\n\nIf set to On, when listing completions, readline displays the common prefix of the set\nof possible completions using a different color.  The color definitions are taken from\nthe value of the LSCOLORS environment variable.\n\n#### colored-stats (Off)\n\nIf set to On, readline displays possible completions using different colors  to  indi‐\ncate their file type.  The color definitions are taken from the value of the LSCOLORS\nenvironment variable.\n\n#### comment-begin (``#'')\n\nThe string that is inserted when the  readline  insert-comment  command  is  executed.\nThis command is bound to M-# in emacs mode and to # in vi command mode.\n\n#### completion-display-width (-1)\n\nThe  number of screen columns used to display possible matches when performing comple‐\ntion.  The value is ignored if it is less than 0 or greater than the  terminal  screen\nwidth.   A  value  of  0 will cause matches to be displayed one per line.  The default\nvalue is -1.\n\n#### completion-ignore-case (Off)\n\nIf set to On, readline performs filename matching and completion in a case-insensitive\nfashion.\n\n#### completion-map-case (Off)\n\nIf  set  to On, and completion-ignore-case is enabled, readline treats hyphens (-) and\nunderscores () as equivalent when performing case-insensitive filename  matching  and\ncompletion.\n\n#### completion-prefix-display-length (0)\n\nThe  length  in characters of the common prefix of a list of possible completions that\nis displayed without modification.  When set to a value greater than zero, common pre‐\nfixes  longer  than  this value are replaced with an ellipsis when displaying possible\ncompletions.\n\n#### completion-query-items (100)\n\nThis determines when the user is queried about viewing the number of possible  comple‐\ntions  generated  by  the  possible-completions command.  It may be set to any integer\nvalue greater than or equal to zero.  If the number of possible completions is greater\nthan or equal to the value of this variable, readline will ask whether or not the user\nwishes to view them; otherwise they are simply listed on the terminal.\n\n#### convert-meta (On)\n\nIf set to On, readline will convert characters with the eighth bit set to an ASCII key\nsequence by stripping the eighth bit and prefixing an escape character (in effect, us‐\ning escape as the meta prefix).  The default is On, but readline will set it to Off if\nthe locale contains eight-bit characters.\n\n#### disable-completion (Off)\n\nIf  set  to  On, readline will inhibit word completion.  Completion characters will be\ninserted into the line as if they had been mapped to self-insert.\n\n#### echo-control-characters (On)\n\nWhen set to On, on operating systems that indicate they support it, readline echoes  a\ncharacter corresponding to a signal generated from the keyboard.\n\n#### editing-mode (emacs)\n\nControls  whether  readline  begins with a set of key bindings similar to Emacs or vi.\nediting-mode can be set to either emacs or vi.\n\n#### emacs-mode-string (@)\n\nIf the show-mode-in-prompt variable is enabled, this string is  displayed  immediately\nbefore  the  last  line  of the primary prompt when emacs editing mode is active.  The\nvalue is expanded like a key binding, so the standard set of meta-  and  control  pre‐\nfixes and backslash escape sequences is available.  Use the \\1 and \\2 escapes to begin\nand end sequences of non-printing characters, which can be used to  embed  a  terminal\ncontrol sequence into the mode string.\n\n#### enable-bracketed-paste (On)\n\nWhen  set  to On, readline will configure the terminal in a way that will enable it to\ninsert each paste into the editing buffer as a single string of characters, instead of\ntreating  each  character  as if it had been read from the keyboard.  This can prevent\npasted characters from being interpreted as editing commands.\n\n#### enable-keypad (Off)\n\nWhen set to On, readline will try to enable the application keypad when it is  called.\nSome systems need this to enable the arrow keys.\n\n#### enable-meta-key (On)\n\nWhen  set to On, readline will try to enable any meta modifier key the terminal claims\nto support when it is called.  On many terminals, the meta key is used to send  eight-\nbit characters.\n\n#### expand-tilde (Off)\n\nIf set to On, tilde expansion is performed when readline attempts word completion.\n\n#### history-preserve-point (Off)\n\nIf  set  to  On, the history code attempts to place point at the same location on each\nhistory line retrieved with previous-history or next-history.\n\n#### history-size (unset)\n\nSet the maximum number of history entries saved in the history list.  If set to  zero,\nany  existing  history  entries are deleted and no new entries are saved.  If set to a\nvalue less than zero, the number of history entries is not limited.  By  default,  the\nnumber  of  history entries is set to the value of the HISTSIZE shell variable.  If an\nattempt is made to set history-size to a non-numeric value, the maximum number of his‐\ntory entries will be set to 500.\n\n#### horizontal-scroll-mode (Off)\n\nWhen set to On, makes readline use a single line for display, scrolling the input hor‐\nizontally on a single screen line when it becomes longer than the screen width  rather\nthan  wrapping  to a new line.  This setting is automatically enabled for terminals of\nheight 1.\n\n#### input-meta (Off)\n\nIf set to On, readline will enable eight-bit input (that is, it  will  not  strip  the\neighth  bit  from  the characters it reads), regardless of what the terminal claims it\ncan support.  The name meta-flag is a synonym for this variable.  The default is  Off,\nbut readline will set it to On if the locale contains eight-bit characters.\n\n#### isearch-terminators (``C-[C-J'')\n\nThe  string  of  characters that should terminate an incremental search without subse‐\nquently executing the character as a command.  If this variable has not been  given  a\nvalue, the characters ESC and C-J will terminate an incremental search.\n\n#### keymap (emacs)\n\nSet  the current readline keymap.  The set of valid keymap names is emacs, emacs-stan‐\ndard, emacs-meta, emacs-ctlx, vi, vi-command, and  vi-insert.   vi  is  equivalent  to\nvi-command;  emacs  is  equivalent to emacs-standard.  The default value is emacs; the\nvalue of editing-mode also affects the default keymap.\n\n#### keyseq-timeout (500)\n\nSpecifies the duration readline will wait for a character when  reading  an  ambiguous\nkey  sequence  (one that can form a complete key sequence using the input read so far,\nor can take additional input to complete a longer key sequence).  If no input  is  re‐\nceived  within  the  timeout, readline will use the shorter but complete key sequence.\nThe value is specified in milliseconds, so a value of 1000 means  that  readline  will\nwait one second for additional input.  If this variable is set to a value less than or\nequal to zero, or to a non-numeric value, readline will  wait  until  another  key  is\npressed to decide which key sequence to complete.\n\n#### mark-directories (On)\n\nIf set to On, completed directory names have a slash appended.\n\n#### mark-modified-lines (Off)\n\nIf set to On, history lines that have been modified are displayed with a preceding as‐\nterisk (*).\n\n#### mark-symlinked-directories (Off)\n\nIf set to On, completed names which are symbolic links to directories have a slash ap‐\npended (subject to the value of mark-directories).\n\n#### match-hidden-files (On)\n\nThis variable, when set to On, causes readline to match files whose names begin with a\n`.' (hidden files) when performing filename completion.  If set to  Off,  the  leading\n`.' must be supplied by the user in the filename to be completed.\n\n#### menu-complete-display-prefix (Off)\n\nIf  set to On, menu completion displays the common prefix of the list of possible com‐\npletions (which may be empty) before cycling through the list.\n\n#### output-meta (Off)\n\nIf set to On, readline will display characters with the eighth bit set directly rather\nthan as a meta-prefixed escape sequence.  The default is Off, but readline will set it\nto On if the locale contains eight-bit characters.\n\n#### page-completions (On)\n\nIf set to On, readline uses an internal more-like pager to display a screenful of pos‐\nsible completions at a time.\n\n#### print-completions-horizontally (Off)\n\nIf  set  to  On, readline will display completions with matches sorted horizontally in\nalphabetical order, rather than down the screen.\n\n#### revert-all-at-newline (Off)\n\nIf set to On, readline will undo all changes to history lines  before  returning  when\naccept-line  is  executed.  By default, history lines may be modified and retain indi‐\nvidual undo lists across calls to readline.\n\n#### show-all-if-ambiguous (Off)\n\nThis alters the default behavior of the completion functions.  If  set  to  On,  words\nwhich  have  more  than one possible completion cause the matches to be listed immedi‐\nately instead of ringing the bell.\n\n#### show-all-if-unmodified (Off)\n\nThis alters the default behavior of the completion functions in a fashion  similar  to\nshow-all-if-ambiguous.   If set to On, words which have more than one possible comple‐\ntion without any possible partial completion (the possible completions don't  share  a\ncommon prefix) cause the matches to be listed immediately instead of ringing the bell.\n\n#### show-mode-in-prompt (Off)\n\nIf set to On, add a string to the beginning of the prompt indicating the editing mode:\nemacs, vi command, or  vi  insertion.   The  mode  strings  are  user-settable  (e.g.,\nemacs-mode-string).\n\n#### skip-completed-text (Off)\n\nIf  set  to  On,  this  alters the default completion behavior when inserting a single\nmatch into the line.  It's only active when performing completion in the middle  of  a\nword.   If enabled, readline does not insert characters from the completion that match\ncharacters after point in the word being completed, so portions of the word  following\nthe cursor are not duplicated.\n\n#### vi-cmd-mode-string ((cmd))\n\nIf  the  show-mode-in-prompt variable is enabled, this string is displayed immediately\nbefore the last line of the primary prompt when vi editing mode is active and in  com‐\nmand mode.  The value is expanded like a key binding, so the standard set of meta- and\ncontrol prefixes and backslash escape sequences is available.  Use the \\1 and  \\2  es‐\ncapes  to begin and end sequences of non-printing characters, which can be used to em‐\nbed a terminal control sequence into the mode string.\n\n#### vi-ins-mode-string ((ins))\n\nIf the show-mode-in-prompt variable is enabled, this string is  displayed  immediately\nbefore  the  last line of the primary prompt when vi editing mode is active and in in‐\nsertion mode.  The value is expanded like a key binding, so the standard set of  meta-\nand  control  prefixes and backslash escape sequences is available.  Use the \\1 and \\2\nescapes to begin and end sequences of non-printing characters, which can  be  used  to\nembed a terminal control sequence into the mode string.\n\n#### visible-stats (Off)\n\nIf set to On, a character denoting a file's type as reported by stat(2) is appended to\nthe filename when listing possible completions.\n\n#### Readline Conditional Constructs\n\nReadline implements a facility similar in spirit to the conditional compilation  features  of\nthe C preprocessor which allows key bindings and variable settings to be performed as the re‐\nsult of tests.  There are four parser directives used.\n\n$if    The $if construct allows bindings to be made based on the editing mode,  the  terminal\nbeing  used,  or the application using readline.  The text of the test, after any com‐\nparison operator,\nextends to the end of the line; unless otherwise noted, no characters are required to\nisolate it.\n\nmode   The  mode=  form  of  the  $if directive is used to test whether readline is in\nemacs or vi mode.  This may be used in conjunction with the set keymap command,\nfor instance, to set bindings in the emacs-standard and emacs-ctlx keymaps only\nif readline is starting out in emacs mode.\n\nterm   The term= form may be used to include terminal-specific key  bindings,  perhaps\nto  bind the key sequences output by the terminal's function keys.  The word on\nthe right side of the = is tested against both the full name  of  the  terminal\nand  the  portion  of the terminal name before the first -.  This allows sun to\nmatch both sun and sun-cmd, for instance.\n\nversion\nThe version test may be used to perform comparisons against  specific  readline\nversions.   The  version  expands  to the current readline version.  The set of\ncomparison operators includes =, (and ==), !=, <=, >=, <, and >.   The  version\nnumber  supplied  on the right side of the operator consists of a major version\nnumber, an optional decimal point, and an optional minor version  (e.g.,  7.1).\nIf  the  minor  version is omitted, it is assumed to be 0.  The operator may be\nseparated from the string version and  from  the  version  number  argument  by\nwhitespace.\n\napplication\nThe  application  construct  is  used to include application-specific settings.\nEach program using the readline library sets the application name, and an  ini‐\ntialization  file  can test for a particular value.  This could be used to bind\nkey sequences to functions useful for a specific program.   For  instance,  the\nfollowing  command adds a key sequence that quotes the current or previous word\nin bash:\n\n$if Bash\n# Quote the current or previous word\n\"\\C-xq\": \"\\eb\\\"\\ef\\\"\"\n$endif\n\nvariable\nThe variable construct provides simple equality tests  for  readline  variables\nand  values.   The permitted comparison operators are =, ==, and !=.  The vari‐\nable name must be separated from the comparison operator by whitespace; the op‐\nerator  may  be  separated from the value on the right hand side by whitespace.\nBoth string and boolean variables may be  tested.  Boolean  variables  must  be\ntested against the values on and off.\n\n$endif This command, as seen in the previous example, terminates an $if command.\n\n$else  Commands in this branch of the $if directive are executed if the test fails.\n\n#### $include\n\nThis  directive takes a single filename as an argument and reads commands and bindings\nfrom that file.  For example, the following directive would read /etc/inputrc:\n\n$include  /etc/inputrc\n\n#### Searching\n\nReadline provides commands for searching through the command history (see HISTORY below)  for\nlines  containing a specified string.  There are two search modes: incremental and non-incre‐\nmental.\n\nIncremental searches begin before the user has finished typing the search  string.   As  each\ncharacter  of  the  search string is typed, readline displays the next entry from the history\nmatching the string typed so far.  An incremental search requires only as many characters  as\nneeded  to  find  the  desired  history  entry.   The  characters present in the value of the\nisearch-terminators variable are used to terminate an incremental search.  If  that  variable\nhas not been assigned a value the Escape and Control-J characters will terminate an incremen‐\ntal search.  Control-G will abort an incremental search and restore the original line.   When\nthe  search is terminated, the history entry containing the search string becomes the current\nline.\n\nTo find other matching entries in the history list, type Control-S or Control-R as  appropri‐\nate.   This  will  search  backward or forward in the history for the next entry matching the\nsearch string typed so far.  Any other key sequence bound to a readline command  will  termi‐\nnate  the search and execute that command.  For instance, a newline will terminate the search\nand accept the line, thereby executing the command from the history list.\n\nReadline remembers the last incremental search string.  If two Control-Rs are  typed  without\nany  intervening  characters  defining  a  new search string, any remembered search string is\nused.\n\nNon-incremental searches read the entire search string before starting to search for matching\nhistory  lines.  The search string may be typed by the user or be part of the contents of the\ncurrent line.\n\n#### Readline Command Names\n\nThe following is a list of the names of the commands and the default key sequences  to  which\nthey  are  bound.  Command names without an accompanying key sequence are unbound by default.\nIn the following descriptions, point refers to the current cursor position, and  mark  refers\nto  a  cursor position saved by the set-mark command.  The text between the point and mark is\nreferred to as the region.\n\n#### Commands for Moving\n\n#### beginning-of-line (C-a)\n\nMove to the start of the current line.\n\n#### end-of-line (C-e)\n\nMove to the end of the line.\n\n#### forward-char (C-f)\n\nMove forward a character.\n\n#### backward-char (C-b)\n\nMove back a character.\n\n#### forward-word (M-f)\n\nMove forward to the end of the next word.  Words are composed of alphanumeric  charac‐\nters (letters and digits).\n\n#### backward-word (M-b)\n\nMove  back  to  the  start of the current or previous word.  Words are composed of al‐\nphanumeric characters (letters and digits).\n\n#### shell-forward-word\n\nMove forward to the end of the next word.  Words are  delimited  by  non-quoted  shell\nmetacharacters.\n\n#### shell-backward-word\n\nMove  back  to the start of the current or previous word.  Words are delimited by non-\nquoted shell metacharacters.\n\n#### previous-screen-line\n\nAttempt to move point to the same physical screen  column  on  the  previous  physical\nscreen  line.  This will not have the desired effect if the current Readline line does\nnot take up more than one physical line or if point is not greater than the length  of\nthe prompt plus the screen width.\n\n#### next-screen-line\n\nAttempt  to  move point to the same physical screen column on the next physical screen\nline. This will not have the desired effect if the current Readline line does not take\nup  more  than  one physical line or if the length of the current Readline line is not\ngreater than the length of the prompt plus the screen width.\n\n#### clear-display (M-C-l)\n\nClear the screen and, if possible, the terminal's scrollback buffer, then  redraw  the\ncurrent line, leaving the current line at the top of the screen.\n\n#### clear-screen (C-l)\n\nClear the screen, then redraw the current line, leaving the current line at the top of\nthe screen.  With an argument, refresh the current line without clearing the screen.\n\n#### redraw-current-line\n\nRefresh the current line.\n\n#### Commands for Manipulating the History\n\n#### accept-line (Newline, Return)\n\nAccept the line regardless of where the cursor is.  If this line is non-empty, add  it\nto  the  history list according to the state of the HISTCONTROL variable.  If the line\nis a modified history line, then restore the history line to its original state.\n\n#### previous-history (C-p)\n\nFetch the previous command from the history list, moving back in the list.\n\n#### next-history (C-n)\n\nFetch the next command from the history list, moving forward in the list.\n\n#### beginning-of-history (M-<)\n\nMove to the first line in the history.\n\n#### end-of-history (M->)\n\nMove to the end of the input history, i.e., the line currently being entered.\n\n#### reverse-search-history (C-r)\n\nSearch backward starting at the current line and moving `up' through  the  history  as\nnecessary.  This is an incremental search.\n\n#### forward-search-history (C-s)\n\nSearch  forward  starting at the current line and moving `down' through the history as\nnecessary.  This is an incremental search.\n\n#### non-incremental-reverse-search-history (M-p)\n\nSearch backward through the history starting at the current line using a non-incremen‐\ntal search for a string supplied by the user.\n\n#### non-incremental-forward-search-history (M-n)\n\nSearch  forward  through  the history using a non-incremental search for a string sup‐\nplied by the user.\n\n#### history-search-forward\n\nSearch forward through the history for the string of characters between the  start  of\nthe current line and the point.  This is a non-incremental search.\n\n#### history-search-backward\n\nSearch  backward through the history for the string of characters between the start of\nthe current line and the point.  This is a non-incremental search.\n\n#### history-substring-search-backward\n\nSearch backward through the history for the string of characters between the start  of\nthe  current  line and the current cursor position (the point).  The search string may\nmatch anywhere in a history line.  This is a non-incremental search.\n\n#### history-substring-search-forward\n\nSearch forward through the history for the string of characters between the  start  of\nthe  current  line  and  the point.  The search string may match anywhere in a history\nline.  This is a non-incremental search.\n\n#### yank-nth-arg (M-C-y)\n\nInsert the first argument to the previous command (usually the second word on the pre‐\nvious  line) at point.  With an argument n, insert the nth word from the previous com‐\nmand (the words in the previous command begin with word 0).  A negative  argument  in‐\nserts  the nth word from the end of the previous command.  Once the argument n is com‐\nputed, the argument is extracted as if the \"!n\" history expansion had been specified.\nyank-last-arg (M-., M-)\nInsert the last argument to the previous command (the last word of the  previous  his‐\ntory  entry).   With a numeric argument, behave exactly like yank-nth-arg.  Successive\ncalls to yank-last-arg move back through the history list, inserting the last word (or\nthe  word  specified by the argument to the first call) of each line in turn.  Any nu‐\nmeric argument supplied to these successive calls determines  the  direction  to  move\nthrough  the  history.  A negative argument switches the direction through the history\n(back or forward).  The history expansion facilities are  used  to  extract  the  last\nword, as if the \"!$\" history expansion had been specified.\n\n#### shell-expand-line (M-C-e)\n\nExpand  the line as the shell does.  This performs alias and history expansion as well\nas all of the shell word expansions.  See HISTORY EXPANSION below for a description of\nhistory expansion.\n\n#### history-expand-line (M-^)\n\nPerform  history expansion on the current line.  See HISTORY EXPANSION below for a de‐\nscription of history expansion.\n\n#### magic-space\n\nPerform history expansion on the current line and insert a space.  See HISTORY  EXPAN‐‐\nSION below for a description of history expansion.\n\n#### alias-expand-line\n\nPerform  alias  expansion on the current line.  See ALIASES above for a description of\nalias expansion.\n\n#### history-and-alias-expand-line\n\nPerform history and alias expansion on the current line.\ninsert-last-argument (M-., M-)\nA synonym for yank-last-arg.\n\n#### operate-and-get-next (C-o)\n\nAccept the current line for execution and fetch the next line relative to the  current\nline  from  the  history  for editing.  A numeric argument, if supplied, specifies the\nhistory entry to use instead of the current line.\n\n#### edit-and-execute-command (C-x C-e)\n\nInvoke an editor on the current command line, and execute the  result  as  shell  com‐\nmands.  Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that or‐\nder.\n\n#### Commands for Changing Text\n\nend-of-file (usually C-d)\nThe character indicating end-of-file as set, for example, by ``stty''.  If this  char‐\nacter  is read when there are no characters on the line, and point is at the beginning\nof the line, Readline interprets it as the end of input and returns EOF.\n\n#### delete-char (C-d)\n\nDelete the character at point.  If this function is bound to the same character as the\ntty EOF character, as C-d commonly is, see above for the effects.\n\n#### backward-delete-char (Rubout)\n\nDelete  the  character  behind  the  cursor.   When given a numeric argument, save the\ndeleted text on the kill ring.\n\n#### forward-backward-delete-char\n\nDelete the character under the cursor, unless the cursor is at the end of the line, in\nwhich case the character behind the cursor is deleted.\n\n#### quoted-insert (C-q, C-v)\n\nAdd  the  next character typed to the line verbatim.  This is how to insert characters\nlike C-q, for example.\n\n#### tab-insert (C-v TAB)\n\nInsert a tab character.\n\n#### self-insert (a, b, A, 1, !, ...)\n\nInsert the character typed.\n\n#### transpose-chars (C-t)\n\nDrag the character before point forward over the character at point, moving point for‐\nward  as well.  If point is at the end of the line, then this transposes the two char‐\nacters before point.  Negative arguments have no effect.\n\n#### transpose-words (M-t)\n\nDrag the word before point past the word after point, moving point over that  word  as\nwell.   If  point is at the end of the line, this transposes the last two words on the\nline.\n\n#### upcase-word (M-u)\n\nUppercase the current (or following) word.  With a negative  argument,  uppercase  the\nprevious word, but do not move point.\n\n#### downcase-word (M-l)\n\nLowercase  the  current  (or following) word.  With a negative argument, lowercase the\nprevious word, but do not move point.\n\n#### capitalize-word (M-c)\n\nCapitalize the current (or following) word.  With a negative argument, capitalize  the\nprevious word, but do not move point.\n\n#### overwrite-mode\n\nToggle  overwrite mode.  With an explicit positive numeric argument, switches to over‐\nwrite mode.  With an explicit non-positive numeric argument, switches to insert  mode.\nThis  command  affects only emacs mode; vi mode does overwrite differently.  Each call\nto readline() starts in insert mode.  In overwrite mode, characters bound to  self-in‐‐\nsert  replace the text at point rather than pushing the text to the right.  Characters\nbound to backward-delete-char replace the character before point with a space.  By de‐\nfault, this command is unbound.\n\n#### Killing and Yanking\n\n#### kill-line (C-k)\n\nKill the text from point to the end of the line.\n\n#### backward-kill-line (C-x Rubout)\n\nKill backward to the beginning of the line.\n\n#### unix-line-discard (C-u)\n\nKill  backward  from  point to the beginning of the line.  The killed text is saved on\nthe kill-ring.\n\n#### kill-whole-line\n\nKill all characters on the current line, no matter where point is.\n\n#### kill-word (M-d)\n\nKill from point to the end of the current word, or if between words, to the end of the\nnext word.  Word boundaries are the same as those used by forward-word.\n\n#### backward-kill-word (M-Rubout)\n\nKill  the  word  behind  point.   Word  boundaries are the same as those used by back‐‐\nward-word.\n\n#### shell-kill-word\n\nKill from point to the end of the current word, or if between words, to the end of the\nnext word.  Word boundaries are the same as those used by shell-forward-word.\n\n#### shell-backward-kill-word\n\nKill the word behind point.  Word boundaries are the same as those used by shell-back‐‐\nward-word.\n\n#### unix-word-rubout (C-w)\n\nKill the word behind point, using white space as a word boundary.  The killed text  is\nsaved on the kill-ring.\n\n#### unix-filename-rubout\n\nKill  the  word  behind  point,  using white space and the slash character as the word\nboundaries.  The killed text is saved on the kill-ring.\n\n#### delete-horizontal-space (M-\\)\n\nDelete all spaces and tabs around point.\n\n#### kill-region\n\nKill the text in the current region.\n\n#### copy-region-as-kill\n\nCopy the text in the region to the kill buffer.\n\n#### copy-backward-word\n\nCopy the word before point to the kill buffer.  The word boundaries are  the  same  as\nbackward-word.\n\n#### copy-forward-word\n\nCopy the word following point to the kill buffer.  The word boundaries are the same as\nforward-word.\n\n#### yank (C-y)\n\nYank the top of the kill ring into the buffer at point.\n\n#### yank-pop (M-y)\n\nRotate the kill ring, and yank the new top.  Only works following yank or yank-pop.\n\n#### Numeric Arguments\n\n#### digit-argument (M-0, M-1, ..., M--)\n\nAdd this digit to the argument already accumulating, or start  a  new  argument.   M--\nstarts a negative argument.\n\n#### universal-argument\n\nThis  is  another  way  to specify an argument.  If this command is followed by one or\nmore digits, optionally with a leading minus sign, those digits define  the  argument.\nIf  the command is followed by digits, executing universal-argument again ends the nu‐\nmeric argument, but is otherwise ignored.  As a special case, if this command is imme‐\ndiately  followed  by a character that is neither a digit nor minus sign, the argument\ncount for the next command is multiplied by four.  The  argument  count  is  initially\none, so executing this function the first time makes the argument count four, a second\ntime makes the argument count sixteen, and so on.\n\n#### Completing\n\n#### complete (TAB)\n\nAttempt to perform completion on the text  before  point.   Bash  attempts  completion\ntreating the text as a variable (if the text begins with $), username (if the text be‐\ngins with ~), hostname (if the text begins with @), or command (including aliases  and\nfunctions)  in  turn.   If  none of these produces a match, filename completion is at‐\ntempted.\n\n#### possible-completions (M-?)\n\nList the possible completions of the text before point.\ninsert-completions (M-*)\nInsert all completions of the text before point that would have been generated by pos‐‐\nsible-completions.\n\n#### menu-complete\n\nSimilar  to  complete,  but replaces the word to be completed with a single match from\nthe list of possible completions.  Repeated execution of menu-complete  steps  through\nthe  list  of  possible  completions, inserting each match in turn.  At the end of the\nlist of completions, the bell is rung (subject to the setting of bell-style)  and  the\noriginal  text is restored.  An argument of n moves n positions forward in the list of\nmatches; a negative argument may be used to move backward through the list.  This com‐\nmand is intended to be bound to TAB, but is unbound by default.\n\n#### menu-complete-backward\n\nIdentical  to  menu-complete,  but moves backward through the list of possible comple‐\ntions, as if menu-complete had been given a negative argument.  This  command  is  un‐\nbound by default.\n\n#### delete-char-or-list\n\nDeletes  the  character  under  the  cursor if not at the beginning or end of the line\n(like delete-char).  If at the end of the line, behaves identically  to  possible-com‐‐\npletions.  This command is unbound by default.\n\n#### complete-filename (M-/)\n\nAttempt filename completion on the text before point.\n\n#### possible-filename-completions (C-x /)\n\nList the possible completions of the text before point, treating it as a filename.\n\n#### complete-username (M-~)\n\nAttempt completion on the text before point, treating it as a username.\n\n#### possible-username-completions (C-x ~)\n\nList the possible completions of the text before point, treating it as a username.\n\n#### complete-variable (M-$)\n\nAttempt completion on the text before point, treating it as a shell variable.\n\n#### possible-variable-completions (C-x $)\n\nList  the  possible completions of the text before point, treating it as a shell vari‐\nable.\n\n#### complete-hostname (M-@)\n\nAttempt completion on the text before point, treating it as a hostname.\n\n#### possible-hostname-completions (C-x @)\n\nList the possible completions of the text before point, treating it as a hostname.\n\n#### complete-command (M-!)\n\nAttempt completion on the text before point, treating it as a command  name.   Command\ncompletion  attempts  to  match  the text against aliases, reserved words, shell func‐\ntions, shell builtins, and finally executable filenames, in that order.\n\n#### possible-command-completions (C-x !)\n\nList the possible completions of the text before point, treating it as a command name.\n\n#### dynamic-complete-history (M-TAB)\n\nAttempt completion on the text before point, comparing the text against lines from the\nhistory list for possible completion matches.\n\n#### dabbrev-expand\n\nAttempt  menu  completion  on  the text before point, comparing the text against lines\nfrom the history list for possible completion matches.\n\n#### complete-into-braces (M-{)\n\nPerform filename completion and insert  the  list  of  possible  completions  enclosed\nwithin braces so the list is available to the shell (see Brace Expansion above).\n\n#### Keyboard Macros\n\n#### start-kbd-macro (C-x ()\n\nBegin saving the characters typed into the current keyboard macro.\n\n#### end-kbd-macro (C-x ))\n\nStop saving the characters typed into the current keyboard macro and store the defini‐\ntion.\n\n#### call-last-kbd-macro (C-x e)\n\nRe-execute the last keyboard macro defined, by making the characters in the macro  ap‐\npear as if typed at the keyboard.\n\n#### print-last-kbd-macro ()\n\nPrint the last keyboard macro defined in a format suitable for the inputrc file.\n\n#### Miscellaneous\n\n#### re-read-init-file (C-x C-r)\n\nRead in the contents of the inputrc file, and incorporate any bindings or variable as‐\nsignments found there.\n\n#### abort (C-g)\n\nAbort the current editing command and ring the terminal's bell (subject to the setting\nof bell-style).\ndo-lowercase-version (M-A, M-B, M-x, ...)\nIf  the metafied character x is uppercase, run the command that is bound to the corre‐\nsponding metafied lowercase character.  The behavior is undefined if x is already low‐\nercase.\n\n#### prefix-meta (ESC)\n\nMetafy the next character typed.  ESC f is equivalent to Meta-f.\nundo (C-, C-x C-u)\nIncremental undo, separately remembered for each line.\n\n#### revert-line (M-r)\n\nUndo  all  changes  made to this line.  This is like executing the undo command enough\ntimes to return the line to its initial state.\n\n#### tilde-expand (M-&)\n\nPerform tilde expansion on the current word.\n\n#### set-mark (C-@, M-<space>)\n\nSet the mark to the point.  If a numeric argument is supplied, the mark is set to that\nposition.\n\n#### exchange-point-and-mark (C-x C-x)\n\nSwap  the  point with the mark.  The current cursor position is set to the saved posi‐\ntion, and the old cursor position is saved as the mark.\n\n#### character-search (C-])\n\nA character is read and point is moved to the next occurrence of  that  character.   A\nnegative count searches for previous occurrences.\n\n#### character-search-backward (M-C-])\n\nA  character  is read and point is moved to the previous occurrence of that character.\nA negative count searches for subsequent occurrences.\n\n#### skip-csi-sequence\n\nRead enough characters to consume a multi-key sequence such as those defined for  keys\nlike Home and End.  Such sequences begin with a Control Sequence Indicator (CSI), usu‐\nally ESC-[.  If this sequence is bound to \"\\[\", keys  producing  such  sequences  will\nhave  no  effect  unless  explicitly bound to a readline command, instead of inserting\nstray characters into the editing buffer.  This is unbound  by  default,  but  usually\nbound to ESC-[.\n\n#### insert-comment (M-#)\n\nWithout  a  numeric  argument, the value of the readline comment-begin variable is in‐\nserted at the beginning of the current line.  If a numeric argument is supplied,  this\ncommand  acts as a toggle: if the characters at the beginning of the line do not match\nthe value of comment-begin, the value is inserted, otherwise the  characters  in  com‐‐\nment-begin  are  deleted  from the beginning of the line.  In either case, the line is\naccepted as if a newline had been typed.  The default value  of  comment-begin  causes\nthis  command  to make the current line a shell comment.  If a numeric argument causes\nthe comment character to be removed, the line will be executed by the shell.\n\n#### glob-complete-word (M-g)\n\nThe word before point is treated as a pattern for pathname expansion, with an asterisk\nimplicitly  appended.   This  pattern is used to generate a list of matching filenames\nfor possible completions.\nglob-expand-word (C-x *)\nThe word before point is treated as a pattern for pathname expansion, and the list  of\nmatching  filenames  is  inserted,  replacing the word.  If a numeric argument is sup‐\nplied, an asterisk is appended before pathname expansion.\n\n#### glob-list-expansions (C-x g)\n\nThe list of expansions that would have been  generated  by  glob-expand-word  is  dis‐\nplayed,  and  the  line is redrawn.  If a numeric argument is supplied, an asterisk is\nappended before pathname expansion.\n\n#### dump-functions\n\nPrint all of the functions and their key bindings to the readline output stream.  If a\nnumeric  argument  is  supplied,  the output is formatted in such a way that it can be\nmade part of an inputrc file.\n\n#### dump-variables\n\nPrint all of the settable readline variables and their values to the  readline  output\nstream.  If a numeric argument is supplied, the output is formatted in such a way that\nit can be made part of an inputrc file.\n\n#### dump-macros\n\nPrint all of the readline key sequences bound to macros and the strings  they  output.\nIf  a  numeric argument is supplied, the output is formatted in such a way that it can\nbe made part of an inputrc file.\n\n#### display-shell-version (C-x C-v)\n\nDisplay version information about the current instance of bash.\n\n#### Programmable Completion\n\nWhen word completion is attempted for an argument to a command for which a completion  speci‐\nfication (a compspec) has been defined using the complete builtin (see SHELL BUILTIN COMMANDS\nbelow), the programmable completion facilities are invoked.\n\nFirst, the command name is identified.  If the command word is the empty  string  (completion\nattempted at the beginning of an empty line), any compspec defined with the -E option to com‐‐\nplete is used.  If a compspec has been defined for that command, the compspec is used to gen‐\nerate the list of possible completions for the word.  If the command word is a full pathname,\na compspec for the full pathname is searched for first.  If no compspec is found for the full\npathname,  an  attempt  is made to find a compspec for the portion following the final slash.\nIf those searches do not result in a compspec, any compspec defined with  the  -D  option  to\ncomplete is used as the default.  If there is no default compspec, bash attempts alias expan‐\nsion on the command word as a final resort, and attempts to find a compspec for  the  command\nword from any successful expansion.\n\nOnce  a  compspec  has  been  found, it is used to generate the list of matching words.  If a\ncompspec is not found, the default bash completion as described  above  under  Completing  is\nperformed.\n\nFirst,  the  actions  specified by the compspec are used.  Only matches which are prefixed by\nthe word being completed are returned.  When the -f or -d option is used for filename or  di‐\nrectory name completion, the shell variable FIGNORE is used to filter the matches.\n\nAny  completions  specified  by  a  pathname expansion pattern to the -G option are generated\nnext.  The words generated by the pattern need not match the word being completed.  The  GLO‐‐\nBIGNORE shell variable is not used to filter the matches, but the FIGNORE variable is used.\n\nNext,  the  string  specified  as the argument to the -W option is considered.  The string is\nfirst split using the characters in the IFS special variable as delimiters.  Shell quoting is\nhonored.   Each  word  is then expanded using brace expansion, tilde expansion, parameter and\nvariable expansion, command substitution, and arithmetic expansion, as described above  under\nEXPANSION.   The results are split using the rules described above under Word Splitting.  The\nresults of the expansion are prefix-matched against the word being completed, and the  match‐\ning words become the possible completions.\n\nAfter  these matches have been generated, any shell function or command specified with the -F\nand -C options is  invoked.   When  the  command  or  function  is  invoked,  the  COMPLINE,\nCOMPPOINT,  COMPKEY,  and  COMPTYPE variables are assigned values as described above under\nShell Variables.  If a shell function is being invoked, the COMPWORDS and  COMPCWORD  vari‐\nables  are also set.  When the function or command is invoked, the first argument ($1) is the\nname of the command whose arguments are being completed, the second argument ($2) is the word\nbeing  completed,  and the third argument ($3) is the word preceding the word being completed\non the current command line.  No filtering of the generated completions against the word  be‐\ning  completed  is  performed; the function or command has complete freedom in generating the\nmatches.\n\nAny function specified with -F is invoked first.  The function may use any of the  shell  fa‐\ncilities,  including  the  compgen builtin described below, to generate the matches.  It must\nput the possible completions in the COMPREPLY array variable, one per array element.\n\nNext, any command specified with the -C option is invoked in  an  environment  equivalent  to\ncommand  substitution.   It should print a list of completions, one per line, to the standard\noutput.  Backslash may be used to escape a newline, if necessary.\n\nAfter all of the possible completions are generated, any filter specified with the -X  option\nis  applied  to the list.  The filter is a pattern as used for pathname expansion; a & in the\npattern is replaced with the text of the word being completed.  A literal &  may  be  escaped\nwith  a  backslash;  the backslash is removed before attempting a match.  Any completion that\nmatches the pattern will be removed from the list.  A leading ! negates the pattern; in  this\ncase  any  completion not matching the pattern will be removed.  If the nocasematch shell op‐\ntion is enabled, the match is performed without regard to the case of alphabetic characters.\n\nFinally, any prefix and suffix specified with the -P and -S options are added to each  member\nof  the  completion  list,  and the result is returned to the readline completion code as the\nlist of possible completions.\n\nIf the previously-applied actions do not generate any matches, and the -o dirnames option was\nsupplied to complete when the compspec was defined, directory name completion is attempted.\n\nIf  the  -o plusdirs option was supplied to complete when the compspec was defined, directory\nname completion is attempted and any matches are added to the results of the other actions.\n\nBy default, if a compspec is found, whatever it generates is returned to the completion  code\nas the full set of possible completions.  The default bash completions are not attempted, and\nthe readline default of filename completion is disabled.  If the -o  bashdefault  option  was\nsupplied  to  complete  when  the  compspec was defined, the bash default completions are at‐\ntempted if the compspec generates no matches.  If the -o default option was supplied to  com‐‐\nplete  when  the compspec was defined, readline's default completion will be performed if the\ncompspec (and, if attempted, the default bash completions) generate no matches.\n\nWhen a compspec indicates that directory name completion is desired, the programmable comple‐\ntion  functions  force readline to append a slash to completed names which are symbolic links\nto directories, subject to the value of the mark-directories readline variable, regardless of\nthe setting of the mark-symlinked-directories readline variable.\n\nThere  is  some support for dynamically modifying completions.  This is most useful when used\nin combination with a default completion specified with complete -D.  It's possible for shell\nfunctions  executed  as  completion handlers to indicate that completion should be retried by\nreturning an exit status of 124.  If a shell function returns 124, and changes  the  compspec\nassociated with the command on which completion is being attempted (supplied as the first ar‐\ngument when the function is executed), programmable completion restarts from  the  beginning,\nwith an attempt to find a new compspec for that command.  This allows a set of completions to\nbe built dynamically as completion is attempted, rather than being loaded all at once.\n\nFor instance, assuming that there is a library of compspecs, each kept in a file  correspond‐\ning  to the name of the command, the following default completion function would load comple‐\ntions dynamically:\n\ncompletionloader()\n{\n. \"/etc/bashcompletion.d/$1.sh\" >/dev/null 2>&1 && return 124\n}\ncomplete -D -F completionloader -o bashdefault -o default\n\n### HISTORY\n\nWhen the -o history option to the set builtin is enabled, the shell provides  access  to  the\ncommand  history,  the list of commands previously typed.  The value of the HISTSIZE variable\nis used as the number of commands to save in a history list.  The text of the  last  HISTSIZE\ncommands  (default 500) is saved.  The shell stores each command in the history list prior to\nparameter and variable expansion (see EXPANSION above) but after history  expansion  is  per‐\nformed, subject to the values of the shell variables HISTIGNORE and HISTCONTROL.\n\nOn  startup, the history is initialized from the file named by the variable HISTFILE (default\n~/.bashhistory).  The file named by the value of HISTFILE is  truncated,  if  necessary,  to\ncontain  no  more  than the number of lines specified by the value of HISTFILESIZE.  If HIST‐‐\nFILESIZE is unset, or set to null, a non-numeric value, or a numeric value  less  than  zero,\nthe  history  file is not truncated.  When the history file is read, lines beginning with the\nhistory comment character followed immediately by a digit are interpreted as  timestamps  for\nthe following history line.  These timestamps are optionally displayed depending on the value\nof the HISTTIMEFORMAT variable.  When a shell with history enabled exits, the last  $HISTSIZE\nlines  are  copied from the history list to $HISTFILE.  If the histappend shell option is en‐\nabled (see the description of shopt under SHELL BUILTIN COMMANDS below), the  lines  are  ap‐\npended to the history file, otherwise the history file is overwritten.  If HISTFILE is unset,\nor if the history file is unwritable, the history is not saved.  If the HISTTIMEFORMAT  vari‐\nable  is  set,  time  stamps are written to the history file, marked with the history comment\ncharacter, so they may be preserved across shell sessions.  This  uses  the  history  comment\ncharacter  to distinguish timestamps from other history lines.  After saving the history, the\nhistory file is truncated to contain no more than HISTFILESIZE lines.  If HISTFILESIZE is un‐\nset, or set to null, a non-numeric value, or a numeric value less than zero, the history file\nis not truncated.\n\nThe builtin command fc (see SHELL BUILTIN COMMANDS below) may be used to list or edit and re-\nexecute  a portion of the history list.  The history builtin may be used to display or modify\nthe history list and manipulate the history file.  When using  command-line  editing,  search\ncommands are available in each editing mode that provide access to the history list.\n\nThe  shell allows control over which commands are saved on the history list.  The HISTCONTROL\nand HISTIGNORE variables may be set to cause the shell to save only a subset of the  commands\nentered.  The cmdhist shell option, if enabled, causes the shell to attempt to save each line\nof a multi-line command in the same history entry, adding semicolons where necessary to  pre‐\nserve  syntactic  correctness.  The lithist shell option causes the shell to save the command\nwith embedded newlines instead of semicolons.  See the description of the shopt builtin below\nunder SHELL BUILTIN COMMANDS for information on setting and unsetting shell options.\n\n### HISTORY EXPANSION\n\nThe  shell  supports  a history expansion feature that is similar to the history expansion in\ncsh.  This section describes what syntax features are available.  This feature is enabled  by\ndefault  for  interactive  shells, and can be disabled using the +H option to the set builtin\ncommand (see SHELL BUILTIN COMMANDS below).  Non-interactive shells do  not  perform  history\nexpansion by default.\n\nHistory  expansions  introduce  words  from the history list into the input stream, making it\neasy to repeat commands, insert the arguments to a previous command into  the  current  input\nline, or fix errors in previous commands quickly.\n\nHistory  expansion  is  performed immediately after a complete line is read, before the shell\nbreaks it into words, and is performed on each line individually without  taking  quoting  on\nprevious  lines  into account.  It takes place in two parts.  The first is to determine which\nline from the history list to use during substitution.  The second is to select  portions  of\nthat  line  for  inclusion  into  the current one.  The line selected from the history is the\nevent, and the portions of that line that are acted upon are words.   Various  modifiers  are\navailable  to manipulate the selected words.  The line is broken into words in the same fash‐\nion as when reading input, so that several metacharacter-separated words surrounded by quotes\nare  considered one word.  History expansions are introduced by the appearance of the history\nexpansion character, which is ! by default.  Only backslash (\\) and single quotes  can  quote\nthe  history  expansion  character,  but  the  history expansion character is also treated as\nquoted if it immediately precedes the closing double quote in a double-quoted string.\n\nSeveral characters inhibit history expansion if found immediately following the  history  ex‐\npansion  character,  even if it is unquoted: space, tab, newline, carriage return, and =.  If\nthe extglob shell option is enabled, ( will also inhibit expansion.\n\nSeveral shell options settable with the shopt builtin may be used to tailor the  behavior  of\nhistory  expansion.   If  the  histverify shell option is enabled (see the description of the\nshopt builtin below), and readline is being used, history substitutions are  not  immediately\npassed to the shell parser.  Instead, the expanded line is reloaded into the readline editing\nbuffer for further modification.  If readline is being used, and the histreedit shell  option\nis  enabled,  a failed history substitution will be reloaded into the readline editing buffer\nfor correction.  The -p option to the history builtin command may be used to see what a  his‐\ntory  expansion will do before using it.  The -s option to the history builtin may be used to\nadd commands to the end of the history list without actually executing them, so that they are\navailable for subsequent recall.\n\nThe  shell  allows  control of the various characters used by the history expansion mechanism\n(see the description of histchars above under Shell Variables).  The shell uses  the  history\ncomment character to mark history timestamps when writing the history file.\n\n#### Event Designators\n\nAn  event  designator is a reference to a command line entry in the history list.  Unless the\nreference is absolute, events are relative to the current position in the history list.\n\n!      Start a history substitution, except when followed by a blank, newline,  carriage  re‐\nturn, = or ( (when the extglob shell option is enabled using the shopt builtin).\n!n     Refer to command line n.\n!-n    Refer to the current command minus n.\n!!     Refer to the previous command.  This is a synonym for `!-1'.\n!string\nRefer  to  the  most recent command preceding the current position in the history list\nstarting with string.\n!?string[?]\nRefer to the most recent command preceding the current position in  the  history  list\ncontaining string.  The trailing ? may be omitted if string is followed immediately by\na newline.  If string is missing, the string from the most recent search is  used;  it\nis an error if there is no previous search string.\n^string1^string2^\nQuick  substitution.   Repeat  the  previous  command, replacing string1 with string2.\nEquivalent to ``!!:s^string1^string2^'' (see Modifiers below).\n!#     The entire command line typed so far.\n\n#### Word Designators\n\nWord designators are used to select desired words from the event.  A :  separates  the  event\nspecification from the word designator.  It may be omitted if the word designator begins with\na ^, $, *, -, or %.  Words are numbered from the beginning of the line, with the  first  word\nbeing denoted by 0 (zero).  Words are inserted into the current line separated by single spa‐\nces.\n\n#### 0 (zero)\n\nThe zeroth word.  For the shell, this is the command word.\nn      The nth word.\n^      The first argument.  That is, word 1.\n$      The last word.  This is usually the last argument, but will expand to the zeroth  word\nif there is only one word in the line.\n%      The  first word matched by the most recent `?string?' search, if the search string be‐\ngins with a character that is part of a word.\nx-y    A range of words; `-y' abbreviates `0-y'.\n*      All of the words but the zeroth.  This is a synonym for `1-$'.  It is not an error  to\nuse  *  if  there  is just one word in the event; the empty string is returned in that\ncase.\nx*     Abbreviates x-$.\nx-     Abbreviates x-$ like x*, but omits the last word.  If x is missing, it defaults to 0.\n\nIf a word designator is supplied without an event specification, the previous command is used\nas the event.\n\n#### Modifiers\n\nAfter the optional word designator, there may appear a sequence of one or more of the follow‐\ning modifiers, each preceded by a `:'.  These modify, or edit, the  word  or  words  selected\nfrom the history event.\n\nh      Remove a trailing filename component, leaving only the head.\nt      Remove all leading filename components, leaving the tail.\nr      Remove a trailing suffix of the form .xxx, leaving the basename.\ne      Remove all but the trailing suffix.\np      Print the new command but do not execute it.\nq      Quote the substituted words, escaping further substitutions.\nx      Quote  the  substituted  words as with q, but break into words at blanks and newlines.\nThe q and x modifiers are mutually exclusive; the last one supplied is used.\ns/old/new/\nSubstitute new for the first occurrence of old in the event line.  Any  character  may\nbe  used as the delimiter in place of /.  The final delimiter is optional if it is the\nlast character of the event line.  The delimiter may be quoted in old and new  with  a\nsingle  backslash.   If  &  appears in new, it is replaced by old.  A single backslash\nwill quote the &.  If old is null, it is set to the last old substituted,  or,  if  no\nprevious  history  substitutions took place, the last string in a !?string[?]  search.\nIf new is null, each matching old is deleted.\n&      Repeat the previous substitution.\ng      Cause changes to be applied over the entire event line.  This is used  in  conjunction\nwith  `:s'  (e.g.,  `:gs/old/new/')  or `:&'.  If used with `:s', any delimiter can be\nused in place of /, and the final delimiter is optional if it is the last character of\nthe event line.  An a may be used as a synonym for g.\nG      Apply the following `s' or `&' modifier once to each word in the event line.\n\n### SHELL BUILTIN COMMANDS\n\nUnless  otherwise noted, each builtin command documented in this section as accepting options\npreceded by - accepts -- to signify the end of the options.  The :, true, false,  and  test/[\nbuiltins  do  not  accept  options  and do not treat -- specially.  The exit, logout, return,\nbreak, continue, let, and shift builtins accept and process arguments beginning with -  with‐\nout  requiring  --.   Other builtins that accept arguments but are not specified as accepting\noptions interpret arguments beginning with - as invalid options and  require  --  to  prevent\nthis interpretation.\n: [arguments]\nNo  effect;  the  command  does  nothing beyond expanding arguments and performing any\nspecified redirections.  The return status is zero.\n\n.  filename [arguments]\nsource filename [arguments]\nRead and execute commands from filename in the current shell  environment  and  return\nthe exit status of the last command executed from filename.  If filename does not con‐\ntain a slash, filenames in PATH are used to find the  directory  containing  filename.\nThe file searched for in PATH need not be executable.  When bash is not in posix mode,\nthe current directory is searched if no file is found in PATH.  If the sourcepath  op‐\ntion to the shopt builtin command is turned off, the PATH is not searched.  If any ar‐\nguments are supplied, they become the positional parameters when filename is executed.\nOtherwise  the  positional  parameters  are  unchanged.   If the -T option is enabled,\nsource inherits any trap on DEBUG; if it is not, any DEBUG trap string  is  saved  and\nrestored  around  the  call  to source, and source unsets the DEBUG trap while it exe‐\ncutes.  If -T is not set, and the sourced file changes the DEBUG trap, the  new  value\nis  retained  when source completes.  The return status is the status of the last com‐\nmand exited within the script (0 if no commands are executed), and false  if  filename\nis not found or cannot be read.\n\nalias [-p] [name[=value] ...]\nAlias  with  no arguments or with the -p option prints the list of aliases in the form\nalias name=value on standard output.  When arguments are supplied, an alias is defined\nfor each name whose value is given.  A trailing space in value causes the next word to\nbe checked for alias substitution when the alias is expanded.  For each  name  in  the\nargument  list  for  which  no  value  is supplied, the name and value of the alias is\nprinted.  Alias returns true unless a name is given for which no alias  has  been  de‐\nfined.\n\nbg [jobspec ...]\nResume each suspended job jobspec in the background, as if it had been started with &.\nIf jobspec is not present, the shell's notion of the current job is used.  bg  jobspec\nreturns  0  unless  run when job control is disabled or, when run with job control en‐\nabled, any specified jobspec was not found or was started without job control.\n\nbind [-m keymap] [-lpsvPSVX]\nbind [-m keymap] [-q function] [-u function] [-r keyseq]\nbind [-m keymap] -f filename\nbind [-m keymap] -x keyseq:shell-command\nbind [-m keymap] keyseq:function-name\nbind [-m keymap] keyseq:readline-command\nDisplay current readline key and function bindings, bind a key sequence to a  readline\nfunction  or macro, or set a readline variable.  Each non-option argument is a command\nas it would appear in .inputrc, but each binding or command must be passed as a  sepa‐\nrate  argument; e.g., '\"\\C-x\\C-r\": re-read-init-file'.  Options, if supplied, have the\nfollowing meanings:\n-m keymap\nUse keymap as the keymap to be affected by the subsequent bindings.  Acceptable\nkeymap  names  are  emacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,\nvi-command, and vi-insert.  vi is equivalent to vi-command (vi-move is  also  a\nsynonym); emacs is equivalent to emacs-standard.\n-l     List the names of all readline functions.\n-p     Display readline function names and bindings in such a way that they can be re-\nread.\n-P     List current readline function names and bindings.\n-s     Display readline key sequences bound to macros and the strings they  output  in\nsuch a way that they can be re-read.\n-S     Display readline key sequences bound to macros and the strings they output.\n-v     Display  readline  variable names and values in such a way that they can be re-\nread.\n-V     List current readline variable names and values.\n-f filename\nRead key bindings from filename.\n-q function\nQuery about which keys invoke the named function.\n-u function\nUnbind all keys bound to the named function.\n-r keyseq\nRemove any current binding for keyseq.\n-x keyseq:shell-command\nCause shell-command to be executed whenever keyseq is entered.  When shell-com‐\nmand  is executed, the shell sets the READLINELINE variable to the contents of\nthe readline line buffer and the READLINEPOINT and READLINEMARK variables  to\nthe  current location of the insertion point and the saved insertion point (the\nmark), respectively.  If the executed command changes the value of any of READ‐‐\nLINELINE, READLINEPOINT, or READLINEMARK, those new values will be reflected\nin the editing state.\n-X     List all key sequences bound to shell commands and the associated commands in a\nformat that can be reused as input.\n\nThe return value is 0 unless an unrecognized option is given or an error occurred.\n\nbreak [n]\nExit from within a for, while, until, or select loop.  If n is specified, break n lev‐\nels.  n must be ≥ 1.  If n is greater than the number of enclosing loops, all  enclos‐\ning  loops are exited.  The return value is 0 unless n is not greater than or equal to\n1.\n\nbuiltin shell-builtin [arguments]\nExecute the specified shell builtin, passing it arguments, and return its exit status.\nThis is useful when defining a function whose name is the same as a shell builtin, re‐\ntaining the functionality of the builtin within the function.  The cd builtin is  com‐\nmonly  redefined this way.  The return status is false if shell-builtin is not a shell\nbuiltin command.\n\ncaller [expr]\nReturns the context of any active subroutine call (a shell function or a  script  exe‐\ncuted  with  the . or source builtins).  Without expr, caller displays the line number\nand source filename of the current subroutine call.  If a non-negative integer is sup‐\nplied  as expr, caller displays the line number, subroutine name, and source file cor‐\nresponding to that position in the current execution call stack.  This extra  informa‐\ntion  may be used, for example, to print a stack trace.  The current frame is frame 0.\nThe return value is 0 unless the shell is not executing a subroutine call or expr does\nnot correspond to a valid position in the call stack.\n\ncd [-L|[-P [-e]] [-@]] [dir]\nChange  the  current  directory to dir.  if dir is not supplied, the value of the HOME\nshell variable is the default.  Any additional arguments following  dir  are  ignored.\nThe variable CDPATH defines the search path for the directory containing dir: each di‐\nrectory name in CDPATH is searched for dir.  Alternative directory names in CDPATH are\nseparated  by a colon (:).  A null directory name in CDPATH is the same as the current\ndirectory, i.e., ``.''.  If dir begins with a slash (/), then CDPATH is not used.  The\n-P  option  causes  cd  to  use the physical directory structure by resolving symbolic\nlinks while traversing dir and before processing instances of .. in dir (see also  the\n-P  option to the set builtin command); the -L option forces symbolic links to be fol‐\nlowed by resolving the link after processing instances of .. in dir.  If .. appears in\ndir, it is processed by removing the immediately previous pathname component from dir,\nback to a slash or the beginning of dir.  If the -e option is supplied  with  -P,  and\nthe current working directory cannot be successfully determined after a successful di‐\nrectory change, cd will return an unsuccessful status.  On systems  that  support  it,\nthe  -@ option presents the extended attributes associated with a file as a directory.\nAn argument of - is converted to $OLDPWD before the directory change is attempted.  If\na non-empty directory name from CDPATH is used, or if - is the first argument, and the\ndirectory change is successful, the absolute pathname of the new working directory  is\nwritten  to  the  standard output.  The return value is true if the directory was suc‐\ncessfully changed; false otherwise.\n\ncommand [-pVv] command [arg ...]\nRun command with args suppressing the normal shell function lookup.  Only builtin com‐\nmands  or  commands  found  in  the PATH are executed.  If the -p option is given, the\nsearch for command is performed using a default value for PATH that is  guaranteed  to\nfind  all of the standard utilities.  If either the -V or -v option is supplied, a de‐\nscription of command is printed.  The -v option causes a single  word  indicating  the\ncommand  or  filename used to invoke command to be displayed; the -V option produces a\nmore verbose description.  If the -V or -v option is supplied, the exit status is 0 if\ncommand  was found, and 1 if not.  If neither option is supplied and an error occurred\nor command cannot be found, the exit status is 127.  Otherwise, the exit status of the\ncommand builtin is the exit status of command.\n\ncompgen [option] [word]\nGenerate  possible  completion matches for word according to the options, which may be\nany option accepted by the complete builtin with the exception of -p and -r, and write\nthe  matches  to  the  standard  output.  When using the -F or -C options, the various\nshell variables set by the programmable completion facilities, while  available,  will\nnot have useful values.\n\nThe  matches  will be generated in the same way as if the programmable completion code\nhad generated them directly from a completion specification with the same  flags.   If\nword is specified, only those completions matching word will be displayed.\n\nThe return value is true unless an invalid option is supplied, or no matches were gen‐\nerated.\n\ncomplete [-abcdefgjksuv] [-o comp-option] [-DEI] [-A action] [-G globpat] [-W wordlist]\n[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] name [name ...]\ncomplete -pr [-DEI] [name ...]\nSpecify how arguments to each name should be completed.  If the -p option is supplied,\nor if no options are supplied, existing completion specifications are printed in a way\nthat allows them to be reused as input.  The -r option removes a completion specifica‐\ntion  for each name, or, if no names are supplied, all completion specifications.  The\n-D option indicates that other supplied options and actions should apply to the  ``de‐\nfault''  command  completion;  that is, completion attempted on a command for which no\ncompletion has previously been defined.  The -E option indicates that  other  supplied\noptions  and actions should apply to ``empty'' command completion; that is, completion\nattempted on a blank line.  The -I option indicates that other  supplied  options  and\nactions  should apply to completion on the initial non-assignment word on the line, or\nafter a command delimiter such as ; or |, which is usually  command  name  completion.\nIf  multiple  options  are  supplied, the -D option takes precedence over -E, and both\ntake precedence over -I.  If any of -D, -E, or -I are supplied, any other  name  argu‐\nments are ignored; these completions only apply to the case specified by the option.\n\nThe  process  of  applying these completion specifications when word completion is at‐\ntempted is described above under Programmable Completion.\n\nOther options, if specified, have the following meanings.  The arguments  to  the  -G,\n-W, and -X options (and, if necessary, the -P and -S options) should be quoted to pro‐\ntect them from expansion before the complete builtin is invoked.\n-o comp-option\nThe comp-option controls several aspects of the compspec's behavior beyond the\nsimple generation of completions.  comp-option may be one of:\nbashdefault\nPerform  the rest of the default bash completions if the compspec gen‐\nerates no matches.\ndefault Use readline's default filename completion if the  compspec  generates\nno matches.\ndirnames\nPerform  directory  name  completion  if  the  compspec  generates  no\nmatches.\nfilenames\nTell readline that the compspec generates filenames, so it can perform\nany  filename-specific  processing  (like  adding a slash to directory\nnames, quoting special characters, or  suppressing  trailing  spaces).\nIntended to be used with shell functions.\nnoquote Tell  readline  not to quote the completed words if they are filenames\n(quoting filenames is the default).\nnosort  Tell readline not to sort the list of possible completions  alphabeti‐\ncally.\nnospace Tell  readline  not to append a space (the default) to words completed\nat the end of the line.\nplusdirs\nAfter any matches defined by the  compspec  are  generated,  directory\nname  completion is attempted and any matches are added to the results\nof the other actions.\n-A action\nThe action may be one of the following to generate a list of possible  comple‐\ntions:\nalias   Alias names.  May also be specified as -a.\narrayvar\nArray variable names.\nbinding Readline key binding names.\nbuiltin Names of shell builtin commands.  May also be specified as -b.\ncommand Command names.  May also be specified as -c.\ndirectory\nDirectory names.  May also be specified as -d.\ndisabled\nNames of disabled shell builtins.\nenabled Names of enabled shell builtins.\nexport  Names of exported shell variables.  May also be specified as -e.\nfile    File names.  May also be specified as -f.\nfunction\nNames of shell functions.\ngroup   Group names.  May also be specified as -g.\nhelptopic\nHelp topics as accepted by the help builtin.\nhostname\nHostnames,  as  taken  from  the  file specified by the HOSTFILE shell\nvariable.\njob     Job names, if job control is active.  May also be specified as -j.\nkeyword Shell reserved words.  May also be specified as -k.\nrunning Names of running jobs, if job control is active.\nservice Service names.  May also be specified as -s.\nsetopt  Valid arguments for the -o option to the set builtin.\nshopt   Shell option names as accepted by the shopt builtin.\nsignal  Signal names.\nstopped Names of stopped jobs, if job control is active.\nuser    User names.  May also be specified as -u.\nvariable\nNames of all shell variables.  May also be specified as -v.\n-C command\ncommand is executed in a subshell environment, and its output is used  as  the\npossible completions.\n-F function\nThe  shell  function  function  is  executed in the current shell environment.\nWhen the function is executed, the first argument ($1) is the name of the com‐\nmand whose arguments are being completed, the second argument ($2) is the word\nbeing completed, and the third argument ($3) is the word  preceding  the  word\nbeing  completed  on the current command line.  When it finishes, the possible\ncompletions are retrieved from the value of the COMPREPLY array variable.\n-G globpat\nThe pathname expansion pattern globpat is expanded to  generate  the  possible\ncompletions.\n-P prefix\nprefix  is  added at the beginning of each possible completion after all other\noptions have been applied.\n-S suffix\nsuffix is appended to each possible completion after all  other  options  have\nbeen applied.\n-W wordlist\nThe  wordlist is split using the characters in the IFS special variable as de‐\nlimiters, and each resultant word  is  expanded.   Shell  quoting  is  honored\nwithin  wordlist,  in  order  to  provide a mechanism for the words to contain\nshell metacharacters or characters in the value of IFS.  The possible  comple‐\ntions  are  the  members of the resultant list which match the word being com‐\npleted.\n-X filterpat\nfilterpat is a pattern as used for pathname expansion.  It is applied  to  the\nlist of possible completions generated by the preceding options and arguments,\nand each completion matching filterpat is removed from the list.  A leading  !\nin  filterpat  negates  the pattern; in this case, any completion not matching\nfilterpat is removed.\n\nThe return value is true unless an invalid option is supplied, an option other than -p\nor  -r  is supplied without a name argument, an attempt is made to remove a completion\nspecification for a name for which no specification exists, or an error occurs  adding\na completion specification.\n\ncompopt [-o option] [-DEI] [+o option] [name]\nModify  completion  options  for  each  name according to the options, or for the cur‐\nrently-executing completion if no names are supplied.  If no options are  given,  dis‐\nplay  the  completion  options  for each name or the current completion.  The possible\nvalues of option are those valid for the complete builtin described above.  The -D op‐\ntion  indicates  that  other  supplied options should apply to the ``default'' command\ncompletion; that is, completion attempted on a command for  which  no  completion  has\npreviously  been  defined.  The -E option indicates that other supplied options should\napply to ``empty'' command completion; that is, completion attempted on a blank  line.\nThe  -I option indicates that other supplied options should apply to completion on the\ninitial non-assignment word on the line, or after a command delimiter such as ; or  |,\nwhich is usually command name completion.\n\nThe  return  value is true unless an invalid option is supplied, an attempt is made to\nmodify the options for a name for which no completion specification exists, or an out‐\nput error occurs.\n\ncontinue [n]\nResume the next iteration of the enclosing for, while, until, or select loop.  If n is\nspecified, resume at the nth enclosing loop.  n must be ≥ 1.  If n is greater than the\nnumber  of  enclosing  loops,  the last enclosing loop (the ``top-level'' loop) is re‐\nsumed.  The return value is 0 unless n is not greater than or equal to 1.\n\ndeclare [-aAfFgiIlnrtux] [-p] [name[=value] ...]\ntypeset [-aAfFgiIlnrtux] [-p] [name[=value] ...]\nDeclare variables and/or give them attributes.  If no names are given then display the\nvalues  of  variables.   The  -p option will display the attributes and values of each\nname.  When -p is used with name arguments, additional options, other than -f and  -F,\nare  ignored.   When  -p  is  supplied without name arguments, it will display the at‐\ntributes and values of all variables having the attributes specified by the additional\noptions.   If  no  other  options  are  supplied with -p, declare will display the at‐\ntributes and values of all shell variables.  The -f option will restrict  the  display\nto  shell functions.  The -F option inhibits the display of function definitions; only\nthe function name and attributes are printed.  If the extdebug shell option is enabled\nusing  shopt, the source file name and line number where each name is defined are dis‐\nplayed as well.  The -F option implies -f.  The -g option forces variables to be  cre‐\nated  or  modified at the global scope, even when declare is executed in a shell func‐\ntion.  It is ignored in all other cases.  The -I option causes local variables to  in‐\nherit the attributes (except the nameref attribute) and value of any existing variable\nwith the same name at a surrounding scope.  If there is no existing variable, the  lo‐\ncal variable is initially unset.  The following options can be used to restrict output\nto variables with the specified attribute or to give variables attributes:\n-a     Each name is an indexed array variable (see Arrays above).\n-A     Each name is an associative array variable (see Arrays above).\n-f     Use function names only.\n-i     The variable is treated as an integer; arithmetic  evaluation  (see  ARITHMETIC\nEVALUATION above) is performed when the variable is assigned a value.\n-l     When  the variable is assigned a value, all upper-case characters are converted\nto lower-case.  The upper-case attribute is disabled.\n-n     Give each name the nameref attribute, making it a  name  reference  to  another\nvariable.   That  other  variable  is defined by the value of name.  All refer‐\nences, assignments, and attribute modifications to name, except those using  or\nchanging  the  -n attribute itself, are performed on the variable referenced by\nname's value.  The nameref attribute cannot be applied to array variables.\n-r     Make names readonly.  These names cannot then be assigned values by  subsequent\nassignment statements or unset.\n-t     Give each name the trace attribute.  Traced functions inherit the DEBUG and RE‐‐\nTURN traps from the calling shell.  The trace attribute has no special  meaning\nfor variables.\n-u     When  the variable is assigned a value, all lower-case characters are converted\nto upper-case.  The lower-case attribute is disabled.\n-x     Mark names for export to subsequent commands via the environment.\n\nUsing `+' instead of `-' turns off the attribute instead, with the exceptions that  +a\nand  +A may not be used to destroy array variables and +r will not remove the readonly\nattribute.  When used in a function, declare and typeset make each name local, as with\nthe  local  command, unless the -g option is supplied.  If a variable name is followed\nby =value, the value of the variable is set to value.  When using -a  or  -A  and  the\ncompound  assignment  syntax  to  create array variables, additional attributes do not\ntake effect until subsequent assignments.  The return value is 0 unless an invalid op‐\ntion  is encountered, an attempt is made to define a function using ``-f foo=bar'', an\nattempt is made to assign a value to a readonly variable, an attempt is made to assign\na  value to an array variable without using the compound assignment syntax (see Arrays\nabove), one of the names is not a valid shell variable name, an  attempt  is  made  to\nturn off readonly status for a readonly variable, an attempt is made to turn off array\nstatus for an array variable, or an attempt is made to display a non-existent function\nwith -f.\n\ndirs [-clpv] [+n] [-n]\nWithout  options,  displays the list of currently remembered directories.  The default\ndisplay is on a single line with directory names separated by spaces.  Directories are\nadded  to  the  list with the pushd command; the popd command removes entries from the\nlist.  The current directory is always the first directory in the stack.\n-c     Clears the directory stack by deleting all of the entries.\n-l     Produces a listing using full pathnames; the  default  listing  format  uses  a\ntilde to denote the home directory.\n-p     Print the directory stack with one entry per line.\n-v     Print  the  directory  stack with one entry per line, prefixing each entry with\nits index in the stack.\n+n     Displays the nth entry counting from the left of the list shown  by  dirs  when\ninvoked without options, starting with zero.\n-n     Displays  the  nth entry counting from the right of the list shown by dirs when\ninvoked without options, starting with zero.\n\nThe return value is 0 unless an invalid option is supplied or n indexes beyond the end\nof the directory stack.\n\ndisown [-ar] [-h] [jobspec ... | pid ... ]\nWithout options, remove each jobspec from the table of active jobs.  If jobspec is not\npresent, and neither the -a nor the -r option is supplied, the current  job  is  used.\nIf  the  -h option is given, each jobspec is not removed from the table, but is marked\nso that SIGHUP is not sent to the job if the shell receives a SIGHUP.  If  no  jobspec\nis  supplied,  the -a option means to remove or mark all jobs; the -r option without a\njobspec argument restricts operation to running jobs.  The return value is 0 unless  a\njobspec does not specify a valid job.\n\necho [-neE] [arg ...]\nOutput  the  args, separated by spaces, followed by a newline.  The return status is 0\nunless a write error occurs.  If -n is specified, the trailing newline is  suppressed.\nIf  the  -e option is given, interpretation of the following backslash-escaped charac‐\nters is enabled.  The -E option disables the interpretation of  these  escape  charac‐\nters,  even  on systems where they are interpreted by default.  The xpgecho shell op‐\ntion may be used to dynamically determine whether or not  echo  expands  these  escape\ncharacters  by  default.  echo does not interpret -- to mean the end of options.  echo\ninterprets the following escape sequences:\n\\a     alert (bell)\n\\b     backspace\n\\c     suppress further output\n\\e\n\\E     an escape character\n\\f     form feed\n\\n     new line\n\\r     carriage return\n\\t     horizontal tab\n\\v     vertical tab\n\\\\     backslash\n\\0nnn  the eight-bit character whose value is the octal value nnn (zero to three octal\ndigits)\n\\xHH   the eight-bit character whose value is the hexadecimal value HH (one or two hex\ndigits)\n\\uHHHH the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH\n(one to four hex digits)\n\\UHHHHHHHH\nthe Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHH‐\nHHHHH (one to eight hex digits)\n\nenable [-a] [-dnps] [-f filename] [name ...]\nEnable and disable builtin shell commands.  Disabling a builtin allows a disk  command\nwhich  has  the  same name as a shell builtin to be executed without specifying a full\npathname, even though the shell normally searches for builtins before  disk  commands.\nIf  -n  is used, each name is disabled; otherwise, names are enabled.  For example, to\nuse the test binary found via the PATH instead of the shell builtin version, run ``en‐\nable  -n test''.  The -f option means to load the new builtin command name from shared\nobject filename, on systems that support dynamic loading.  The -d option will delete a\nbuiltin  previously  loaded with -f.  If no name arguments are given, or if the -p op‐\ntion is supplied, a list of shell builtins is printed.  With  no  other  option  argu‐\nments,  the list consists of all enabled shell builtins.  If -n is supplied, only dis‐\nabled builtins are printed.   If  -a  is  supplied,  the  list  printed  includes  all\nbuiltins,  with  an  indication of whether or not each is enabled.  If -s is supplied,\nthe output is restricted to the POSIX special builtins.  The return value is 0  unless\na name is not a shell builtin or there is an error loading a new builtin from a shared\nobject.\n\neval [arg ...]\nThe args are read and concatenated together into a single command.   This  command  is\nthen  read  and executed by the shell, and its exit status is returned as the value of\neval.  If there are no args, or only null arguments, eval returns 0.\n\nexec [-cl] [-a name] [command [arguments]]\nIf command is specified, it replaces the shell.  No new process is created.  The argu‐\nments become the arguments to command.  If the -l option is supplied, the shell places\na dash at the beginning of the zeroth argument passed to command.  This  is  what  lo‐\ngin(1)  does.   The -c option causes command to be executed with an empty environment.\nIf -a is supplied, the shell passes name as the zeroth argument to the  executed  com‐\nmand.   If  command cannot be executed for some reason, a non-interactive shell exits,\nunless the execfail shell option is enabled.  In that case, it  returns  failure.   An\ninteractive  shell  returns  failure if the file cannot be executed.  A subshell exits\nunconditionally if exec fails.  If command is not specified, any redirections take ef‐\nfect  in the current shell, and the return status is 0.  If there is a redirection er‐\nror, the return status is 1.\n\nexit [n]\nCause the shell to exit with a status of n.  If n is omitted, the exit status is  that\nof the last command executed.  A trap on EXIT is executed before the shell terminates.\n\nexport [-fn] [name[=word]] ...\n\n#### export -p\n\nThe  supplied names are marked for automatic export to the environment of subsequently\nexecuted commands.  If the -f option is given, the names refer to  functions.   If  no\nnames  are  given,  or  if  the -p option is supplied, a list of names of all exported\nvariables is printed.  The -n option causes the export property  to  be  removed  from\neach  name.  If a variable name is followed by =word, the value of the variable is set\nto word.  export returns an exit status of 0 unless an invalid option is  encountered,\none  of  the  names  is not a valid shell variable name, or -f is supplied with a name\nthat is not a function.\n\nfc [-e ename] [-lnr] [first] [last]\nfc -s [pat=rep] [cmd]\nThe first form selects a range of commands from first to last from  the  history  list\nand  displays  or  edits  and  re-executes them.  First and last may be specified as a\nstring (to locate the last command beginning with that string) or as a number (an  in‐\ndex  into the history list, where a negative number is used as an offset from the cur‐\nrent command number).  When listing, a first or last of 0 is equivalent to -1  and  -0\nis  equivalent to the current command (usually the fc command); otherwise 0 is equiva‐\nlent to -1 and -0 is invalid.  If last is not specified, it is set to the current com‐\nmand for listing (so that ``fc -l -10'' prints the last 10 commands) and to first oth‐\nerwise.  If first is not specified, it is set to the previous command for editing  and\n-16 for listing.\n\nThe -n option suppresses the command numbers when listing.  The -r option reverses the\norder of the commands.  If the -l option is given, the commands are listed on standard\noutput.   Otherwise,  the  editor given by ename is invoked on a file containing those\ncommands.  If ename is not given, the value of the FCEDIT variable is  used,  and  the\nvalue  of  EDITOR if FCEDIT is not set.  If neither variable is set, vi is used.  When\nediting is complete, the edited commands are echoed and executed.\n\nIn the second form, command is re-executed after each instance of pat is  replaced  by\nrep.  Command is interpreted the same as first above.  A useful alias to use with this\nis ``r=\"fc -s\"'', so that typing ``r cc'' runs the last command beginning with  ``cc''\nand typing ``r'' re-executes the last command.\n\nIf  the  first form is used, the return value is 0 unless an invalid option is encoun‐\ntered or first or last specify history lines out of range.  If the -e option  is  sup‐\nplied, the return value is the value of the last command executed or failure if an er‐\nror occurs with the temporary file of commands.  If the second form is used,  the  re‐\nturn  status  is  that of the command re-executed, unless cmd does not specify a valid\nhistory line, in which case fc returns failure.\n\nfg [jobspec]\nResume jobspec in the foreground, and make it the current  job.   If  jobspec  is  not\npresent,  the  shell's notion of the current job is used.  The return value is that of\nthe command placed into the foreground, or failure if run when job control is disabled\nor, when run with job control enabled, if jobspec does not specify a valid job or job‐\nspec specifies a job that was started without job control.\n\ngetopts optstring name [arg ...]\ngetopts is used by shell procedures to parse positional  parameters.   optstring  con‐\ntains  the  option characters to be recognized; if a character is followed by a colon,\nthe option is expected to have an argument, which should be separated from it by white\nspace.   The  colon and question mark characters may not be used as option characters.\nEach time it is invoked, getopts places the next option in the  shell  variable  name,\ninitializing  name if it does not exist, and the index of the next argument to be pro‐\ncessed into the variable OPTIND.  OPTIND is initialized to 1 each time the shell or  a\nshell script is invoked.  When an option requires an argument, getopts places that ar‐\ngument into the variable OPTARG.  The shell does not reset  OPTIND  automatically;  it\nmust be manually reset between multiple calls to getopts within the same shell invoca‐\ntion if a new set of parameters is to be used.\n\nWhen the end of options is encountered, getopts exits with a return value greater than\nzero.  OPTIND is set to the index of the first non-option argument, and name is set to\n?.\n\ngetopts normally parses the positional parameters, but if more arguments are  supplied\nas arg values, getopts parses those instead.\n\ngetopts  can  report  errors  in  two  ways.  If the first character of optstring is a\ncolon, silent error reporting is used.  In normal operation, diagnostic  messages  are\nprinted  when  invalid  options  or  missing option arguments are encountered.  If the\nvariable OPTERR is set to 0, no error messages will be displayed, even  if  the  first\ncharacter of optstring is not a colon.\n\nIf an invalid option is seen, getopts places ? into name and, if not silent, prints an\nerror message and unsets OPTARG.  If getopts is silent, the option character found  is\nplaced in OPTARG and no diagnostic message is printed.\n\nIf a required argument is not found, and getopts is not silent, a question mark (?) is\nplaced in name, OPTARG is unset, and a diagnostic message is printed.  If  getopts  is\nsilent,  then  a colon (:) is placed in name and OPTARG is set to the option character\nfound.\n\ngetopts returns true if an option, specified or unspecified,  is  found.   It  returns\nfalse if the end of options is encountered or an error occurs.\n\nhash [-lr] [-p filename] [-dt] [name]\nEach  time  hash  is  invoked,  the full pathname of the command name is determined by\nsearching the directories in $PATH and remembered.  Any previously-remembered pathname\nis discarded.  If the -p option is supplied, no path search is performed, and filename\nis used as the full filename of the command.  The -r option causes the shell to forget\nall remembered locations.  The -d option causes the shell to forget the remembered lo‐\ncation of each name.  If the -t option is supplied, the full pathname  to  which  each\nname  corresponds  is  printed.   If multiple name arguments are supplied with -t, the\nname is printed before the hashed full pathname.  The -l option causes  output  to  be\ndisplayed  in  a format that may be reused as input.  If no arguments are given, or if\nonly -l is supplied, information about remembered commands  is  printed.   The  return\nstatus is true unless a name is not found or an invalid option is supplied.\n\nhelp [-dms] [pattern]\nDisplay  helpful  information  about  builtin commands.  If pattern is specified, help\ngives detailed help on all commands matching  pattern;  otherwise  help  for  all  the\nbuiltins and shell control structures is printed.\n-d     Display a short description of each pattern\n-m     Display the description of each pattern in a manpage-like format\n-s     Display only a short usage synopsis for each pattern\n\nThe return status is 0 unless no command matches pattern.\n\nhistory [n]\n\n#### history -c\n\nhistory -d offset\nhistory -d start-end\nhistory -anrw [filename]\nhistory -p arg [arg ...]\nhistory -s arg [arg ...]\nWith  no  options,  display  the command history list with line numbers.  Lines listed\nwith a * have been modified.  An argument of n lists only the last n  lines.   If  the\nshell  variable  HISTTIMEFORMAT is set and not null, it is used as a format string for\nstrftime(3) to display the time stamp associated with each  displayed  history  entry.\nNo intervening blank is printed between the formatted time stamp and the history line.\nIf filename is supplied, it is used as the name of the history file; if not, the value\nof HISTFILE is used.  Options, if supplied, have the following meanings:\n-c     Clear the history list by deleting all the entries.\n-d offset\nDelete  the history entry at position offset.  If offset is negative, it is in‐\nterpreted as relative to one greater than the last history position,  so  nega‐\ntive  indices count back from the end of the history, and an index of -1 refers\nto the current history -d command.\n-d start-end\nDelete the history entries between positions start and end,  inclusive.   Posi‐\ntive and negative values for start and end are interpreted as described above.\n-a     Append  the ``new'' history lines to the history file.  These are history lines\nentered since the beginning of the current bash session, but  not  already  ap‐\npended to the history file.\n-n     Read  the history lines not already read from the history file into the current\nhistory list.  These are lines appended to the history file since the beginning\nof the current bash session.\n-r     Read  the  contents  of the history file and append them to the current history\nlist.\n-w     Write the current history list to the history  file,  overwriting  the  history\nfile's contents.\n-p     Perform  history  substitution  on the following args and display the result on\nthe standard output.  Does not store the results in the history list.  Each arg\nmust be quoted to disable normal history expansion.\n-s     Store  the args in the history list as a single entry.  The last command in the\nhistory list is removed before the args are added.\n\nIf the HISTTIMEFORMAT variable is set, the time stamp information associated with each\nhistory  entry is written to the history file, marked with the history comment charac‐\nter.  When the history file is read, lines beginning with the history comment  charac‐\nter  followed  immediately  by a digit are interpreted as timestamps for the following\nhistory entry.  The return value is 0 unless an invalid option is encountered, an  er‐\nror occurs while reading or writing the history file, an invalid offset is supplied as\nan argument to -d, or the history expansion supplied as an argument to -p fails.\n\njobs [-lnprs] [ jobspec ... ]\njobs -x command [ args ... ]\nThe first form lists the active jobs.  The options have the following meanings:\n-l     List process IDs in addition to the normal information.\n-n     Display information only about jobs that have changed status since the user was\nlast notified of their status.\n-p     List only the process ID of the job's process group leader.\n-r     Display only running jobs.\n-s     Display only stopped jobs.\n\nIf  jobspec  is given, output is restricted to information about that job.  The return\nstatus is 0 unless an invalid option is encountered or an invalid jobspec is supplied.\n\nIf the -x option is supplied, jobs replaces any jobspec found in command or args  with\nthe  corresponding  process  group ID, and executes command passing it args, returning\nits exit status.\n\nkill [-s sigspec | -n signum | -sigspec] [pid | jobspec] ...\nkill -l|-L [sigspec | exitstatus]\nSend the signal named by sigspec or signum to the processes named by pid  or  jobspec.\nsigspec  is either a case-insensitive signal name such as SIGKILL (with or without the\nSIG prefix) or a signal number; signum is a signal number.  If sigspec is not present,\nthen  SIGTERM is assumed.  An argument of -l lists the signal names.  If any arguments\nare supplied when -l is given, the names of the signals corresponding to the arguments\nare  listed,  and  the return status is 0.  The exitstatus argument to -l is a number\nspecifying either a signal number or the exit status of a process terminated by a sig‐\nnal.  The -L option is equivalent to -l.  kill returns true if at least one signal was\nsuccessfully sent, or false if an error occurs or an invalid option is encountered.\n\nlet arg [arg ...]\nEach arg is an arithmetic  expression  to  be  evaluated  (see  ARITHMETIC  EVALUATION\nabove).  If the last arg evaluates to 0, let returns 1; 0 is returned otherwise.\n\nlocal [option] [name[=value] ... | - ]\nFor  each  argument,  a local variable named name is created, and assigned value.  The\noption can be any of the options accepted by declare.  When local  is  used  within  a\nfunction, it causes the variable name to have a visible scope restricted to that func‐\ntion and its children.  If name is -, the set of shell options is made  local  to  the\nfunction in which local is invoked: shell options changed using the set builtin inside\nthe function are restored to their original values when the function returns.  The re‐\nstore  is  effected as if a series of set commands were executed to restore the values\nthat were in place before the function.  With no operands, local writes a list of  lo‐\ncal  variables  to the standard output.  It is an error to use local when not within a\nfunction.  The return status is 0 unless local is used outside a function, an  invalid\nname is supplied, or name is a readonly variable.\n\nlogout Exit a login shell.\n\nmapfile  [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum]\n[array]\nreadarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback]  [-c  quan‐\ntum] [array]\nRead lines from the standard input into the indexed array variable array, or from file\ndescriptor fd if the -u option is supplied.  The variable MAPFILE is the  default  ar‐\nray.  Options, if supplied, have the following meanings:\n-d     The  first character of delim is used to terminate each input line, rather than\nnewline.  If delim is the empty string, mapfile will terminate a line  when  it\nreads a NUL character.\n-n     Copy at most count lines.  If count is 0, all lines are copied.\n-O     Begin assigning to array at index origin.  The default index is 0.\n-s     Discard the first count lines read.\n-t     Remove a trailing delim (default newline) from each line read.\n-u     Read lines from file descriptor fd instead of the standard input.\n-C     Evaluate  callback  each  time quantum lines are read.  The -c option specifies\nquantum.\n-c     Specify the number of lines read between each call to callback.\n\nIf -C is specified without -c, the default quantum is 5000.  When callback  is  evalu‐\nated,  it  is supplied the index of the next array element to be assigned and the line\nto be assigned to that element as additional arguments.  callback is  evaluated  after\nthe line is read but before the array element is assigned.\n\nIf  not supplied with an explicit origin, mapfile will clear array before assigning to\nit.\n\nmapfile returns successfully unless an invalid option or option argument is  supplied,\narray is invalid or unassignable, or if array is not an indexed array.\n\npopd [-n] [+n] [-n]\nRemoves  entries  from the directory stack.  With no arguments, removes the top direc‐\ntory from the stack, and performs a cd to the new top directory.  Arguments,  if  sup‐\nplied, have the following meanings:\n-n     Suppresses  the  normal  change of directory when removing directories from the\nstack, so that only the stack is manipulated.\n+n     Removes the nth entry counting from the left of the list shown by dirs,  start‐\ning  with  zero.   For example: ``popd +0'' removes the first directory, ``popd\n+1'' the second.\n-n     Removes the nth entry counting from the right of the list shown by dirs, start‐\ning  with  zero.   For  example: ``popd -0'' removes the last directory, ``popd\n-1'' the next to last.\n\nIf the popd command is successful, a dirs is performed as well, and the return  status\nis  0.  popd returns false if an invalid option is encountered, the directory stack is\nempty, a non-existent directory stack entry is  specified,  or  the  directory  change\nfails.\n\nprintf [-v var] format [arguments]\nWrite  the formatted arguments to the standard output under the control of the format.\nThe -v option causes the output to be assigned to the variable var rather  than  being\nprinted to the standard output.\n\nThe  format is a character string which contains three types of objects: plain charac‐\nters, which are simply copied to standard output, character  escape  sequences,  which\nare  converted  and  copied to the standard output, and format specifications, each of\nwhich causes printing of the next successive argument.  In addition  to  the  standard\nprintf(1) format specifications, printf interprets the following extensions:\n%b     causes  printf  to expand backslash escape sequences in the corresponding argu‐\nment in the same way as echo -e.\n%q     causes printf to output the corresponding argument in  a  format  that  can  be\nreused as shell input.\n%(datefmt)T\ncauses  printf to output the date-time string resulting from using datefmt as a\nformat string for strftime(3).  The corresponding argument is an integer repre‐\nsenting the number of seconds since the epoch.  Two special argument values may\nbe used: -1 represents the current time, and -2 represents the time  the  shell\nwas invoked.  If no argument is specified, conversion behaves as if -1 had been\ngiven.  This is an exception to the usual printf behavior.\n\nThe %b, %q, and %T directives all use the field width and precision arguments from the\nformat specification and write that many bytes from (or use that wide a field for) the\nexpanded argument, which usually contains more characters than the original.\n\nArguments to non-string format specifiers are treated as C constants,  except  that  a\nleading  plus  or  minus  sign is allowed, and if the leading character is a single or\ndouble quote, the value is the ASCII value of the following character.\n\nThe format is reused as necessary to consume all of the arguments.  If the format  re‐\nquires  more arguments than are supplied, the extra format specifications behave as if\na zero value or null string, as appropriate, had been supplied.  The return  value  is\nzero on success, non-zero on failure.\n\npushd [-n] [+n] [-n]\npushd [-n] [dir]\nAdds  a  directory to the top of the directory stack, or rotates the stack, making the\nnew top of the stack the current working directory.   With  no  arguments,  pushd  ex‐\nchanges  the  top  two directories and returns 0, unless the directory stack is empty.\nArguments, if supplied, have the following meanings:\n-n     Suppresses the normal change of directory when rotating or  adding  directories\nto the stack, so that only the stack is manipulated.\n+n     Rotates the stack so that the nth directory (counting from the left of the list\nshown by dirs, starting with zero) is at the top.\n-n     Rotates the stack so that the nth directory (counting from  the  right  of  the\nlist shown by dirs, starting with zero) is at the top.\ndir    Adds  dir  to the directory stack at the top, making it the new current working\ndirectory as if it had been supplied as the argument to the cd builtin.\n\nIf the pushd command is successful, a dirs is performed as well.  If the first form is\nused, pushd returns 0 unless the cd to dir fails.  With the second form, pushd returns\n0 unless the directory stack is empty, a non-existent directory stack element is spec‐\nified, or the directory change to the specified new current directory fails.\n\npwd [-LP]\nPrint  the  absolute  pathname of the current working directory.  The pathname printed\ncontains no symbolic links if the -P option is supplied or the -o physical  option  to\nthe  set  builtin  command is enabled.  If the -L option is used, the pathname printed\nmay contain symbolic links.  The return status is 0 unless an error occurs while read‐\ning the name of the current directory or an invalid option is supplied.\n\nread  [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout]\n[-u fd] [name ...]\nOne line is read from the standard input, or from the file descriptor fd  supplied  as\nan  argument  to  the -u option, split into words as described above under Word Split‐‐\nting, and the first word is assigned to the first name, the second word to the  second\nname,  and  so  on.  If there are more words than names, the remaining words and their\nintervening delimiters are assigned to the last name.  If there are fewer  words  read\nfrom  the input stream than names, the remaining names are assigned empty values.  The\ncharacters in IFS are used to split the line into words using the same rules the shell\nuses  for  expansion  (described above under Word Splitting).  The backslash character\n(\\) may be used to remove any special meaning for the next character read and for line\ncontinuation.  Options, if supplied, have the following meanings:\n-a aname\nThe  words  are  assigned  to  sequential  indices of the array variable aname,\nstarting at 0.  aname is unset before any new values are assigned.  Other  name\narguments are ignored.\n-d delim\nThe  first  character of delim is used to terminate the input line, rather than\nnewline.  If delim is the empty string, read will  terminate  a  line  when  it\nreads a NUL character.\n-e     If  the standard input is coming from a terminal, readline (see READLINE above)\nis used to obtain the line.  Readline uses the current  (or  default,  if  line\nediting  was  not  previously active) editing settings, but uses Readline's de‐\nfault filename completion.\n-i text\nIf readline is being used to read the line, text is  placed  into  the  editing\nbuffer before editing begins.\n-n nchars\nread returns after reading nchars characters rather than waiting for a complete\nline of input, but honors a delimiter if fewer than nchars characters are  read\nbefore the delimiter.\n-N nchars\nread  returns after reading exactly nchars characters rather than waiting for a\ncomplete line of input, unless EOF is encountered or read times out.  Delimiter\ncharacters  encountered in the input are not treated specially and do not cause\nread to return until nchars characters are read.  The result is  not  split  on\nthe  characters in IFS; the intent is that the variable is assigned exactly the\ncharacters read (with the exception of backslash; see the -r option below).\n-p prompt\nDisplay prompt on standard error, without a trailing newline, before attempting\nto read any input.  The prompt is displayed only if input is coming from a ter‐\nminal.\n-r     Backslash does not act as an escape character.  The backslash is considered  to\nbe  part  of the line.  In particular, a backslash-newline pair may not then be\nused as a line continuation.\n-s     Silent mode.  If input is coming from a terminal, characters are not echoed.\n-t timeout\nCause read to time out and return failure if a complete line  of  input  (or  a\nspecified  number  of  characters) is not read within timeout seconds.  timeout\nmay be a decimal number with a fractional portion following the decimal  point.\nThis  option  is only effective if read is reading input from a terminal, pipe,\nor other special file; it has no effect when reading from  regular  files.   If\nread  times  out, read saves any partial input read into the specified variable\nname.  If timeout is 0, read returns immediately, without trying  to  read  any\ndata.   The  exit  status  is 0 if input is available on the specified file de‐\nscriptor, non-zero otherwise.  The exit status is greater than 128 if the time‐\nout is exceeded.\n-u fd  Read input from file descriptor fd.\n\nIf  no  names  are supplied, the line read, without the ending delimiter but otherwise\nunmodified, is assigned to the variable REPLY.  The exit status is zero,  unless  end-\nof-file is encountered, read times out (in which case the status is greater than 128),\na variable assignment error (such as assigning to a readonly variable) occurs,  or  an\ninvalid file descriptor is supplied as the argument to -u.\n\nreadonly [-aAf] [-p] [name[=word] ...]\nThe  given  names are marked readonly; the values of these names may not be changed by\nsubsequent assignment.  If the -f option is supplied, the functions  corresponding  to\nthe names are so marked.  The -a option restricts the variables to indexed arrays; the\n-A option restricts the variables to associative arrays.  If  both  options  are  sup‐\nplied,  -A  takes  precedence.  If no name arguments are given, or if the -p option is\nsupplied, a list of all readonly names is printed.  The other options may be  used  to\nrestrict  the  output  to a subset of the set of readonly names.  The -p option causes\noutput to be displayed in a format that may be reused as input.  If a variable name is\nfollowed  by  =word, the value of the variable is set to word.  The return status is 0\nunless an invalid option is encountered, one of the names is not a valid  shell  vari‐\nable name, or -f is supplied with a name that is not a function.\n\nreturn [n]\nCauses a function to stop executing and return the value specified by n to its caller.\nIf n is omitted, the return status is that of the last command executed in  the  func‐\ntion  body.   If return is executed by a trap handler, the last command used to deter‐\nmine the status is the last command executed before the trap handler.   If  return  is\nexecuted  during  a  DEBUG  trap, the last command used to determine the status is the\nlast command executed by the trap handler before return was  invoked.   If  return  is\nused  outside a function, but during execution of a script by the .  (source) command,\nit causes the shell to stop executing that script and return either n or the exit sta‐\ntus  of  the last command executed within the script as the exit status of the script.\nIf n is supplied, the return value is its least significant 8 bits.  The return status\nis  non-zero  if return is supplied a non-numeric argument, or is used outside a func‐\ntion and not during execution of a script by . or source.  Any command associated with\nthe RETURN trap is executed before execution resumes after the function or script.\n\nset [--abefhkmnptuvxBCEHPT] [-o option-name] [arg ...]\nset [+abefhkmnptuvxBCEHPT] [+o option-name] [arg ...]\nWithout  options,  the name and value of each shell variable are displayed in a format\nthat can be reused as input for setting  or  resetting  the  currently-set  variables.\nRead-only  variables cannot be reset.  In posix mode, only shell variables are listed.\nThe output is sorted according to the current locale.   When  options  are  specified,\nthey  set  or unset shell attributes.  Any arguments remaining after option processing\nare treated as values for the positional parameters and are assigned, in order, to $1,\n$2, ...  $n.  Options, if specified, have the following meanings:\n-a      Each  variable or function that is created or modified is given the export at‐\ntribute and marked for export to the environment of subsequent commands.\n-b      Report the status of terminated background jobs immediately, rather  than  be‐\nfore  the next primary prompt.  This is effective only when job control is en‐\nabled.\n-e      Exit immediately if a pipeline (which may consist of a single simple command),\na list, or a compound command (see SHELL GRAMMAR above), exits with a non-zero\nstatus.  The shell does not exit if the command that fails is part of the com‐\nmand  list  immediately  following  a while or until keyword, part of the test\nfollowing the if or elif reserved words, part of any command executed in a  &&\nor  ||  list except the command following the final && or ||, any command in a\npipeline but the last, or if the command's return value is being inverted with\n!.   If a compound command other than a subshell returns a non-zero status be‐\ncause a command failed while -e was being ignored, the shell does not exit.  A\ntrap  on ERR, if set, is executed before the shell exits.  This option applies\nto the shell environment and each subshell environment separately (see COMMAND\nEXECUTION ENVIRONMENT above), and may cause subshells to exit before executing\nall the commands in the subshell.\n\nIf a compound command or shell function executes in a context where -e is  be‐\ning  ignored,  none  of  the  commands executed within the compound command or\nfunction body will be affected by the -e setting, even if -e is set and a com‐\nmand  returns  a failure status.  If a compound command or shell function sets\n-e while executing in a context where -e is ignored,  that  setting  will  not\nhave any effect until the compound command or the command containing the func‐\ntion call completes.\n-f      Disable pathname expansion.\n-h      Remember the location of commands as they are looked up for  execution.   This\nis enabled by default.\n-k      All  arguments in the form of assignment statements are placed in the environ‐\nment for a command, not just those that precede the command name.\n-m      Monitor mode.  Job control is enabled.  This option is on by default  for  in‐\nteractive shells on systems that support it (see JOB CONTROL above).  All pro‐\ncesses run in a separate process group.  When a background job completes,  the\nshell prints a line containing its exit status.\n-n      Read  commands  but  do  not  execute them.  This may be used to check a shell\nscript for syntax errors.  This is ignored by interactive shells.\n-o option-name\nThe option-name can be one of the following:\nallexport\nSame as -a.\nbraceexpand\nSame as -B.\nemacs   Use an emacs-style command line editing interface.  This is enabled by\ndefault  when  the  shell  is interactive, unless the shell is started\nwith the --noediting option.  This also affects the editing  interface\nused for read -e.\nerrexit Same as -e.\nerrtrace\nSame as -E.\nfunctrace\nSame as -T.\nhashall Same as -h.\nhistexpand\nSame as -H.\nhistory Enable command history, as described above under HISTORY.  This option\nis on by default in interactive shells.\nignoreeof\nThe effect is as if the shell command ``IGNOREEOF=10'' had  been  exe‐\ncuted (see Shell Variables above).\nkeyword Same as -k.\nmonitor Same as -m.\nnoclobber\nSame as -C.\nnoexec  Same as -n.\nnoglob  Same as -f.\nnolog   Currently ignored.\nnotify  Same as -b.\nnounset Same as -u.\nonecmd  Same as -t.\nphysical\nSame as -P.\npipefail\nIf  set,  the  return  value  of  a  pipeline is the value of the last\n(rightmost) command to exit with a non-zero status,  or  zero  if  all\ncommands  in  the pipeline exit successfully.  This option is disabled\nby default.\nposix   Change the behavior of bash where the default operation  differs  from\nthe  POSIX  standard to match the standard (posix mode).  See SEE ALSO\nbelow for a reference to a document that details how  posix  mode  af‐\nfects bash's behavior.\nprivileged\nSame as -p.\nverbose Same as -v.\nvi      Use  a vi-style command line editing interface.  This also affects the\nediting interface used for read -e.\nxtrace  Same as -x.\nIf -o is supplied with no option-name, the values of the current  options  are\nprinted.   If  +o is supplied with no option-name, a series of set commands to\nrecreate the current option settings is displayed on the standard output.\n-p      Turn on privileged mode.  In this mode, the $ENV and $BASHENV files  are  not\nprocessed,  shell  functions  are  not inherited from the environment, and the\nSHELLOPTS, BASHOPTS, CDPATH, and GLOBIGNORE variables, if they appear  in  the\nenvironment,  are  ignored.   If  the shell is started with the effective user\n(group) id not equal to the real user (group) id, and the  -p  option  is  not\nsupplied, these actions are taken and the effective user id is set to the real\nuser id.  If the -p option is supplied at startup, the effective  user  id  is\nnot reset.  Turning this option off causes the effective user and group ids to\nbe set to the real user and group ids.\n-t      Exit after reading and executing one command.\n-u      Treat unset variables and parameters other than the special parameters \"@\" and\n\"*\"  as  an  error  when  performing parameter expansion.  If expansion is at‐\ntempted on an unset variable or parameter, the shell prints an error  message,\nand, if not interactive, exits with a non-zero status.\n-v      Print shell input lines as they are read.\n-x      After  expanding  each  simple command, for command, case command, select com‐\nmand, or arithmetic for command, display the expanded value of  PS4,  followed\nby the command and its expanded arguments or associated word list.\n-B      The shell performs brace expansion (see Brace Expansion above).  This is on by\ndefault.\n-C      If set, bash does not overwrite an existing file with the >, >&, and <>  redi‐\nrection operators.  This may be overridden when creating output files by using\nthe redirection operator >| instead of >.\n-E      If set, any trap on ERR is inherited by  shell  functions,  command  substitu‐\ntions,  and commands executed in a subshell environment.  The ERR trap is nor‐\nmally not inherited in such cases.\n-H      Enable !  style history substitution.  This option is on by default  when  the\nshell is interactive.\n-P      If set, the shell does not resolve symbolic links when executing commands such\nas cd that change the current working directory.  It uses the physical  direc‐\ntory  structure instead.  By default, bash follows the logical chain of direc‐\ntories when performing commands which change the current directory.\n-T      If set, any traps on DEBUG and RETURN are inherited by shell  functions,  com‐\nmand  substitutions, and commands executed in a subshell environment.  The DE‐‐\nBUG and RETURN traps are normally not inherited in such cases.\n--      If no arguments follow this option, then the positional parameters are  unset.\nOtherwise, the positional parameters are set to the args, even if some of them\nbegin with a -.\n-       Signal the end of options, cause all remaining args to be assigned to the  po‐\nsitional  parameters.   The -x and -v options are turned off.  If there are no\nargs, the positional parameters remain unchanged.\n\nThe options are off by default unless otherwise noted.  Using + rather than  -  causes\nthese  options to be turned off.  The options can also be specified as arguments to an\ninvocation of the shell.  The current set of options may be found in $-.   The  return\nstatus is always true unless an invalid option is encountered.\n\nshift [n]\nThe  positional parameters from n+1 ... are renamed to $1 ....  Parameters represented\nby the numbers $# down to $#-n+1 are unset.  n must be a non-negative number less than\nor  equal  to $#.  If n is 0, no parameters are changed.  If n is not given, it is as‐\nsumed to be 1.  If n is greater than $#, the positional parameters  are  not  changed.\nThe return status is greater than zero if n is greater than $# or less than zero; oth‐\nerwise 0.\n\nshopt [-pqsu] [-o] [optname ...]\nToggle the values of settings controlling optional shell behavior.  The  settings  can\nbe  either  those listed below, or, if the -o option is used, those available with the\n-o option to the set builtin command.  With no options, or with the -p option, a  list\nof  all  settable  options  is displayed, with an indication of whether or not each is\nset; if optnames are supplied, the output is restricted to those options.  The -p  op‐\ntion  causes  output to be displayed in a form that may be reused as input.  Other op‐\ntions have the following meanings:\n-s     Enable (set) each optname.\n-u     Disable (unset) each optname.\n-q     Suppresses normal output (quiet mode); the return status indicates whether  the\noptname  is set or unset.  If multiple optname arguments are given with -q, the\nreturn status is zero if all optnames are enabled; non-zero otherwise.\n-o     Restricts the values of optname to be those defined for the -o  option  to  the\nset builtin.\n\nIf  either  -s or -u is used with no optname arguments, shopt shows only those options\nwhich are set or unset, respectively.  Unless otherwise noted, the shopt  options  are\ndisabled (unset) by default.\n\nThe  return  status when listing options is zero if all optnames are enabled, non-zero\notherwise.  When setting or unsetting options, the return status  is  zero  unless  an\noptname is not a valid shell option.\n\nThe list of shopt options is:\n\nassocexpandonce\nIf  set,  the  shell  suppresses multiple evaluation of associative array sub‐\nscripts during arithmetic expression evaluation, while executing builtins that\ncan  perform  variable  assignments, and while executing builtins that perform\narray dereferencing.\nautocd  If set, a command name that is the name of a directory is executed  as  if  it\nwere  the argument to the cd command.  This option is only used by interactive\nshells.\ncdablevars\nIf set, an argument to the cd builtin command that is not a directory  is  as‐\nsumed to be the name of a variable whose value is the directory to change to.\ncdspell If  set, minor errors in the spelling of a directory component in a cd command\nwill be corrected.  The errors checked for are transposed characters, a  miss‐\ning character, and one character too many.  If a correction is found, the cor‐\nrected filename is printed, and the command proceeds.   This  option  is  only\nused by interactive shells.\ncheckhash\nIf  set, bash checks that a command found in the hash table exists before try‐\ning to execute it.  If a hashed command no longer exists, a normal path search\nis performed.\ncheckjobs\nIf  set,  bash lists the status of any stopped and running jobs before exiting\nan interactive shell.  If any jobs are running, this causes the exit to be de‐\nferred  until  a  second exit is attempted without an intervening command (see\nJOB CONTROL above).  The shell  always  postpones  exiting  if  any  jobs  are\nstopped.\ncheckwinsize\nIf  set, bash checks the window size after each external (non-builtin) command\nand, if necessary, updates the values of LINES and COLUMNS.   This  option  is\nenabled by default.\ncmdhist If set, bash attempts to save all lines of a multiple-line command in the same\nhistory entry.  This allows easy re-editing of multi-line commands.  This  op‐\ntion  is  enabled by default, but only has an effect if command history is en‐\nabled, as described above under HISTORY.\ncompat31\ncompat32\ncompat40\ncompat41\ncompat42\ncompat43\ncompat44\nThese control aspects of the shell's compatibility mode (see SHELL COMPATIBIL‐‐\nITY MODE below).\n\ncompletefullquote\nIf  set, bash quotes all shell metacharacters in filenames and directory names\nwhen performing completion.  If not set, bash removes metacharacters  such  as\nthe  dollar  sign  from the set of characters that will be quoted in completed\nfilenames when these metacharacters appear in  shell  variable  references  in\nwords  to  be  completed.  This means that dollar signs in variable names that\nexpand to directories will not be quoted; however, any dollar signs  appearing\nin filenames will not be quoted, either.  This is active only when bash is us‐\ning backslashes to quote completed filenames.  This variable  is  set  by  de‐\nfault, which is the default bash behavior in versions through 4.2.\n\ndirexpand\nIf  set, bash replaces directory names with the results of word expansion when\nperforming filename completion.  This changes the  contents  of  the  readline\nediting buffer.  If not set, bash attempts to preserve what the user typed.\n\ndirspell\nIf  set, bash attempts spelling correction on directory names during word com‐\npletion if the directory name initially supplied does not exist.\n\ndotglob If set, bash includes filenames beginning with a `.' in the results  of  path‐\nname  expansion.   The filenames ``.''  and ``..''  must always be matched ex‐\nplicitly, even if dotglob is set.\n\nexecfail\nIf set, a non-interactive shell will not exit if it cannot  execute  the  file\nspecified  as  an  argument to the exec builtin command.  An interactive shell\ndoes not exit if exec fails.\n\nexpandaliases\nIf set, aliases are expanded as described above under ALIASES.  This option is\nenabled by default for interactive shells.\n\nextdebug\nIf set at shell invocation, or in a shell startup file, arrange to execute the\ndebugger profile before the shell starts, identical to the --debugger  option.\nIf set after invocation, behavior intended for use by debuggers is enabled:\n\n1.     The  -F option to the declare builtin displays the source file name and\nline number corresponding to each function name supplied  as  an  argu‐\nment.\n\n2.     If the command run by the DEBUG trap returns a non-zero value, the next\ncommand is skipped and not executed.\n\n3.     If the command run by the DEBUG trap returns a  value  of  2,  and  the\nshell  is executing in a subroutine (a shell function or a shell script\nexecuted by the . or source builtins), the shell simulates  a  call  to\nreturn.\n\n4.     BASHARGC  and BASHARGV are updated as described in their descriptions\nabove.\n\n5.     Function tracing is enabled: command substitution, shell functions, and\nsubshells invoked with ( command ) inherit the DEBUG and RETURN traps.\n\n6.     Error  tracing  is  enabled: command substitution, shell functions, and\nsubshells invoked with ( command ) inherit the ERR trap.\n\nextglob If set, the extended pattern matching features described above under  Pathname\nExpansion are enabled.\n\nextquote\nIf  set,  $'string' and $\"string\" quoting is performed within ${parameter} ex‐\npansions enclosed in double quotes.  This option is enabled by default.\n\nfailglob\nIf set, patterns which fail to match filenames during pathname  expansion  re‐\nsult in an expansion error.\n\nforcefignore\nIf set, the suffixes specified by the FIGNORE shell variable cause words to be\nignored when performing word completion even if the ignored words are the only\npossible completions.  See SHELL VARIABLES above for a description of FIGNORE.\nThis option is enabled by default.\n\nglobasciiranges\nIf set, range expressions used in pattern matching  bracket  expressions  (see\nPattern Matching above) behave as if in the traditional C locale when perform‐\ning comparisons.  That is, the current  locale's  collating  sequence  is  not\ntaken  into account, so b will not collate between A and B, and upper-case and\nlower-case ASCII characters will collate together.\n\nglobstar\nIf set, the pattern  used in a pathname expansion  context  will  match  all\nfiles and zero or more directories and subdirectories.  If the pattern is fol‐\nlowed by a /, only directories and subdirectories match.\n\ngnuerrfmt\nIf set, shell error messages are written in the  standard  GNU  error  message\nformat.\n\nhistappend\nIf  set,  the  history  list is appended to the file named by the value of the\nHISTFILE variable when the shell exits, rather than overwriting the file.\n\nhistreedit\nIf set, and readline is being used, a user is given the opportunity to re-edit\na failed history substitution.\n\nhistverify\nIf  set,  and  readline is being used, the results of history substitution are\nnot immediately passed to the shell parser.  Instead, the  resulting  line  is\nloaded into the readline editing buffer, allowing further modification.\n\nhostcomplete\nIf set, and readline is being used, bash will attempt to perform hostname com‐\npletion when a word containing a @ is being completed  (see  Completing  under\nREADLINE above).  This is enabled by default.\n\nhuponexit\nIf  set, bash will send SIGHUP to all jobs when an interactive login shell ex‐\nits.\n\ninheriterrexit\nIf set, command substitution inherits the value of the errexit option, instead\nof  unsetting  it  in  the  subshell environment.  This option is enabled when\nposix mode is enabled.\n\ninteractivecomments\nIf set, allow a word beginning with # to cause that  word  and  all  remaining\ncharacters  on  that  line to be ignored in an interactive shell (see COMMENTS\nabove).  This option is enabled by default.\n\nlastpipe\nIf set, and job control is not active, the shell runs the last  command  of  a\npipeline not executed in the background in the current shell environment.\n\nlithist If  set,  and  the cmdhist option is enabled, multi-line commands are saved to\nthe history with embedded newlines  rather  than  using  semicolon  separators\nwhere possible.\n\nlocalvarinherit\nIf  set, local variables inherit the value and attributes of a variable of the\nsame name that exists at a previous scope before any new  value  is  assigned.\nThe nameref attribute is not inherited.\n\nlocalvarunset\nIf  set,  calling  unset  on local variables in previous function scopes marks\nthem so subsequent lookups find them unset until that function  returns.  This\nis identical to the behavior of unsetting local variables at the current func‐\ntion scope.\n\nloginshell\nThe shell sets this option if it is started as a login shell  (see  INVOCATION\nabove).  The value may not be changed.\n\nmailwarn\nIf  set, and a file that bash is checking for mail has been accessed since the\nlast time it was checked, the message ``The mail in mailfile has  been  read''\nis displayed.\n\nnoemptycmdcompletion\nIf  set,  and readline is being used, bash will not attempt to search the PATH\nfor possible completions when completion is attempted on an empty line.\n\nnocaseglob\nIf set, bash matches filenames in a case-insensitive fashion  when  performing\npathname expansion (see Pathname Expansion above).\n\nnocasematch\nIf  set,  bash  matches patterns in a case-insensitive fashion when performing\nmatching while executing case or [[ conditional commands, when performing pat‐\ntern  substitution  word expansions, or when filtering possible completions as\npart of programmable completion.\n\nnullglob\nIf set, bash allows patterns which match  no  files  (see  Pathname  Expansion\nabove) to expand to a null string, rather than themselves.\n\nprogcomp\nIf  set,  the  programmable completion facilities (see Programmable Completion\nabove) are enabled.  This option is enabled by default.\n\nprogcompalias\nIf set, and programmable completion is enabled, bash  treats  a  command  name\nthat  doesn't  have any completions as a possible alias and attempts alias ex‐\npansion. If it has an alias, bash attempts programmable completion  using  the\ncommand word resulting from the expanded alias.\n\npromptvars\nIf  set,  prompt  strings  undergo  parameter expansion, command substitution,\narithmetic expansion, and quote removal after being expanded as  described  in\nPROMPTING above.  This option is enabled by default.\n\nrestrictedshell\nThe shell sets this option if it is started in restricted mode (see RESTRICTED\nSHELL below).  The value may not be changed.   This  is  not  reset  when  the\nstartup  files are executed, allowing the startup files to discover whether or\nnot a shell is restricted.\n\nshiftverbose\nIf set, the shift builtin prints an error message when the shift count exceeds\nthe number of positional parameters.\n\nsourcepath\nIf  set,  the  source (.) builtin uses the value of PATH to find the directory\ncontaining the file supplied as an argument.  This option is  enabled  by  de‐\nfault.\n\nxpgecho\nIf set, the echo builtin expands backslash-escape sequences by default.\n\nsuspend [-f]\nSuspend the execution of this shell until it receives a SIGCONT signal.  A login shell\ncannot be suspended; the -f option can be used to override this and force the  suspen‐\nsion.   The  return  status  is 0 unless the shell is a login shell and -f is not sup‐\nplied, or if job control is not enabled.\n\ntest expr\n[ expr ]\nReturn a status of 0 (true) or 1 (false) depending on the  evaluation  of  the  condi‐\ntional  expression  expr.  Each operator and operand must be a separate argument.  Ex‐\npressions are composed of the primaries described above under CONDITIONAL EXPRESSIONS.\ntest  does  not accept any options, nor does it accept and ignore an argument of -- as\nsignifying the end of options.\n\nExpressions may be combined using the following operators, listed in decreasing  order\nof  precedence.  The evaluation depends on the number of arguments; see below.  Opera‐\ntor precedence is used when there are five or more arguments.\n! expr True if expr is false.\n( expr )\nReturns the value of expr.  This may be used to override the normal  precedence\nof operators.\nexpr1 -a expr2\nTrue if both expr1 and expr2 are true.\nexpr1 -o expr2\nTrue if either expr1 or expr2 is true.\n\ntest  and  [ evaluate conditional expressions using a set of rules based on the number\nof arguments.\n\n0 arguments\nThe expression is false.\n1 argument\nThe expression is true if and only if the argument is not null.\n2 arguments\nIf the first argument is !, the expression is true if and only  if  the  second\nargument is null.  If the first argument is one of the unary conditional opera‐\ntors listed above under CONDITIONAL EXPRESSIONS, the expression is true if  the\nunary test is true.  If the first argument is not a valid unary conditional op‐\nerator, the expression is false.\n3 arguments\nThe following conditions are applied in the order listed.  If the second  argu‐\nment  is one of the binary conditional operators listed above under CONDITIONAL\nEXPRESSIONS, the result of the expression is the result of the binary test  us‐\ning  the  first  and  third arguments as operands.  The -a and -o operators are\nconsidered binary operators when there are three arguments.  If the first argu‐\nment  is !, the value is the negation of the two-argument test using the second\nand third arguments.  If the first argument is exactly ( and the third argument\nis exactly ), the result is the one-argument test of the second argument.  Oth‐\nerwise, the expression is false.\n4 arguments\nIf the first argument is !, the result is the negation  of  the  three-argument\nexpression  composed  of the remaining arguments.  Otherwise, the expression is\nparsed and evaluated according to precedence using the rules listed above.\n5 or more arguments\nThe expression is parsed and evaluated according to precedence using the  rules\nlisted above.\n\nWhen used with test or [, the < and > operators sort lexicographically using ASCII or‐\ndering.\n\ntimes  Print the accumulated user and system times for the shell and for processes  run  from\nthe shell.  The return status is 0.\n\ntrap [-lp] [[arg] sigspec ...]\nThe  command arg is to be read and executed when the shell receives signal(s) sigspec.\nIf arg is absent (and there is a single sigspec) or -, each specified signal is  reset\nto  its original disposition (the value it had upon entrance to the shell).  If arg is\nthe null string the signal specified by each sigspec is ignored by the  shell  and  by\nthe  commands  it  invokes.   If arg is not present and -p has been supplied, then the\ntrap commands associated with each sigspec are displayed.  If no  arguments  are  sup‐\nplied  or  if  only -p is given, trap prints the list of commands associated with each\nsignal.  The -l option causes the shell to print a list of signal names and their cor‐\nresponding  numbers.  Each sigspec is either a signal name defined in <signal.h>, or a\nsignal number.  Signal names are case insensitive and the SIG prefix is optional.\n\nIf a sigspec is EXIT (0) the command arg is executed on exit from  the  shell.   If  a\nsigspec  is  DEBUG,  the command arg is executed before every simple command, for com‐\nmand, case command, select command, every arithmetic for command, and before the first\ncommand executes in a shell function (see SHELL GRAMMAR above).  Refer to the descrip‐\ntion of the extdebug option to the shopt builtin for details of its effect on the  DE‐‐\nBUG trap.  If a sigspec is RETURN, the command arg is executed each time a shell func‐\ntion or a script executed with the . or source builtins finishes executing.\n\nIf a sigspec is ERR, the command arg is executed whenever a pipeline (which  may  con‐\nsist  of  a  single  simple command), a list, or a compound command returns a non-zero\nexit status, subject to the following conditions.  The ERR trap is not executed if the\nfailed command is part of the command list immediately following a while or until key‐\nword, part of the test in an if statement, part of a command executed in a  &&  or  ||\nlist  except  the  command following the final && or ||, any command in a pipeline but\nthe last, or if the command's return value is being inverted using !.  These  are  the\nsame conditions obeyed by the errexit (-e) option.\n\nSignals  ignored  upon entry to the shell cannot be trapped or reset.  Trapped signals\nthat are not being ignored are reset to their original values in a  subshell  or  sub‐\nshell  environment  when one is created.  The return status is false if any sigspec is\ninvalid; otherwise trap returns true.\n\ntype [-aftpP] name [name ...]\nWith no options, indicate how each name would be interpreted  if  used  as  a  command\nname.   If the -t option is used, type prints a string which is one of alias, keyword,\nfunction, builtin, or file if  name  is  an  alias,  shell  reserved  word,  function,\nbuiltin,  or  disk  file,  respectively.   If  the  name is not found, then nothing is\nprinted, and an exit status of false is returned.  If the -p option is used, type  ei‐\nther  returns  the name of the disk file that would be executed if name were specified\nas a command name, or nothing if ``type -t name'' would not return file.  The  -P  op‐\ntion  forces  a  PATH  search for each name, even if ``type -t name'' would not return\nfile.  If a command is hashed, -p and -P print the hashed value, which is  not  neces‐\nsarily the file that appears first in PATH.  If the -a option is used, type prints all\nof the places that contain an executable named name.  This includes aliases and  func‐\ntions, if and only if the -p option is not also used.  The table of hashed commands is\nnot consulted when using -a.  The -f option suppresses shell function lookup, as  with\nthe  command  builtin.   type returns true if all of the arguments are found, false if\nany are not found.\n\nulimit [-HS] -a\nulimit [-HS] [-bcdefiklmnpqrstuvxPRT [limit]]\nProvides control over the resources available to the shell and to processes started by\nit,  on  systems that allow such control.  The -H and -S options specify that the hard\nor soft limit is set for the given resource.  A hard limit cannot be  increased  by  a\nnon-root  user  once  it  is set; a soft limit may be increased up to the value of the\nhard limit.  If neither -H nor -S is specified, both the soft and hard limits are set.\nThe  value  of  limit can be a number in the unit specified for the resource or one of\nthe special values hard, soft, or unlimited, which stand for the current  hard  limit,\nthe  current soft limit, and no limit, respectively.  If limit is omitted, the current\nvalue of the soft limit of the resource is printed, unless the  -H  option  is  given.\nWhen more than one resource is specified, the limit name and unit, if appropriate, are\nprinted before the value.  Other options are interpreted as follows:\n-a     All current limits are reported; no limits are set\n-b     The maximum socket buffer size\n-c     The maximum size of core files created\n-d     The maximum size of a process's data segment\n-e     The maximum scheduling priority (\"nice\")\n-f     The maximum size of files written by the shell and its children\n-i     The maximum number of pending signals\n-k     The maximum number of kqueues that may be allocated\n-l     The maximum size that may be locked into memory\n-m     The maximum resident set size (many systems do not honor this limit)\n-n     The maximum number of open file descriptors (most systems  do  not  allow  this\nvalue to be set)\n-p     The pipe size in 512-byte blocks (this may not be set)\n-q     The maximum number of bytes in POSIX message queues\n-r     The maximum real-time scheduling priority\n-s     The maximum stack size\n-t     The maximum amount of cpu time in seconds\n-u     The maximum number of processes available to a single user\n-v     The  maximum  amount of virtual memory available to the shell and, on some sys‐\ntems, to its children\n-x     The maximum number of file locks\n-P     The maximum number of pseudoterminals\n-R     The maximum time a real-time process can run before blocking, in microseconds\n-T     The maximum number of threads\n\nIf limit is given, and the -a option is not used, limit is the new value of the speci‐\nfied  resource.   If  no option is given, then -f is assumed.  Values are in 1024-byte\nincrements, except for -t, which is in seconds; -R,  which  is  in  microseconds;  -p,\nwhich  is  in units of 512-byte blocks; -P, -T, -b, -k, -n, and -u, which are unscaled\nvalues; and, when in posix mode, -c and -f, which are in 512-byte increments.  The re‐\nturn  status is 0 unless an invalid option or argument is supplied, or an error occurs\nwhile setting a new limit.\n\numask [-p] [-S] [mode]\nThe user file-creation mask is set to mode.  If mode begins with a digit, it is inter‐\npreted as an octal number; otherwise it is interpreted as a symbolic mode mask similar\nto that accepted by chmod(1).  If mode is omitted, the current value of  the  mask  is\nprinted.   The  -S  option causes the mask to be printed in symbolic form; the default\noutput is an octal number.  If the -p option is supplied, and  mode  is  omitted,  the\noutput  is  in a form that may be reused as input.  The return status is 0 if the mode\nwas successfully changed or if no mode argument was supplied, and false otherwise.\n\nunalias [-a] [name ...]\nRemove each name from the list of defined aliases.  If -a is supplied, all alias defi‐\nnitions are removed.  The return value is true unless a supplied name is not a defined\nalias.\n\nunset [-fv] [-n] [name ...]\nFor each name, remove the corresponding variable or function.  If  the  -v  option  is\ngiven,  each name refers to a shell variable, and that variable is removed.  Read-only\nvariables may not be unset.  If -f is specified, each name refers to a shell function,\nand  the  function definition is removed.  If the -n option is supplied, and name is a\nvariable with the nameref attribute, name will be unset rather than  the  variable  it\nreferences.   -n  has  no effect if the -f option is supplied.  If no options are sup‐\nplied, each name refers to a variable; if there is no variable by that name,  a  func‐\ntion  with  that  name,  if any, is unset.  Each unset variable or function is removed\nfrom  the  environment  passed  to  subsequent  commands.   If  any  of  BASHALIASES,\nBASHARGV0,   BASHCMDS,   BASHCOMMAND,   BASHSUBSHELL,   BASHPID,  COMPWORDBREAKS,\nDIRSTACK, EPOCHREALTIME, EPOCHSECONDS, FUNCNAME, GROUPS, HISTCMD, LINENO, RANDOM, SEC‐‐\nONDS,  or SRANDOM are unset, they lose their special properties, even if they are sub‐\nsequently reset.  The exit status is true unless a name is readonly.\n\nwait [-fn] [-p varname] [id ...]\nWait for each specified child process and return its termination status.  Each id  may\nbe  a process ID or a job specification; if a job spec is given, all processes in that\njob's pipeline are waited for.  If id is not given, wait waits for all  running  back‐\nground  jobs and the last-executed process substitution, if its process id is the same\nas $!, and the return status is zero.  If the -n option is supplied, wait waits for  a\nsingle  job  from the list of ids or, if no ids are supplied, any job, to complete and\nreturns its exit status.  If none of the supplied arguments is a child of  the  shell,\nor  if  no arguments are supplied and the shell has no unwaited-for children, the exit\nstatus is 127.  If the -p option is supplied, the process or job identifier of the job\nfor which the exit status is returned is assigned to the variable varname named by the\noption argument.  The variable will be unset initially, before any  assignment.   This\nis useful only when the -n option is supplied.  Supplying the -f option, when job con‐\ntrol is enabled, forces wait to wait for id to terminate before returning its  status,\ninstead  of  returning when it changes status.  If id specifies a non-existent process\nor job, the return status is 127.  Otherwise, the return status is the exit status  of\nthe last process or job waited for.\n\n### SHELL COMPATIBILITY MODE\n\nBash-4.0  introduced  the concept of a `shell compatibility level', specified as a set of op‐\ntions to the shopt builtin compat31, compat32, compat40, compat41, and so on).  There is only\none  current  compatibility  level  --  each option is mutually exclusive.  The compatibility\nlevel is intended to allow users to select behavior from previous versions that is incompati‐\nble with newer versions while they migrate scripts to use current features and behavior. It's\nintended to be a temporary solution.\n\nThis section does not mention behavior that is standard for a particular version (e.g.,  set‐\nting  compat32 means that quoting the rhs of the regexp matching operator quotes special reg‐\nexp characters in the word, which is default behavior in bash-3.2 and above).\n\nIf a user enables, say, compat32, it may affect the behavior of other compatibility levels up\nto  and including the current compatibility level.  The idea is that each compatibility level\ncontrols behavior that changed in that version of bash,  but  that  behavior  may  have  been\npresent  in  earlier versions.  For instance, the change to use locale-based comparisons with\nthe [[ command came in bash-4.1, and earlier versions used ASCII-based  comparisons,  so  en‐\nabling  compat32  will  enable  ASCII-based comparisons as well.  That granularity may not be\nsufficient for all uses, and as a result users should employ compatibility levels  carefully.\nRead the documentation for a particular feature to find out the current behavior.\n\nBash-4.3  introduced  a new shell variable: BASHCOMPAT.  The value assigned to this variable\n(a decimal version number like 4.2, or an integer corresponding to the compatNN option,  like\n42) determines the compatibility level.\n\nStarting  with  bash-4.4, Bash has begun deprecating older compatibility levels.  Eventually,\nthe options will be removed in favor of BASHCOMPAT.\n\nBash-5.0 is the final version for which there will be an individual shopt option for the pre‐\nvious version. Users should use BASHCOMPAT on bash-5.0 and later versions.\n\nThe  following  table  describes  the behavior changes controlled by each compatibility level\nsetting.  The compatNN tag is used as shorthand for setting the compatibility level to NN us‐\ning one of the following mechanisms.  For versions prior to bash-5.0, the compatibility level\nmay be set using the corresponding compatNN shopt option.  For bash-4.3 and  later  versions,\nthe BASHCOMPAT variable is preferred, and it is required for bash-5.1 and later versions.\n\n#### compat31\n\n•      quoting  the  rhs of the [[ command's regexp matching operator (=~) has no spe‐\ncial effect\n\n#### compat32\n\n•      interrupting a command list such as \"a ; b ; c\" causes  the  execution  of  the\nnext  command in the list (in bash-4.0 and later versions, the shell acts as if\nit received the interrupt, so interrupting one command in a list aborts the ex‐\necution of the entire list)\n\n#### compat40\n\n•      the < and > operators to the [[ command do not consider the current locale when\ncomparing strings; they use ASCII ordering.  Bash versions  prior  to  bash-4.1\nuse  ASCII collation and strcmp(3); bash-4.1 and later use the current locale's\ncollation sequence and strcoll(3).\n\n#### compat41\n\n•      in posix mode, time may be followed by options and still be recognized as a re‐\nserved word (this is POSIX interpretation 267)\n•      in  posix  mode, the parser requires that an even number of single quotes occur\nin the word portion of a double-quoted parameter expansion and treats them spe‐\ncially, so that characters within the single quotes are considered quoted (this\nis POSIX interpretation 221)\n\n#### compat42\n\n•      the replacement string in double-quoted pattern substitution does  not  undergo\nquote removal, as it does in versions after bash-4.2\n•      in  posix  mode,  single  quotes are considered special when expanding the word\nportion of a double-quoted parameter expansion and can be used to quote a clos‐\ning  brace  or  other  special  character (this is part of POSIX interpretation\n221); in later versions, single quotes are  not  special  within  double-quoted\nword expansions\n\n#### compat43\n\n•      the  shell  does  not  print  a  warning message if an attempt is made to use a\nquoted compound assignment as an argument to declare (declare -a foo='(1  2)').\nLater versions warn that this usage is deprecated\n•      word  expansion  errors  are considered non-fatal errors that cause the current\ncommand to fail, even in posix mode (the default behavior is to make them fatal\nerrors that cause the shell to exit)\n•      when  executing a shell function, the loop state (while/until/etc.)  is not re‐\nset, so break or continue in that function will break or continue loops in  the\ncalling context. Bash-4.4 and later reset the loop state to prevent this\n\n#### compat44\n\n•      the shell sets up the values used by BASHARGV and BASHARGC so they can expand\nto the shell's positional parameters even if extended debugging mode is not en‐\nabled\n•      a  subshell  inherits  loops from its parent context, so break or continue will\ncause the subshell to exit.  Bash-5.0 and later reset the loop state to prevent\nthe exit\n•      variable  assignments  preceding builtins like export and readonly that set at‐\ntributes continue to affect variables with the same name in the  calling  envi‐\nronment even if the shell is not in posix mode\n\n#### compat50\n\n•      Bash-5.1  changed  the way $RANDOM is generated to introduce slightly more ran‐\ndomness. If the shell compatibility level is set to 50 or lower, it reverts  to\nthe  method  from  bash-5.0 and previous versions, so seeding the random number\ngenerator by assigning a value to RANDOM will produce the same sequence  as  in\nbash-5.0\n•      If  the command hash table is empty, bash versions prior to bash-5.1 printed an\ninformational message to that effect, even when producing output  that  can  be\nreused  as  input.  Bash-5.1 suppresses that message when the -l option is sup‐\nplied.\n\n### RESTRICTED SHELL\n\nIf bash is started with the name rbash, or the -r option is supplied at invocation, the shell\nbecomes restricted.  A restricted shell is used to set up an environment more controlled than\nthe standard shell.  It behaves identically to bash with the exception that the following are\ndisallowed or not performed:\n\n•      changing directories with cd\n\n•      setting or unsetting the values of SHELL, PATH, HISTFILE, ENV, or BASHENV\n\n•      specifying command names containing /\n\n•      specifying a filename containing a / as an argument to the .  builtin command\n\n•      specifying a filename containing a slash as an argument to the history builtin command\n\n•      specifying  a  filename containing a slash as an argument to the -p option to the hash\nbuiltin command\n\n•      importing function definitions from the shell environment at startup\n\n•      parsing the value of SHELLOPTS from the shell environment at startup\n\n•      redirecting output using the >, >|, <>, >&, &>, and >> redirection operators\n\n•      using the exec builtin command to replace the shell with another command\n\n•      adding or deleting builtin commands with the -f and -d options to the  enable  builtin\ncommand\n\n•      using the enable builtin command to enable disabled shell builtins\n\n•      specifying the -p option to the command builtin command\n\n•      turning off restricted mode with set +r or set +o restricted.\n\nThese restrictions are enforced after any startup files are read.\n\nWhen  a command that is found to be a shell script is executed (see COMMAND EXECUTION above),\nrbash turns off any restrictions in the shell spawned to execute the script.\n\n### SEE ALSO\n\nBash Reference Manual, Brian Fox and Chet Ramey\nThe Gnu Readline Library, Brian Fox and Chet Ramey\nThe Gnu History Library, Brian Fox and Chet Ramey\nPortable Operating System Interface (POSIX) Part 2: Shell and Utilities, IEEE --\nhttp://pubs.opengroup.org/onlinepubs/9699919799/\nhttp://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode\nsh(1), ksh(1), csh(1)\nemacs(1), vi(1)\nreadline(3)\n\n### FILES\n\n/bin/bash\nThe bash executable\n/etc/profile\nThe systemwide initialization file, executed for login shells\n/etc/bash.bashrc\nThe systemwide per-interactive-shell startup file\n/etc/bash.bash.logout\nThe systemwide login shell cleanup file, executed when a login shell exits\n~/.bashprofile\nThe personal initialization file, executed for login shells\n~/.bashrc\nThe individual per-interactive-shell startup file\n~/.bashlogout\nThe individual login shell cleanup file, executed when a login shell exits\n~/.inputrc\nIndividual readline initialization file\n\n### AUTHORS\n\nBrian Fox, Free Software Foundation\nbfox@gnu.org\n\nChet Ramey, Case Western Reserve University\nchet.ramey@case.edu\n\n### BUG REPORTS\n\nIf you find a bug in bash, you should report it.  But first, you should make sure that it re‐\nally  is a bug, and that it appears in the latest version of bash.  The latest version is al‐\nways available from ftp://ftp.gnu.org/pub/gnu/bash/.\n\nOnce you have determined that a bug actually exists, use the bashbug command to submit a  bug\nreport.  If you have a fix, you are encouraged to mail that as well!  Suggestions and `philo‐\nsophical' bug reports may be mailed to bug-bash@gnu.org or posted  to  the  Usenet  newsgroup\ngnu.bash.bug.\n\nALL bug reports should include:\n\nThe version number of bash\nThe hardware and operating system\nThe compiler used to compile\nA description of the bug behaviour\nA short script or `recipe' which exercises the bug\n\nbashbug  inserts the first three items automatically into the template it provides for filing\na bug report.\n\nComments  and  bug  reports   concerning   this   manual   page   should   be   directed   to\nchet.ramey@case.edu.\n\n### BUGS\n\nIt's too big and too slow.\n\nThere are some subtle differences between bash and traditional versions of sh, mostly because\nof the POSIX specification.\n\nAliases are confusing in some uses.\n\nShell builtin commands and functions are not stoppable/restartable.\n\nCompound commands and command sequences of the form `a ; b ; c' are  not  handled  gracefully\nwhen  process suspension is attempted.  When a process is stopped, the shell immediately exe‐\ncutes the next command in the sequence.  It suffices to place the sequence  of  commands  be‐\ntween parentheses to force it into a subshell, which may be stopped as a unit.\n\nArray variables may not (yet) be exported.\n\nThere may be only one active coprocess at a time.\n\n\n\nGNU Bash 5.1                               2020 October 29                                   BASH(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "bash",
        "section": "1",
        "mode": "man",
        "summary": "bash - GNU Bourne-Again SHell",
        "synopsis": "bash [options] [commandstring | file]",
        "flags": [
            {
                "flag": "-c",
                "long": null,
                "arg": null,
                "description": "ment commandstring. If there are arguments after the commandstring, the first argument is assigned to $0 and any remaining arguments are assigned to the posi‐ tional parameters. The assignment to $0 sets the name of the shell, which is used in warning and error messages."
            },
            {
                "flag": "-i",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-l",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-r",
                "long": null,
                "arg": null,
                "description": "low)."
            },
            {
                "flag": "-s",
                "long": null,
                "arg": null,
                "description": "then commands are read from the standard input. This option allows the positional parameters to be set when invoking an interactive shell or when reading input through a pipe."
            },
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-D",
                "long": null,
                "arg": null,
                "description": "put. These are the strings that are subject to language translation when the cur‐ rent locale is not C or POSIX. This implies the -n option; no commands will be ex‐ ecuted. [-+]O [shoptoption] shoptoption is one of the shell options accepted by the shopt builtin (see SHELL BUILTIN COMMANDS below). If shoptoption is present, -O sets the value of that op‐ tion; +O unsets it. If shoptoption is not supplied, the names and values of the shell options accepted by shopt are printed on the standard output. If the invoca‐ tion option is +O, the output is displayed in a format that may be reused as input. -- A -- signals the end of options and disables further option processing. Any argu‐ ments after the -- are treated as filenames and arguments. An argument of - is equivalent to --. Bash also interprets a number of multi-character options. These options must appear on the command line before the single-character options to be recognized."
            },
            {
                "flag": "",
                "long": "--debugger",
                "arg": null,
                "description": "Arrange for the debugger profile to be executed before the shell starts. Turns on ex‐ tended debugging mode (see the description of the extdebug option to the shopt builtin below)."
            },
            {
                "flag": "",
                "long": "--dump-po-strings",
                "arg": null,
                "description": "Equivalent to -D, but the output is in the GNU gettext po (portable object) file for‐ mat."
            },
            {
                "flag": "",
                "long": "--dump-strings",
                "arg": null,
                "description": "Equivalent to -D. --help Display a usage message on standard output and exit successfully. --init-file file --rcfile file Execute commands from file instead of the system wide initialization file /etc/bash.bashrc and the standard personal initialization file ~/.bashrc if the shell is interactive (see INVOCATION below)."
            },
            {
                "flag": "",
                "long": "--login",
                "arg": null,
                "description": "Equivalent to -l."
            },
            {
                "flag": "",
                "long": "--noediting",
                "arg": null,
                "description": "Do not use the GNU readline library to read command lines when the shell is interac‐ tive."
            },
            {
                "flag": "",
                "long": "--noprofile",
                "arg": null,
                "description": "Do not read either the system-wide startup file /etc/profile or any of the personal initialization files ~/.bashprofile, ~/.bashlogin, or ~/.profile. By default, bash reads these files when it is invoked as a login shell (see INVOCATION below). --norc Do not read and execute the system wide initialization file /etc/bash.bashrc and the personal initialization file ~/.bashrc if the shell is interactive. This option is on by default if the shell is invoked as sh."
            },
            {
                "flag": "",
                "long": "--posix",
                "arg": null,
                "description": "Change the behavior of bash where the default operation differs from the POSIX stan‐ dard to match the standard (posix mode). See SEE ALSO below for a reference to a doc‐ ument that details how posix mode affects bash's behavior."
            },
            {
                "flag": "",
                "long": "--restricted",
                "arg": null,
                "description": "The shell becomes restricted (see RESTRICTED SHELL below)."
            },
            {
                "flag": "",
                "long": "--verbose",
                "arg": null,
                "description": "Equivalent to -v."
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "Show version information for this instance of bash on the standard output and exit successfully."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "sh",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/sh/1/json"
            },
            {
                "name": "ksh",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ksh/1/json"
            },
            {
                "name": "csh",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/csh/1/json"
            },
            {
                "name": "emacs",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/emacs/1/json"
            },
            {
                "name": "vi",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/vi/1/json"
            },
            {
                "name": "readline",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/readline/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 4,
                "subsections": [
                    {
                        "name": "-c -c",
                        "lines": 4,
                        "flag": "-c"
                    },
                    {
                        "name": "-i -i",
                        "lines": 1,
                        "flag": "-i"
                    },
                    {
                        "name": "-l",
                        "lines": 1,
                        "flag": "-l"
                    },
                    {
                        "name": "-r -r",
                        "lines": 1,
                        "flag": "-r"
                    },
                    {
                        "name": "-s -s",
                        "lines": 3,
                        "flag": "-s"
                    },
                    {
                        "name": "-v",
                        "lines": 1,
                        "flag": "-v"
                    },
                    {
                        "name": "-x",
                        "lines": 1,
                        "flag": "-x"
                    },
                    {
                        "name": "-D",
                        "lines": 16,
                        "flag": "-D"
                    },
                    {
                        "name": "--debugger",
                        "lines": 3,
                        "long": "--debugger"
                    },
                    {
                        "name": "--dump-po-strings",
                        "lines": 2,
                        "long": "--dump-po-strings"
                    },
                    {
                        "name": "--dump-strings",
                        "lines": 8,
                        "long": "--dump-strings"
                    },
                    {
                        "name": "--login",
                        "lines": 2,
                        "long": "--login"
                    },
                    {
                        "name": "--noediting",
                        "lines": 3,
                        "long": "--noediting"
                    },
                    {
                        "name": "--noprofile",
                        "lines": 8,
                        "long": "--noprofile"
                    },
                    {
                        "name": "--posix",
                        "lines": 4,
                        "long": "--posix"
                    },
                    {
                        "name": "--restricted",
                        "lines": 2,
                        "long": "--restricted"
                    },
                    {
                        "name": "--verbose",
                        "lines": 2,
                        "long": "--verbose"
                    },
                    {
                        "name": "--version",
                        "lines": 3,
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "ARGUMENTS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "INVOCATION",
                "lines": 66,
                "subsections": []
            },
            {
                "name": "DEFINITIONS",
                "lines": 6,
                "subsections": [
                    {
                        "name": "metacharacter",
                        "lines": 2
                    },
                    {
                        "name": "control operator",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "RESERVED WORDS",
                "lines": 5,
                "subsections": [
                    {
                        "name": "! case  coproc  do done elif else esac fi for function if in select then until while { } time",
                        "lines": 1
                    },
                    {
                        "name": "[[ ]]",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "SHELL GRAMMAR",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Simple Commands",
                        "lines": 8
                    },
                    {
                        "name": "Pipelines",
                        "lines": 35
                    },
                    {
                        "name": "Lists",
                        "lines": 30
                    },
                    {
                        "name": "Compound Commands",
                        "lines": 144
                    },
                    {
                        "name": "Coprocesses",
                        "lines": 26
                    },
                    {
                        "name": "Shell Function Definitions",
                        "lines": 20
                    }
                ]
            },
            {
                "name": "COMMENTS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "QUOTING",
                "lines": 69,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 55,
                "subsections": [
                    {
                        "name": "Positional Parameters",
                        "lines": 9
                    },
                    {
                        "name": "Special Parameters",
                        "lines": 36
                    },
                    {
                        "name": "Shell Variables",
                        "lines": 502
                    },
                    {
                        "name": "histchars",
                        "lines": 11
                    },
                    {
                        "name": "Arrays",
                        "lines": 83
                    }
                ]
            },
            {
                "name": "EXPANSION",
                "lines": 21,
                "subsections": [
                    {
                        "name": "Brace Expansion",
                        "lines": 46
                    },
                    {
                        "name": "Tilde Expansion",
                        "lines": 28
                    },
                    {
                        "name": "Parameter Expansion",
                        "lines": 197
                    },
                    {
                        "name": "Command Substitution",
                        "lines": 23
                    },
                    {
                        "name": "Arithmetic Expansion",
                        "lines": 16
                    },
                    {
                        "name": "Process Substitution",
                        "lines": 11
                    },
                    {
                        "name": "Word Splitting",
                        "lines": 24
                    },
                    {
                        "name": "Pathname Expansion",
                        "lines": 30
                    },
                    {
                        "name": "Pattern Matching",
                        "lines": 59
                    },
                    {
                        "name": "Quote Removal",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "REDIRECTION",
                "lines": 63,
                "subsections": [
                    {
                        "name": "Redirecting Input",
                        "lines": 8
                    },
                    {
                        "name": "Redirecting Output",
                        "lines": 15
                    },
                    {
                        "name": "Appending Redirected Output",
                        "lines": 8
                    },
                    {
                        "name": "Redirecting Standard Output and Standard Error",
                        "lines": 16
                    },
                    {
                        "name": "Appending Standard Output and Standard Error",
                        "lines": 13
                    },
                    {
                        "name": "Here Documents",
                        "lines": 22
                    },
                    {
                        "name": "Here Strings",
                        "lines": 9
                    },
                    {
                        "name": "Duplicating File Descriptors",
                        "lines": 20
                    },
                    {
                        "name": "Moving File Descriptors",
                        "lines": 14
                    },
                    {
                        "name": "Opening File Descriptors for Reading and Writing",
                        "lines": 8
                    }
                ]
            },
            {
                "name": "ALIASES",
                "lines": 35,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 65,
                "subsections": []
            },
            {
                "name": "ARITHMETIC EVALUATION",
                "lines": 17,
                "subsections": [
                    {
                        "name": "<= >= < >",
                        "lines": 35
                    }
                ]
            },
            {
                "name": "CONDITIONAL EXPRESSIONS",
                "lines": 19,
                "subsections": [
                    {
                        "name": "-a",
                        "lines": 1,
                        "flag": "-a"
                    },
                    {
                        "name": "-b",
                        "lines": 1,
                        "flag": "-b"
                    },
                    {
                        "name": "-c",
                        "lines": 1,
                        "flag": "-c"
                    },
                    {
                        "name": "-d",
                        "lines": 1,
                        "flag": "-d"
                    },
                    {
                        "name": "-e",
                        "lines": 1,
                        "flag": "-e"
                    },
                    {
                        "name": "-f",
                        "lines": 1,
                        "flag": "-f"
                    },
                    {
                        "name": "-g",
                        "lines": 1,
                        "flag": "-g"
                    },
                    {
                        "name": "-h",
                        "lines": 1,
                        "flag": "-h"
                    },
                    {
                        "name": "-k",
                        "lines": 1,
                        "flag": "-k"
                    },
                    {
                        "name": "-p",
                        "lines": 1,
                        "flag": "-p"
                    },
                    {
                        "name": "-r",
                        "lines": 1,
                        "flag": "-r"
                    },
                    {
                        "name": "-s",
                        "lines": 1,
                        "flag": "-s"
                    },
                    {
                        "name": "-t",
                        "lines": 1,
                        "flag": "-t"
                    },
                    {
                        "name": "-u",
                        "lines": 1,
                        "flag": "-u"
                    },
                    {
                        "name": "-w",
                        "lines": 1,
                        "flag": "-w"
                    },
                    {
                        "name": "-x",
                        "lines": 1,
                        "flag": "-x"
                    },
                    {
                        "name": "-G",
                        "lines": 1,
                        "flag": "-G"
                    },
                    {
                        "name": "-L",
                        "lines": 1,
                        "flag": "-L"
                    },
                    {
                        "name": "-N",
                        "lines": 1,
                        "flag": "-N"
                    },
                    {
                        "name": "-O",
                        "lines": 1,
                        "flag": "-O"
                    },
                    {
                        "name": "-S",
                        "lines": 8,
                        "flag": "-S"
                    },
                    {
                        "name": "-o",
                        "lines": 2,
                        "flag": "-o"
                    },
                    {
                        "name": "-v",
                        "lines": 1,
                        "flag": "-v"
                    },
                    {
                        "name": "-R",
                        "lines": 1,
                        "flag": "-R"
                    },
                    {
                        "name": "-z",
                        "lines": 2,
                        "flag": "-z"
                    },
                    {
                        "name": "-n",
                        "lines": 24,
                        "flag": "-n"
                    }
                ]
            },
            {
                "name": "SIMPLE COMMAND EXPANSION",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "COMMAND EXECUTION",
                "lines": 37,
                "subsections": []
            },
            {
                "name": "COMMAND EXECUTION ENVIRONMENT",
                "lines": 63,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "EXIT STATUS",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "SIGNALS",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "JOB CONTROL",
                "lines": 70,
                "subsections": []
            },
            {
                "name": "PROMPTING",
                "lines": 51,
                "subsections": []
            },
            {
                "name": "READLINE",
                "lines": 8,
                "subsections": [
                    {
                        "name": "Readline Notation",
                        "lines": 17
                    },
                    {
                        "name": "Readline Initialization",
                        "lines": 25
                    },
                    {
                        "name": "Readline Key Bindings",
                        "lines": 61
                    },
                    {
                        "name": "Readline Variables",
                        "lines": 11
                    },
                    {
                        "name": "bell-style (audible)",
                        "lines": 3
                    },
                    {
                        "name": "bind-tty-special-chars (On)",
                        "lines": 2
                    },
                    {
                        "name": "blink-matching-paren (Off)",
                        "lines": 2
                    },
                    {
                        "name": "colored-completion-prefix (Off)",
                        "lines": 3
                    },
                    {
                        "name": "colored-stats (Off)",
                        "lines": 3
                    },
                    {
                        "name": "comment-begin (``#'')",
                        "lines": 2
                    },
                    {
                        "name": "completion-display-width (-1)",
                        "lines": 4
                    },
                    {
                        "name": "completion-ignore-case (Off)",
                        "lines": 2
                    },
                    {
                        "name": "completion-map-case (Off)",
                        "lines": 3
                    },
                    {
                        "name": "completion-prefix-display-length (0)",
                        "lines": 4
                    },
                    {
                        "name": "completion-query-items (100)",
                        "lines": 5
                    },
                    {
                        "name": "convert-meta (On)",
                        "lines": 4
                    },
                    {
                        "name": "disable-completion (Off)",
                        "lines": 2
                    },
                    {
                        "name": "echo-control-characters (On)",
                        "lines": 2
                    },
                    {
                        "name": "editing-mode (emacs)",
                        "lines": 2
                    },
                    {
                        "name": "emacs-mode-string (@)",
                        "lines": 6
                    },
                    {
                        "name": "enable-bracketed-paste (On)",
                        "lines": 4
                    },
                    {
                        "name": "enable-keypad (Off)",
                        "lines": 2
                    },
                    {
                        "name": "enable-meta-key (On)",
                        "lines": 3
                    },
                    {
                        "name": "expand-tilde (Off)",
                        "lines": 1
                    },
                    {
                        "name": "history-preserve-point (Off)",
                        "lines": 2
                    },
                    {
                        "name": "history-size (unset)",
                        "lines": 6
                    },
                    {
                        "name": "horizontal-scroll-mode (Off)",
                        "lines": 4
                    },
                    {
                        "name": "input-meta (Off)",
                        "lines": 4
                    },
                    {
                        "name": "isearch-terminators (``C-[C-J'')",
                        "lines": 3
                    },
                    {
                        "name": "keymap (emacs)",
                        "lines": 4
                    },
                    {
                        "name": "keyseq-timeout (500)",
                        "lines": 8
                    },
                    {
                        "name": "mark-directories (On)",
                        "lines": 1
                    },
                    {
                        "name": "mark-modified-lines (Off)",
                        "lines": 2
                    },
                    {
                        "name": "mark-symlinked-directories (Off)",
                        "lines": 2
                    },
                    {
                        "name": "match-hidden-files (On)",
                        "lines": 3
                    },
                    {
                        "name": "menu-complete-display-prefix (Off)",
                        "lines": 2
                    },
                    {
                        "name": "output-meta (Off)",
                        "lines": 3
                    },
                    {
                        "name": "page-completions (On)",
                        "lines": 2
                    },
                    {
                        "name": "print-completions-horizontally (Off)",
                        "lines": 2
                    },
                    {
                        "name": "revert-all-at-newline (Off)",
                        "lines": 3
                    },
                    {
                        "name": "show-all-if-ambiguous (Off)",
                        "lines": 3
                    },
                    {
                        "name": "show-all-if-unmodified (Off)",
                        "lines": 4
                    },
                    {
                        "name": "show-mode-in-prompt (Off)",
                        "lines": 3
                    },
                    {
                        "name": "skip-completed-text (Off)",
                        "lines": 5
                    },
                    {
                        "name": "vi-cmd-mode-string ((cmd))",
                        "lines": 6
                    },
                    {
                        "name": "vi-ins-mode-string ((ins))",
                        "lines": 6
                    },
                    {
                        "name": "visible-stats (Off)",
                        "lines": 3
                    },
                    {
                        "name": "Readline Conditional Constructs",
                        "lines": 56
                    },
                    {
                        "name": "$include",
                        "lines": 5
                    },
                    {
                        "name": "Searching",
                        "lines": 28
                    },
                    {
                        "name": "Readline Command Names",
                        "lines": 6
                    },
                    {
                        "name": "Commands for Moving",
                        "lines": 1
                    },
                    {
                        "name": "beginning-of-line (C-a)",
                        "lines": 1
                    },
                    {
                        "name": "end-of-line (C-e)",
                        "lines": 1
                    },
                    {
                        "name": "forward-char (C-f)",
                        "lines": 1
                    },
                    {
                        "name": "backward-char (C-b)",
                        "lines": 1
                    },
                    {
                        "name": "forward-word (M-f)",
                        "lines": 2
                    },
                    {
                        "name": "backward-word (M-b)",
                        "lines": 2
                    },
                    {
                        "name": "shell-forward-word",
                        "lines": 2
                    },
                    {
                        "name": "shell-backward-word",
                        "lines": 2
                    },
                    {
                        "name": "previous-screen-line",
                        "lines": 4
                    },
                    {
                        "name": "next-screen-line",
                        "lines": 4
                    },
                    {
                        "name": "clear-display (M-C-l)",
                        "lines": 2
                    },
                    {
                        "name": "clear-screen (C-l)",
                        "lines": 2
                    },
                    {
                        "name": "redraw-current-line",
                        "lines": 2
                    },
                    {
                        "name": "Commands for Manipulating the History",
                        "lines": 1
                    },
                    {
                        "name": "accept-line (Newline, Return)",
                        "lines": 3
                    },
                    {
                        "name": "previous-history (C-p)",
                        "lines": 1
                    },
                    {
                        "name": "next-history (C-n)",
                        "lines": 1
                    },
                    {
                        "name": "beginning-of-history (M-<)",
                        "lines": 1
                    },
                    {
                        "name": "end-of-history (M->)",
                        "lines": 1
                    },
                    {
                        "name": "reverse-search-history (C-r)",
                        "lines": 2
                    },
                    {
                        "name": "forward-search-history (C-s)",
                        "lines": 2
                    },
                    {
                        "name": "non-incremental-reverse-search-history (M-p)",
                        "lines": 2
                    },
                    {
                        "name": "non-incremental-forward-search-history (M-n)",
                        "lines": 2
                    },
                    {
                        "name": "history-search-forward",
                        "lines": 2
                    },
                    {
                        "name": "history-search-backward",
                        "lines": 2
                    },
                    {
                        "name": "history-substring-search-backward",
                        "lines": 3
                    },
                    {
                        "name": "history-substring-search-forward",
                        "lines": 3
                    },
                    {
                        "name": "yank-nth-arg (M-C-y)",
                        "lines": 14
                    },
                    {
                        "name": "shell-expand-line (M-C-e)",
                        "lines": 3
                    },
                    {
                        "name": "history-expand-line (M-^)",
                        "lines": 2
                    },
                    {
                        "name": "magic-space",
                        "lines": 2
                    },
                    {
                        "name": "alias-expand-line",
                        "lines": 2
                    },
                    {
                        "name": "history-and-alias-expand-line",
                        "lines": 3
                    },
                    {
                        "name": "operate-and-get-next (C-o)",
                        "lines": 3
                    },
                    {
                        "name": "edit-and-execute-command (C-x C-e)",
                        "lines": 4
                    },
                    {
                        "name": "Commands for Changing Text",
                        "lines": 4
                    },
                    {
                        "name": "delete-char (C-d)",
                        "lines": 2
                    },
                    {
                        "name": "backward-delete-char (Rubout)",
                        "lines": 2
                    },
                    {
                        "name": "forward-backward-delete-char",
                        "lines": 2
                    },
                    {
                        "name": "quoted-insert (C-q, C-v)",
                        "lines": 2
                    },
                    {
                        "name": "tab-insert (C-v TAB)",
                        "lines": 1
                    },
                    {
                        "name": "self-insert (a, b, A, 1, !, ...)",
                        "lines": 1
                    },
                    {
                        "name": "transpose-chars (C-t)",
                        "lines": 3
                    },
                    {
                        "name": "transpose-words (M-t)",
                        "lines": 3
                    },
                    {
                        "name": "upcase-word (M-u)",
                        "lines": 2
                    },
                    {
                        "name": "downcase-word (M-l)",
                        "lines": 2
                    },
                    {
                        "name": "capitalize-word (M-c)",
                        "lines": 2
                    },
                    {
                        "name": "overwrite-mode",
                        "lines": 8
                    },
                    {
                        "name": "Killing and Yanking",
                        "lines": 1
                    },
                    {
                        "name": "kill-line (C-k)",
                        "lines": 1
                    },
                    {
                        "name": "backward-kill-line (C-x Rubout)",
                        "lines": 1
                    },
                    {
                        "name": "unix-line-discard (C-u)",
                        "lines": 2
                    },
                    {
                        "name": "kill-whole-line",
                        "lines": 1
                    },
                    {
                        "name": "kill-word (M-d)",
                        "lines": 2
                    },
                    {
                        "name": "backward-kill-word (M-Rubout)",
                        "lines": 2
                    },
                    {
                        "name": "shell-kill-word",
                        "lines": 2
                    },
                    {
                        "name": "shell-backward-kill-word",
                        "lines": 2
                    },
                    {
                        "name": "unix-word-rubout (C-w)",
                        "lines": 2
                    },
                    {
                        "name": "unix-filename-rubout",
                        "lines": 2
                    },
                    {
                        "name": "delete-horizontal-space (M-\\)",
                        "lines": 1
                    },
                    {
                        "name": "kill-region",
                        "lines": 1
                    },
                    {
                        "name": "copy-region-as-kill",
                        "lines": 1
                    },
                    {
                        "name": "copy-backward-word",
                        "lines": 2
                    },
                    {
                        "name": "copy-forward-word",
                        "lines": 2
                    },
                    {
                        "name": "yank (C-y)",
                        "lines": 1
                    },
                    {
                        "name": "yank-pop (M-y)",
                        "lines": 2
                    },
                    {
                        "name": "Numeric Arguments",
                        "lines": 1
                    },
                    {
                        "name": "digit-argument (M-0, M-1, ..., M--)",
                        "lines": 2
                    },
                    {
                        "name": "universal-argument",
                        "lines": 9
                    },
                    {
                        "name": "Completing",
                        "lines": 1
                    },
                    {
                        "name": "complete (TAB)",
                        "lines": 5
                    },
                    {
                        "name": "possible-completions (M-?)",
                        "lines": 4
                    },
                    {
                        "name": "menu-complete",
                        "lines": 7
                    },
                    {
                        "name": "menu-complete-backward",
                        "lines": 3
                    },
                    {
                        "name": "delete-char-or-list",
                        "lines": 3
                    },
                    {
                        "name": "complete-filename (M-/)",
                        "lines": 1
                    },
                    {
                        "name": "possible-filename-completions (C-x /)",
                        "lines": 1
                    },
                    {
                        "name": "complete-username (M-~)",
                        "lines": 1
                    },
                    {
                        "name": "possible-username-completions (C-x ~)",
                        "lines": 1
                    },
                    {
                        "name": "complete-variable (M-$)",
                        "lines": 1
                    },
                    {
                        "name": "possible-variable-completions (C-x $)",
                        "lines": 2
                    },
                    {
                        "name": "complete-hostname (M-@)",
                        "lines": 1
                    },
                    {
                        "name": "possible-hostname-completions (C-x @)",
                        "lines": 1
                    },
                    {
                        "name": "complete-command (M-!)",
                        "lines": 3
                    },
                    {
                        "name": "possible-command-completions (C-x !)",
                        "lines": 1
                    },
                    {
                        "name": "dynamic-complete-history (M-TAB)",
                        "lines": 2
                    },
                    {
                        "name": "dabbrev-expand",
                        "lines": 2
                    },
                    {
                        "name": "complete-into-braces (M-{)",
                        "lines": 3
                    },
                    {
                        "name": "Keyboard Macros",
                        "lines": 1
                    },
                    {
                        "name": "start-kbd-macro (C-x ()",
                        "lines": 1
                    },
                    {
                        "name": "end-kbd-macro (C-x ))",
                        "lines": 2
                    },
                    {
                        "name": "call-last-kbd-macro (C-x e)",
                        "lines": 2
                    },
                    {
                        "name": "print-last-kbd-macro ()",
                        "lines": 2
                    },
                    {
                        "name": "Miscellaneous",
                        "lines": 1
                    },
                    {
                        "name": "re-read-init-file (C-x C-r)",
                        "lines": 2
                    },
                    {
                        "name": "abort (C-g)",
                        "lines": 6
                    },
                    {
                        "name": "prefix-meta (ESC)",
                        "lines": 3
                    },
                    {
                        "name": "revert-line (M-r)",
                        "lines": 2
                    },
                    {
                        "name": "tilde-expand (M-&)",
                        "lines": 1
                    },
                    {
                        "name": "set-mark (C-@, M-<space>)",
                        "lines": 2
                    },
                    {
                        "name": "exchange-point-and-mark (C-x C-x)",
                        "lines": 2
                    },
                    {
                        "name": "character-search (C-])",
                        "lines": 2
                    },
                    {
                        "name": "character-search-backward (M-C-])",
                        "lines": 2
                    },
                    {
                        "name": "skip-csi-sequence",
                        "lines": 6
                    },
                    {
                        "name": "insert-comment (M-#)",
                        "lines": 8
                    },
                    {
                        "name": "glob-complete-word (M-g)",
                        "lines": 7
                    },
                    {
                        "name": "glob-list-expansions (C-x g)",
                        "lines": 3
                    },
                    {
                        "name": "dump-functions",
                        "lines": 3
                    },
                    {
                        "name": "dump-variables",
                        "lines": 3
                    },
                    {
                        "name": "dump-macros",
                        "lines": 3
                    },
                    {
                        "name": "display-shell-version (C-x C-v)",
                        "lines": 2
                    },
                    {
                        "name": "Programmable Completion",
                        "lines": 105
                    }
                ]
            },
            {
                "name": "HISTORY",
                "lines": 39,
                "subsections": []
            },
            {
                "name": "HISTORY EXPANSION",
                "lines": 42,
                "subsections": [
                    {
                        "name": "Event Designators",
                        "lines": 21
                    },
                    {
                        "name": "Word Designators",
                        "lines": 6
                    },
                    {
                        "name": "0 (zero)",
                        "lines": 17
                    },
                    {
                        "name": "Modifiers",
                        "lines": 27
                    }
                ]
            },
            {
                "name": "SHELL BUILTIN COMMANDS",
                "lines": 460,
                "subsections": [
                    {
                        "name": "export -p",
                        "lines": 110
                    },
                    {
                        "name": "history -c",
                        "lines": 930
                    }
                ]
            },
            {
                "name": "SHELL COMPATIBILITY MODE",
                "lines": 36,
                "subsections": [
                    {
                        "name": "compat31",
                        "lines": 3
                    },
                    {
                        "name": "compat32",
                        "lines": 5
                    },
                    {
                        "name": "compat40",
                        "lines": 5
                    },
                    {
                        "name": "compat41",
                        "lines": 7
                    },
                    {
                        "name": "compat42",
                        "lines": 8
                    },
                    {
                        "name": "compat43",
                        "lines": 10
                    },
                    {
                        "name": "compat44",
                        "lines": 10
                    },
                    {
                        "name": "compat50",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "RESTRICTED SHELL",
                "lines": 40,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 17,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "BUG REPORTS",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 21,
                "subsections": []
            }
        ]
    }
}