commit bash-20170324 snapshot

This commit is contained in:
Chet Ramey
2017-03-28 11:32:59 -04:00
parent f698849a75
commit 124d67cde0
41 changed files with 9975 additions and 9249 deletions
+227 -165
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.3 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 4.4, 1 February 2017).
Bash shell (version 4.4, 22 March 2017).
This is Edition 4.4, last updated 1 February 2017, of 'The GNU Bash
This is Edition 4.4, last updated 22 March 2017, of 'The GNU Bash
Reference Manual', for 'Bash', Version 4.4.
Copyright (C) 1988-2017 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 4.4, 1 February 2017). The Bash home page is
Bash shell (version 4.4, 22 March 2017). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 4.4, last updated 1 February 2017, of 'The GNU Bash
This is Edition 4.4, last updated 22 March 2017, of 'The GNU Bash
Reference Manual', for 'Bash', Version 4.4.
Bash contains features that appear in other popular shells, and some
@@ -1210,7 +1210,47 @@ last command executed before the 'return'.
Variables local to the function may be declared with the 'local'
builtin. These variables are visible only to the function and the
commands it invokes.
commands it invokes. This is particularly important when a shell
function calls other functions.
Local variables "shadow" variables with the same name declared at
previous scopes. For instance, a local variable declared in a function
hides a global variable of the same name: references and assignments
refer to the local variable, leaving the global variable unmodified.
When the function returns, the global variable is once again visible.
The shell uses DYNAMIC SCOPING to control a variable's visibility
within functions. With dynamic scoping, visible variables and their
values are a result of the sequence of function calls that caused
execution to reach the current function. The value of a variable that a
function sees depends on its value within its caller, if any, whether
that caller is the "global" scope or another shell function. This is
also the value that a local variable declaration "shadows", and the
value that is restored when the function returns.
For example, if a variable VAR is declared as local in function
FUNC1, and FUNC1 calls another function FUNC2, references to VAR made
from within FUNC2 will resolve to the local variable VAR from FUNC1,
shadowing any global variable named VAR.
The following script demonstrates this behavior. When executed, the
script displays
In func2, var = func1 local
func1()
{
local var='func1 local'
func2
}
func2()
{
echo "In func2, var = $var"
}
var=global
func1
Function names and definitions may be listed with the '-f' option to
the 'declare' ('typeset') builtin command (*note Bash Builtins::). The
@@ -2354,12 +2394,11 @@ fashion.
A variant of here documents, the format is:
[N]<<< WORD
The WORD undergoes brace expansion, tilde expansion, parameter and
variable expansion, command substitution, arithmetic expansion, and
quote removal. Pathname expansion and word splitting are not performed.
The result is supplied as a single string, with a newline appended, to
the command on its standard input (or file descriptor N if N is
specified).
The WORD undergoes tilde expansion, parameter and variable expansion,
command substitution, arithmetic expansion, and quote removal. Pathname
expansion and word splitting are not performed. The result is supplied
as a single string, with a newline appended, to the command on its
standard input (or file descriptor N if N is specified).
3.6.8 Duplicating File Descriptors
----------------------------------
@@ -4687,7 +4726,8 @@ In some cases, Bash assigns a default value to the variable.
that are expanded before 'PS1' is displayed.
'PS2'
The secondary prompt string. The default value is '> '.
The secondary prompt string. The default value is '> '. 'PS2' is
expanded in the same way as 'PS1' before being displayed.

