diff options
Diffstat (limited to 'doc/bashref.info')
| -rw-r--r-- | doc/bashref.info | 414 |
1 files changed, 225 insertions, 189 deletions
diff --git a/doc/bashref.info b/doc/bashref.info index 866163df..b8c9993f 100644 --- a/doc/bashref.info +++ b/doc/bashref.info @@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.5 from bashref.texi. This text is a brief description of the features that are present in the -Bash shell (version 5.0, 7 August 2018). +Bash shell (version 5.0, 9 November 2018). - This is Edition 5.0, last updated 7 August 2018, of 'The GNU Bash + This is Edition 5.0, last updated 9 November 2018, of 'The GNU Bash Reference Manual', for 'Bash', Version 5.0. Copyright (C) 1988-2018 Free Software Foundation, Inc. @@ -27,10 +27,10 @@ Bash Features ************* This text is a brief description of the features that are present in the -Bash shell (version 5.0, 7 August 2018). The Bash home page is +Bash shell (version 5.0, 9 November 2018). The Bash home page is <http://www.gnu.org/software/bash/>. - This is Edition 5.0, last updated 7 August 2018, of 'The GNU Bash + This is Edition 5.0, last updated 9 November 2018, of 'The GNU Bash Reference Manual', for 'Bash', Version 5.0. Bash contains features that appear in other popular shells, and some @@ -1468,10 +1468,11 @@ only be referenced; assignment to them is not allowed. ($_, an underscore.) At shell startup, set to the absolute pathname used to invoke the shell or shell script being executed as passed in the environment or argument list. Subsequently, expands - to the last argument to the previous command, after expansion. - Also set to the full pathname used to invoke each command executed - and placed in the environment exported to that command. When - checking mail, this parameter holds the name of the mail file. + to the last argument to the previous simple command executed in the + foreground, after expansion. Also set to the full pathname used to + invoke each command executed and placed in the environment exported + to that command. When checking mail, this parameter holds the name + of the mail file. File: bashref.info, Node: Shell Expansions, Next: Redirections, Prev: Shell Parameters, Up: Basic Shell Features @@ -3201,17 +3202,21 @@ standard. the expression is false. 3 arguments - The following conditions are applied in the order listed. If - the second argument is one of the binary conditional operators - (*note Bash Conditional Expressions::), the result of the - expression is the result of the binary test using the first - and third arguments as operands. The '-a' and '-o' operators - are considered binary operators when there are three - arguments. If the first argument is '!', the value is the - negation of the two-argument test using the second and third - arguments. If the first argument is exactly '(' and the third - argument is exactly ')', the result is the one-argument test - of the second argument. Otherwise, the expression is false. + The following conditions are applied in the order listed. + + 1. If the second argument is one of the binary conditional + operators (*note Bash Conditional Expressions::), the + result of the expression is the result of the binary test + using the first and third arguments as operands. The + '-a' and '-o' operators are considered binary operators + when there are three arguments. + 2. If the first argument is '!', the value is the negation + of the two-argument test using the second and third + arguments. + 3. If the first argument is exactly '(' and the third + argument is exactly ')', the result is the one-argument + test of the second argument. + 4. Otherwise, the expression is false. 4 arguments If the first argument is '!', the result is the negation of @@ -3842,8 +3847,8 @@ standard. '-r' If this option is given, backslash does not act as an escape character. The backslash is considered to be part of the - line. In particular, a backslash-newline pair may not be used - as a line continuation. + line. In particular, a backslash-newline pair may not then be + used as a line continuation. '-s' Silent mode. If input is coming from a terminal, characters @@ -4406,7 +4411,7 @@ This builtin allows you to change additional shell optional behavior. 'checkwinsize' If set, Bash checks the window size after each external (non-builtin) command and, if necessary, updates the values of - 'LINES' and 'COLUMNS'. + 'LINES' and 'COLUMNS'. This option is enabled by default. 'cmdhist' If set, Bash attempts to save all lines of a multiple-line @@ -4631,6 +4636,13 @@ This builtin allows you to change additional shell optional behavior. before any new value is assigned. The NAMEREF attribute is not inherited. + 'localvar_unset' + If set, calling 'unset' on local variables in previous + function scopes marks them so subsequent lookups find them + unset until that function returns. This is identical to the + behavior of unsetting local variables at the current function + scope. + 'login_shell' The shell sets this option if it is started as a login shell (*note Invoking Bash::). The value may not be changed. @@ -4665,6 +4677,13 @@ This builtin allows you to change additional shell optional behavior. Programmable Completion::) are enabled. This option is enabled by default. + 'progcomp_alias' + If set, and programmable completion is enabled, Bash treats a + command name that doesn't have any completions as a possible + alias and attempts alias expansion. If it has an alias, Bash + attempts programmable completion using the command word + resulting from the expanded alias. + 'promptvars' If set, prompt strings undergo parameter expansion, command substitution, arithmetic expansion, and quote removal after @@ -5912,18 +5931,21 @@ File: bashref.info, Node: Bash Conditional Expressions, Next: Shell Arithmetic ================================ Conditional expressions are used by the '[[' compound command and the -'test' and '[' builtin commands. - - Expressions may be unary or binary. Unary expressions are often used -to examine the status of a file. There are string operators and numeric -comparison operators as well. Bash handles several filenames specially -when they are used in expressions. If the operating system on which -Bash is running provides these special files, Bash will use them; -otherwise it will emulate them internally with this behavior: If the -FILE argument to one of the primaries is of the form '/dev/fd/N', then -file descriptor N is checked. If the FILE argument to one of the -primaries is one of '/dev/stdin', '/dev/stdout', or '/dev/stderr', file -descriptor 0, 1, or 2, respectively, is checked. +'test' and '[' builtin commands. The 'test' and '[' commands determine +their behavior based on the number of arguments; see the descriptions of +those commands for any other command-specific actions. + + Expressions may be unary or binary, and are formed from the following +primaries. Unary expressions are often used to examine the status of a +file. There are string operators and numeric comparison operators as +well. Bash handles several filenames specially when they are used in +expressions. If the operating system on which Bash is running provides +these special files, Bash will use them; otherwise it will emulate them +internally with this behavior: If the FILE argument to one of the +primaries is of the form '/dev/fd/N', then file descriptor N is checked. +If the FILE argument to one of the primaries is one of '/dev/stdin', +'/dev/stdout', or '/dev/stderr', file descriptor 0, 1, or 2, +respectively, is checked. When used with '[[', the '<' and '>' operators sort lexicographically using the current locale. The 'test' command uses ASCII ordering. @@ -6183,9 +6205,10 @@ the 'expand_aliases' shell option is set using 'shopt' (*note The Shopt Builtin::). The rules concerning the definition and use of aliases are somewhat -confusing. Bash always reads at least one complete line of input before -executing any of the commands on that line. Aliases are expanded when a -command is read, not when it is executed. Therefore, an alias +confusing. Bash always reads at least one complete line of input, and +all lines that make up a compound command, before executing any of the +commands on that line or the compound command. Aliases are expanded +when a command is read, not when it is executed. Therefore, an alias definition appearing on the same line as another command does not take effect until the next line of input is read. The commands following the alias definition on that line are not affected by the new alias. This @@ -6703,56 +6726,66 @@ startup files. shell. When the 'inherit_errexit' option is not enabled, Bash clears the '-e' option in such subshells. - 44. When the 'alias' builtin displays alias definitions, it does not + 44. Enabling POSIX mode has the effect of setting the 'shift_verbose' + option, so numeric arguments to 'shift' that exceed the number of + positional parameters will result in an error message. + + 45. When the 'alias' builtin displays alias definitions, it does not display them with a leading 'alias ' unless the '-p' option is supplied. - 45. When the 'set' builtin is invoked without options, it does not + 46. When the 'set' builtin is invoked without options, it does not display shell function names and definitions. - 46. When the 'set' builtin is invoked without options, it displays + 47. When the 'set' builtin is invoked without options, it displays variable values without quotes, unless they contain shell metacharacters, even if the result contains nonprinting characters. - 47. When the 'cd' builtin is invoked in LOGICAL mode, and the pathname + 48. When the 'cd' builtin is invoked in LOGICAL mode, and the pathname constructed from '$PWD' and the directory name supplied as an argument does not refer to an existing directory, 'cd' will fail instead of falling back to PHYSICAL mode. - 48. The 'pwd' builtin verifies that the value it prints is the same as + 49. When the 'cd' builtin cannot change a directory because the length + of the pathname constructed from '$PWD' and the directory name + supplied as an argument exceeds PATH_MAX when all symbolic links + are expanded, 'cd' will fail instead of attempting to use only the + supplied directory name. + + 50. The 'pwd' builtin verifies that the value it prints is the same as the current directory, even if it is not asked to check the file system with the '-P' option. - 49. When listing the history, the 'fc' builtin does not include an + 51. When listing the history, the 'fc' builtin does not include an indication of whether or not a history entry has been modified. - 50. The default editor used by 'fc' is 'ed'. + 52. The default editor used by 'fc' is 'ed'. - 51. The 'type' and 'command' builtins will not report a non-executable + 53. The 'type' and 'command' builtins will not report a non-executable file as having been found, though the shell will attempt to execute such a file if it is the only so-named file found in '$PATH'. - 52. The 'vi' editing mode will invoke the 'vi' editor directly when + 54. The 'vi' editing mode will invoke the 'vi' editor directly when the 'v' command is run, instead of checking '$VISUAL' and '$EDITOR'. - 53. When the 'xpg_echo' option is enabled, Bash does not attempt to + 55. When the 'xpg_echo' option is enabled, Bash does not attempt to interpret any arguments to 'echo' as options. Each argument is displayed, after escape characters are converted. - 54. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' + 56. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' and '-f' options. - 55. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not + 57. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not interrupt the 'wait' builtin and cause it to return immediately. The trap command is run once for each child that exits. - 56. The 'read' builtin may be interrupted by a signal for which a trap + 58. The 'read' builtin may be interrupted by a signal for which a trap has been set. If Bash receives a trapped signal while executing 'read', the trap handler executes and 'read' returns an exit status greater than 128. - 57. Bash removes an exited background process's status from the list + 59. Bash removes an exited background process's status from the list of such statuses after the 'wait' builtin is used to obtain it. There is other POSIX behavior that Bash does not implement by default @@ -7525,13 +7558,13 @@ Variable Settings 'keymap' Sets Readline's idea of the current keymap for key binding - commands. Acceptable 'keymap' names are 'emacs', + commands. Built-in 'keymap' names are 'emacs', 'emacs-standard', 'emacs-meta', 'emacs-ctlx', 'vi', 'vi-move', 'vi-command', and 'vi-insert'. 'vi' is equivalent to 'vi-command' ('vi-move' is also a synonym); 'emacs' is - equivalent to 'emacs-standard'. The default value is 'emacs'. - The value of the 'editing-mode' variable also affects the - default keymap. + equivalent to 'emacs-standard'. Applications may add + additional names. The default value is 'emacs'. The value of + the 'editing-mode' variable also affects the default keymap. 'keyseq-timeout' Specifies the duration Readline will wait for a character when @@ -8626,7 +8659,10 @@ command word is a full pathname, a compspec for the full pathname is searched for first. If no compspec is found for the full pathname, an attempt is made to find a compspec for the portion following the final slash. If those searches do not result in a compspec, any compspec -defined with the '-D' option to 'complete' is used as the default. +defined with the '-D' option to 'complete' is used as the default. If +there is no default compspec, Bash attempts alias expansion on the +command word as a final resort, and attempts to find a compspec for the +command word from any successful expansion Once a compspec has been found, it is used to generate the list of matching words. If a compspec is not found, the default Bash completion @@ -11000,17 +11036,17 @@ D.1 Index of Shell Builtin Commands * test: Bourne Shell Builtins. (line 269) * times: Bourne Shell Builtins. - (line 344) + (line 348) * trap: Bourne Shell Builtins. - (line 350) + (line 354) * type: Bash Builtins. (line 567) * typeset: Bash Builtins. (line 599) * ulimit: Bash Builtins. (line 605) * umask: Bourne Shell Builtins. - (line 399) + (line 403) * unalias: Bash Builtins. (line 704) * unset: Bourne Shell Builtins. - (line 417) + (line 421) * wait: Job Control Builtins. (line 76) @@ -11644,134 +11680,134 @@ D.5 Concept Index Tag Table: -Node: Top891 -Node: Introduction2805 -Node: What is Bash?3021 -Node: What is a shell?4135 -Node: Definitions6673 -Node: Basic Shell Features9624 -Node: Shell Syntax10843 -Node: Shell Operation11869 -Node: Quoting13162 -Node: Escape Character14462 -Node: Single Quotes14947 -Node: Double Quotes15295 -Node: ANSI-C Quoting16573 -Node: Locale Translation17832 -Node: Comments18728 -Node: Shell Commands19346 -Node: Simple Commands20218 -Node: Pipelines20849 -Node: Lists23781 -Node: Compound Commands25520 -Node: Looping Constructs26532 -Node: Conditional Constructs29027 -Node: Command Grouping40110 -Node: Coprocesses41589 -Node: GNU Parallel43492 -Node: Shell Functions47550 -Node: Shell Parameters54633 -Node: Positional Parameters59046 -Node: Special Parameters59946 -Node: Shell Expansions63660 -Node: Brace Expansion65783 -Node: Tilde Expansion68507 -Node: Shell Parameter Expansion71124 -Node: Command Substitution85580 -Node: Arithmetic Expansion86935 -Node: Process Substitution87867 -Node: Word Splitting88987 -Node: Filename Expansion90931 -Node: Pattern Matching93461 -Node: Quote Removal97447 -Node: Redirections97742 -Node: Executing Commands107300 -Node: Simple Command Expansion107970 -Node: Command Search and Execution109900 -Node: Command Execution Environment112276 -Node: Environment115260 -Node: Exit Status116919 -Node: Signals118589 -Node: Shell Scripts120556 -Node: Shell Builtin Commands123071 -Node: Bourne Shell Builtins125109 -Node: Bash Builtins145767 -Node: Modifying Shell Behavior174675 -Node: The Set Builtin175020 -Node: The Shopt Builtin185433 -Node: Special Builtins202303 -Node: Shell Variables203282 -Node: Bourne Shell Variables203719 -Node: Bash Variables205823 -Node: Bash Features236283 -Node: Invoking Bash237182 -Node: Bash Startup Files243195 -Node: Interactive Shells248298 -Node: What is an Interactive Shell?248708 -Node: Is this Shell Interactive?249357 -Node: Interactive Shell Behavior250172 -Node: Bash Conditional Expressions253659 -Node: Shell Arithmetic258025 -Node: Aliases260842 -Node: Arrays263390 -Node: The Directory Stack268756 -Node: Directory Stack Builtins269540 -Node: Controlling the Prompt272508 -Node: The Restricted Shell275274 -Node: Bash POSIX Mode277099 -Node: Job Control287514 -Node: Job Control Basics287974 -Node: Job Control Builtins292942 -Node: Job Control Variables297669 -Node: Command Line Editing298825 -Node: Introduction and Notation300496 -Node: Readline Interaction302119 -Node: Readline Bare Essentials303310 -Node: Readline Movement Commands305093 -Node: Readline Killing Commands306053 -Node: Readline Arguments307971 -Node: Searching309015 -Node: Readline Init File311201 -Node: Readline Init File Syntax312348 -Node: Conditional Init Constructs332748 -Node: Sample Init File336944 -Node: Bindable Readline Commands340061 -Node: Commands For Moving341265 -Node: Commands For History343114 -Node: Commands For Text347409 -Node: Commands For Killing350797 -Node: Numeric Arguments353278 -Node: Commands For Completion354417 -Node: Keyboard Macros358608 -Node: Miscellaneous Commands359295 -Node: Readline vi Mode365248 -Node: Programmable Completion366155 -Node: Programmable Completion Builtins373749 -Node: A Programmable Completion Example384442 -Node: Using History Interactively389682 -Node: Bash History Facilities390366 -Node: Bash History Builtins393371 -Node: History Interaction397902 -Node: Event Designators401522 -Node: Word Designators402741 -Node: Modifiers404378 -Node: Installing Bash405780 -Node: Basic Installation406917 -Node: Compilers and Options410175 -Node: Compiling For Multiple Architectures410916 -Node: Installation Names412609 -Node: Specifying the System Type413427 -Node: Sharing Defaults414143 -Node: Operation Controls414816 -Node: Optional Features415774 -Node: Reporting Bugs426292 -Node: Major Differences From The Bourne Shell427486 -Node: GNU Free Documentation License444338 -Node: Indexes469515 -Node: Builtin Index469969 -Node: Reserved Word Index476796 -Node: Variable Index479244 -Node: Function Index494995 -Node: Concept Index508298 +Node: Top895 +Node: Introduction2813 +Node: What is Bash?3029 +Node: What is a shell?4143 +Node: Definitions6681 +Node: Basic Shell Features9632 +Node: Shell Syntax10851 +Node: Shell Operation11877 +Node: Quoting13170 +Node: Escape Character14470 +Node: Single Quotes14955 +Node: Double Quotes15303 +Node: ANSI-C Quoting16581 +Node: Locale Translation17840 +Node: Comments18736 +Node: Shell Commands19354 +Node: Simple Commands20226 +Node: Pipelines20857 +Node: Lists23789 +Node: Compound Commands25528 +Node: Looping Constructs26540 +Node: Conditional Constructs29035 +Node: Command Grouping40118 +Node: Coprocesses41597 +Node: GNU Parallel43500 +Node: Shell Functions47558 +Node: Shell Parameters54641 +Node: Positional Parameters59054 +Node: Special Parameters59954 +Node: Shell Expansions63708 +Node: Brace Expansion65831 +Node: Tilde Expansion68555 +Node: Shell Parameter Expansion71172 +Node: Command Substitution85628 +Node: Arithmetic Expansion86983 +Node: Process Substitution87915 +Node: Word Splitting89035 +Node: Filename Expansion90979 +Node: Pattern Matching93509 +Node: Quote Removal97495 +Node: Redirections97790 +Node: Executing Commands107348 +Node: Simple Command Expansion108018 +Node: Command Search and Execution109948 +Node: Command Execution Environment112324 +Node: Environment115308 +Node: Exit Status116967 +Node: Signals118637 +Node: Shell Scripts120604 +Node: Shell Builtin Commands123119 +Node: Bourne Shell Builtins125157 +Node: Bash Builtins145907 +Node: Modifying Shell Behavior174820 +Node: The Set Builtin175165 +Node: The Shopt Builtin185578 +Node: Special Builtins203150 +Node: Shell Variables204129 +Node: Bourne Shell Variables204566 +Node: Bash Variables206670 +Node: Bash Features237130 +Node: Invoking Bash238029 +Node: Bash Startup Files244042 +Node: Interactive Shells249145 +Node: What is an Interactive Shell?249555 +Node: Is this Shell Interactive?250204 +Node: Interactive Shell Behavior251019 +Node: Bash Conditional Expressions254506 +Node: Shell Arithmetic259083 +Node: Aliases261900 +Node: Arrays264520 +Node: The Directory Stack269886 +Node: Directory Stack Builtins270670 +Node: Controlling the Prompt273638 +Node: The Restricted Shell276404 +Node: Bash POSIX Mode278229 +Node: Job Control289162 +Node: Job Control Basics289622 +Node: Job Control Builtins294590 +Node: Job Control Variables299317 +Node: Command Line Editing300473 +Node: Introduction and Notation302144 +Node: Readline Interaction303767 +Node: Readline Bare Essentials304958 +Node: Readline Movement Commands306741 +Node: Readline Killing Commands307701 +Node: Readline Arguments309619 +Node: Searching310663 +Node: Readline Init File312849 +Node: Readline Init File Syntax313996 +Node: Conditional Init Constructs334435 +Node: Sample Init File338631 +Node: Bindable Readline Commands341748 +Node: Commands For Moving342952 +Node: Commands For History344801 +Node: Commands For Text349096 +Node: Commands For Killing352484 +Node: Numeric Arguments354965 +Node: Commands For Completion356104 +Node: Keyboard Macros360295 +Node: Miscellaneous Commands360982 +Node: Readline vi Mode366935 +Node: Programmable Completion367842 +Node: Programmable Completion Builtins375622 +Node: A Programmable Completion Example386315 +Node: Using History Interactively391555 +Node: Bash History Facilities392239 +Node: Bash History Builtins395244 +Node: History Interaction399775 +Node: Event Designators403395 +Node: Word Designators404614 +Node: Modifiers406251 +Node: Installing Bash407653 +Node: Basic Installation408790 +Node: Compilers and Options412048 +Node: Compiling For Multiple Architectures412789 +Node: Installation Names414482 +Node: Specifying the System Type415300 +Node: Sharing Defaults416016 +Node: Operation Controls416689 +Node: Optional Features417647 +Node: Reporting Bugs428165 +Node: Major Differences From The Bourne Shell429359 +Node: GNU Free Documentation License446211 +Node: Indexes471388 +Node: Builtin Index471842 +Node: Reserved Word Index478669 +Node: Variable Index481117 +Node: Function Index496868 +Node: Concept Index510171 End Tag Table |