File: bashref.info, Node: Bash Variables, Prev: Bourne Shell Variables, Up: Shell Variables
@@ -5254,10 +5294,12 @@ Variables::).
with '#? '
'PS4'
The value is the prompt printed before the command line is echoed
when the '-x' option is set (*note The Set Builtin::). The first
character of 'PS4' is replicated multiple times, as necessary, to
indicate multiple levels of indirection. The default is '+ '.
The value of this parameter is expanded like PS1 and the expanded
value is the prompt printed before the command line is echoed when
the '-x' option is set (*note The Set Builtin::). The first
character of the expanded value is replicated multiple times, as
necessary, to indicate multiple levels of indirection. The default
is '+ '.
'PWD'
The current working directory as set by the 'cd' builtin.
@@ -5714,8 +5756,10 @@ several ways.
3. Bash expands and displays 'PS1' before reading the first line of a
command, and expands and displays 'PS2' before reading the second
and subsequent lines of a multi-line command. Bash displays 'PS0'
after it reads a command but before executing it.
and subsequent lines of a multi-line command. Bash expands and
displays 'PS0' after it reads a command but before executing it.
See *note Controlling the Prompt::, for a complete list of prompt
string escape sequences.
4. Bash executes the value of the 'PROMPT_COMMAND' variable as a
command before printing the primary prompt, '$PS1' (*note Bash
@@ -5920,7 +5964,9 @@ link itself.
arithmetic binary operators return true if ARG1 is equal to, not
equal to, less than, less than or equal to, greater than, or
greater than or equal to ARG2, respectively. ARG1 and ARG2 may be
positive or negative integers.
positive or negative integers. When used with the '[[' command,
ARG1 and ARG2 are evaluated as arithmetic expressions (*note Shell
Arithmetic::).

File: bashref.info, Node: Shell Arithmetic, Next: Aliases, Prev: Bash Conditional Expressions, Up: Bash Features
@@ -6281,7 +6327,7 @@ non-null value, then the value is executed just as if it had been typed
on the command line.
In addition, the following table describes the special characters
which can appear in the prompt variables 'PS1' to 'PS4':
which can appear in the prompt variables 'PS0', 'PS1', 'PS2', and 'PS4':
'\a'
A bell character.
@@ -7854,6 +7900,20 @@ File: bashref.info, Node: Commands For Moving, Next: Commands For History, Up
Move back to the start of the current or previous word. Words are
delimited by non-quoted shell metacharacters.
'previous-screen-line ()'
Attempt to move point to the same physical screen column on the
previous physical screen line. This will not have the desired
effect if the current Readline line does not take up more than one
physical line or if point is not greater than the length of the
prompt plus the screen width.
'next-screen-line ()'
Attempt to move point to the same physical screen column on the
next physical screen line. This will not have the desired effect
if the current Readline line does not take up more than one
physical line or if the length of the current Readline line is not
greater than the length of the prompt plus the screen width.
'clear-screen (C-l)'
Clear the screen and redraw the current line, leaving the current
line at the top of the screen.
@@ -9737,7 +9797,7 @@ unless the operating system does not provide the necessary support.
'--enable-prompt-string-decoding'
Turn on the interpretation of a number of backslash-escaped
characters in the '$PS1', '$PS2', '$PS3', and '$PS4' prompt
characters in the '$PS0', '$PS1', '$PS2', and '$PS4' prompt
strings. See *note Controlling the Prompt::, for a complete list
of prompt string escape sequences.
@@ -11019,17 +11079,17 @@ D.3 Parameter and Variable Index
(line 53)
* PS3: Bash Variables. (line 559)
* PS4: Bash Variables. (line 564)
* PWD: Bash Variables. (line 570)
* RANDOM: Bash Variables. (line 573)
* READLINE_LINE: Bash Variables. (line 578)
* READLINE_POINT: Bash Variables. (line 582)
* REPLY: Bash Variables. (line 586)
* PWD: Bash Variables. (line 572)
* RANDOM: Bash Variables. (line 575)
* READLINE_LINE: Bash Variables. (line 580)
* READLINE_POINT: Bash Variables. (line 584)
* REPLY: Bash Variables. (line 588)
* revert-all-at-newline: Readline Init File Syntax.
(line 270)
* SECONDS: Bash Variables. (line 589)
* SHELL: Bash Variables. (line 595)
* SHELLOPTS: Bash Variables. (line 600)
* SHLVL: Bash Variables. (line 609)
* SECONDS: Bash Variables. (line 591)
* SHELL: Bash Variables. (line 597)
* SHELLOPTS: Bash Variables. (line 602)
* SHLVL: Bash Variables. (line 611)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 276)
* show-all-if-unmodified: Readline Init File Syntax.
@@ -11040,10 +11100,10 @@ D.3 Parameter and Variable Index
(line 297)
* TEXTDOMAIN: Locale Translation. (line 11)
* TEXTDOMAINDIR: Locale Translation. (line 11)
* TIMEFORMAT: Bash Variables. (line 614)
* TMOUT: Bash Variables. (line 652)
* TMPDIR: Bash Variables. (line 664)
* UID: Bash Variables. (line 668)
* TIMEFORMAT: Bash Variables. (line 616)
* TMOUT: Bash Variables. (line 654)
* TMPDIR: Bash Variables. (line 666)
* UID: Bash Variables. (line 670)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 310)
* vi-ins-mode-string: Readline Init File Syntax.
@@ -11083,7 +11143,7 @@ D.4 Function Index
(line 42)
* character-search-backward (M-C-]): Miscellaneous Commands.
(line 47)
* clear-screen (C-l): Commands For Moving. (line 34)
* clear-screen (C-l): Commands For Moving. (line 48)
* complete (<TAB>): Commands For Completion.
(line 6)
* complete-command (M-!): Commands For Completion.
@@ -11179,6 +11239,7 @@ D.4 Function Index
(line 38)
* next-history (C-n): Commands For History.
(line 17)
* next-screen-line (): Commands For Moving. (line 41)
* non-incremental-forward-search-history (M-n): Commands For History.
(line 41)
* non-incremental-reverse-search-history (M-p): Commands For History.
@@ -11202,11 +11263,12 @@ D.4 Function Index
(line 19)
* previous-history (C-p): Commands For History.
(line 13)
* previous-screen-line (): Commands For Moving. (line 34)
* print-last-kbd-macro (): Keyboard Macros. (line 17)
* quoted-insert (C-q or C-v): Commands For Text. (line 26)
* re-read-init-file (C-x C-r): Miscellaneous Commands.
(line 6)
* redraw-current-line (): Commands For Moving. (line 38)
* redraw-current-line (): Commands For Moving. (line 52)
* reverse-search-history (C-r): Commands For History.
(line 27)
* revert-line (M-r): Miscellaneous Commands.
@@ -11410,134 +11472,134 @@ D.5 Concept Index

Tag Table:
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 Translation17834
Node: Comments18730
Node: Shell Commands19348
Node: Simple Commands20220
Node: Pipelines20851
Node: Lists23594
Node: Compound Commands25323
Node: Looping Constructs26326
Node: Conditional Constructs28789
Node: Command Grouping39711
Node: Coprocesses41190
Node: GNU Parallel43022
Node: Shell Functions46995
Node: Shell Parameters52201
Node: Positional Parameters56614
Node: Special Parameters57514
Node: Shell Expansions60851
Node: Brace Expansion62945
Node: Tilde Expansion65779
Node: Shell Parameter Expansion68127
Node: Command Substitution82259
Node: Arithmetic Expansion83614
Node: Process Substitution84546
Node: Word Splitting85666
Node: Filename Expansion87610
Node: Pattern Matching89984
Node: Quote Removal93970
Node: Redirections94265
Node: Executing Commands103839
Node: Simple Command Expansion104509
Node: Command Search and Execution106439
Node: Command Execution Environment108775
Node: Environment111759
Node: Exit Status113418
Node: Signals115088
Node: Shell Scripts117055
Node: Shell Builtin Commands119570
Node: Bourne Shell Builtins121604
Node: Bash Builtins142204
Node: Modifying Shell Behavior170849
Node: The Set Builtin171194
Node: The Shopt Builtin181607
Node: Special Builtins197505
Node: Shell Variables198484
Node: Bourne Shell Variables198921
Node: Bash Variables200952
Node: Bash Features230660
Node: Invoking Bash231559
Node: Bash Startup Files237508
Node: Interactive Shells242611
Node: What is an Interactive Shell?243021
Node: Is this Shell Interactive?243670
Node: Interactive Shell Behavior244485
Node: Bash Conditional Expressions247860
Node: Shell Arithmetic252100
Node: Aliases254917
Node: Arrays257465
Node: The Directory Stack262549
Node: Directory Stack Builtins263333
Node: Controlling the Prompt266301
Node: The Restricted Shell269047
Node: Bash POSIX Mode270872
Node: Job Control281223
Node: Job Control Basics281683
Node: Job Control Builtins286651
Node: Job Control Variables291378
Node: Command Line Editing292534
Node: Introduction and Notation294205
Node: Readline Interaction295828
Node: Readline Bare Essentials297019
Node: Readline Movement Commands298802
Node: Readline Killing Commands299762
Node: Readline Arguments301680
Node: Searching302724
Node: Readline Init File304910
Node: Readline Init File Syntax306057
Node: Conditional Init Constructs326244
Node: Sample Init File328769
Node: Bindable Readline Commands331886
Node: Commands For Moving333090
Node: Commands For History334233
Node: Commands For Text338528
Node: Commands For Killing341917
Node: Numeric Arguments344398
Node: Commands For Completion345537
Node: Keyboard Macros349728
Node: Miscellaneous Commands350415
Node: Readline vi Mode356291
Node: Programmable Completion357198
Node: Programmable Completion Builtins364659
Node: A Programmable Completion Example374545
Node: Using History Interactively379797
Node: Bash History Facilities380481
Node: Bash History Builtins383482
Node: History Interaction387774
Node: Event Designators390738
Node: Word Designators391957
Node: Modifiers393594
Node: Installing Bash394996
Node: Basic Installation396133
Node: Compilers and Options398824
Node: Compiling For Multiple Architectures399565
Node: Installation Names401228
Node: Specifying the System Type402046
Node: Sharing Defaults402762
Node: Operation Controls403435
Node: Optional Features404393
Node: Reporting Bugs414919
Node: Major Differences From The Bourne Shell416113
Node: GNU Free Documentation License432965
Node: Indexes458142
Node: Builtin Index458596
Node: Reserved Word Index465423
Node: Variable Index467871
Node: Function Index483549
Node: Concept Index496706
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 Translation17826
Node: Comments18722
Node: Shell Commands19340
Node: Simple Commands20212
Node: Pipelines20843
Node: Lists23586
Node: Compound Commands25315
Node: Looping Constructs26318
Node: Conditional Constructs28781
Node: Command Grouping39703
Node: Coprocesses41182
Node: GNU Parallel43014
Node: Shell Functions46987
Node: Shell Parameters53696
Node: Positional Parameters58109
Node: Special Parameters59009
Node: Shell Expansions62346
Node: Brace Expansion64440
Node: Tilde Expansion67274
Node: Shell Parameter Expansion69622
Node: Command Substitution83754
Node: Arithmetic Expansion85109
Node: Process Substitution86041
Node: Word Splitting87161
Node: Filename Expansion89105
Node: Pattern Matching91479
Node: Quote Removal95465
Node: Redirections95760
Node: Executing Commands105318
Node: Simple Command Expansion105988
Node: Command Search and Execution107918
Node: Command Execution Environment110254
Node: Environment113238
Node: Exit Status114897
Node: Signals116567
Node: Shell Scripts118534
Node: Shell Builtin Commands121049
Node: Bourne Shell Builtins123083
Node: Bash Builtins143683
Node: Modifying Shell Behavior172328
Node: The Set Builtin172673
Node: The Shopt Builtin183086
Node: Special Builtins198984
Node: Shell Variables199963
Node: Bourne Shell Variables200400
Node: Bash Variables202504
Node: Bash Features232297
Node: Invoking Bash233196
Node: Bash Startup Files239145
Node: Interactive Shells244248
Node: What is an Interactive Shell?244658
Node: Is this Shell Interactive?245307
Node: Interactive Shell Behavior246122
Node: Bash Conditional Expressions249610
Node: Shell Arithmetic253976
Node: Aliases256793
Node: Arrays259341
Node: The Directory Stack264425
Node: Directory Stack Builtins265209
Node: Controlling the Prompt268177
Node: The Restricted Shell270939
Node: Bash POSIX Mode272764
Node: Job Control283115
Node: Job Control Basics283575
Node: Job Control Builtins288543
Node: Job Control Variables293270
Node: Command Line Editing294426
Node: Introduction and Notation296097
Node: Readline Interaction297720
Node: Readline Bare Essentials298911
Node: Readline Movement Commands300694
Node: Readline Killing Commands301654
Node: Readline Arguments303572
Node: Searching304616
Node: Readline Init File306802
Node: Readline Init File Syntax307949
Node: Conditional Init Constructs328136
Node: Sample Init File330661
Node: Bindable Readline Commands333778
Node: Commands For Moving334982
Node: Commands For History336831
Node: Commands For Text341126
Node: Commands For Killing344515
Node: Numeric Arguments346996
Node: Commands For Completion348135
Node: Keyboard Macros352326
Node: Miscellaneous Commands353013
Node: Readline vi Mode358889
Node: Programmable Completion359796
Node: Programmable Completion Builtins367257
Node: A Programmable Completion Example377143
Node: Using History Interactively382395
Node: Bash History Facilities383079
Node: Bash History Builtins386080
Node: History Interaction390372
Node: Event Designators393336
Node: Word Designators394555
Node: Modifiers396192
Node: Installing Bash397594
Node: Basic Installation398731
Node: Compilers and Options401422
Node: Compiling For Multiple Architectures402163
Node: Installation Names403826
Node: Specifying the System Type404644
Node: Sharing Defaults405360
Node: Operation Controls406033
Node: Optional Features406991
Node: Reporting Bugs417517
Node: Major Differences From The Bourne Shell418711
Node: GNU Free Documentation License435563
Node: Indexes460740
Node: Builtin Index461194
Node: Reserved Word Index468021
Node: Variable Index470469
Node: Function Index486147
Node: Concept Index499450

End Tag Table