commit bash-20160715 snapshot

This commit is contained in:
Chet Ramey
2016-07-23 10:04:54 -04:00
parent 6df81145a8
commit 7fa3190622
26 changed files with 4227 additions and 4031 deletions
+62
View File
@@ -11342,3 +11342,65 @@ bashline.c
- check_redir: make sure that index is > 0 before checking previous
char; fixes out of bounds read reported by Hanno Böck
<hanno@hboeck.de>
7/16
----
subst.c
- parameter_brace_expand: if ${array[@]} or ${array[*]} is supplied
with an unset (or empty) array, and -u is enabled, don't make it
an unbound variable error, like $@ or $* when there are no
positional parameters. Based on report from Ian Allen
<idallen@idallen-fibe.dyndns.org>
lib/readline/signals.c
- rl_pending_signal(): return the number of any signal readline has
caught but is waiting to handle
lib/readline/callback.c
- rl_persistent_signal_handlers: new variable, restores readline-6.2
signal handler semantics: installed at rl_callback_handler_install
time and removed with rl_clear_signals when a complete line has
been read
- _rl_callback_newline: call rl_set_signals if rl_persistent_signal_handlers
is non-zero
- rl_callback_read_char: install signal handlers with rl_set_signals
if rl_persistent_signal_handlers is 0 (the default)
- CALLBACK_READ_RETURN: uninstall signal handlers with rl_clear_signals
only if rl_persistent_signal_handlers is 0 (the default)
lib/readline/readline.h
- rl_pending_signal: new extern declaration
- rl_persistent_signal_handlers: new extern declaration
7/19
----
execute_cmd.c
- execute_while_or_until: make sure we decrement `continuing' the way
we decrement `breaking' if the loop test indicates we will be
breaking out of the loop. That keeps `until continue' from
keeping `continuing' set to 1. Reported by Dan Douglas
<ormaaj@gmail.com>
7/20
----
trap.c
- run_pending_traps,_run_trap_internal: save and restore temporary_env,
set temporary_env to 0 before trap runs so traps don't inherit a
command's temporary env. Fixes bug with IFS assignment in tempenv
and trap reported by Andriy Martynets <martynets@volia.ua>
jobs.c
- run_sigchld_trap: save and restore temporary_env, set temporary_env
to 0 before trap runs so traps don't inherit a command's temporary
env (see above)
7/21
----
execute_cmd.c
- execute_function: unwind-protect function_line_number, in case we
are executing a function inside another function. Reported by
Grisha Levit <grishalevit@gmail.com> in context of evaled functions
and DEBUG traps
- execute_arith_for_command,execute_arith_command,execute_simple_command,
execute_cond_command: make sure line_number doesn't go < 0 when
adjusting it by function_line_number
+393 -389
View File
File diff suppressed because it is too large Load Diff
+7 -2
View File
@@ -2288,7 +2288,9 @@ Example:
\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":~/shell\-mail?"$_ has mail!"\(aq
.PP
.B Bash
supplies a default value for this variable, but the location of the user
can be configured to supply
a default value for this variable (there is no value by default),
but the location of the user
mail files that it uses is system dependent (e.g., /var/mail/\fB$USER\fP).
.RE
.TP
@@ -3724,7 +3726,10 @@ before the standard output was redirected to
.IR dirlist .
.PP
\fBBash\fP handles several filenames specially when they are used in
redirections, as described in the following table:
redirections, as described in the following table.
If the operating system on which \fBbash\fP is running provides these
special files, bash will use them; otherwise it will emulate them
internally with the behavior described below.
.RS
.PP
.PD 0
+8 -3
View File
@@ -2908,7 +2908,9 @@ Example:
<B>Bash</B>
supplies a default value for this variable, but the location of the user
can be configured to supply
a default value for this variable (there is no value by default),
but the location of the user
mail files that it uses is system dependent (e.g., /var/mail/<B>$USER</B>).
</DL>
@@ -4709,7 +4711,10 @@ before the standard output was redirected to
<P>
<B>Bash</B> handles several filenames specially when they are used in
redirections, as described in the following table:
redirections, as described in the following table.
If the operating system on which <B>bash</B> is running provides these
special files, bash will use them; otherwise it will emulate them
internally with the behavior described below.
<DL COMPACT><DT><DD>
<P>
@@ -13620,6 +13625,6 @@ There may be only one active coprocess at a time.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 20 June 2016 15:38:21 EDT
Time: 14 July 2016 11:48:02 EDT
</BODY>
</HTML>
+92 -89
View File
@@ -2201,7 +2201,10 @@ error was made a copy of the standard output before the standard output
was redirected to DIRLIST.
Bash handles several filenames specially when they are used in
redirections, as described in the following table:
redirections, as described in the following table. If the operating
system on which Bash is running provides these special files, bash will
use them; otherwise it will emulate them internally with the behavior
described below.
'/dev/fd/FD'
If FD is a valid integer, file descriptor FD is duplicated.
@@ -11375,93 +11378,93 @@ Node: Filename Expansion87384
Node: Pattern Matching89668
Node: Quote Removal93366
Node: Redirections93661
Node: Executing Commands102904
Node: Simple Command Expansion103574
Node: Command Search and Execution105504
Node: Command Execution Environment107840
Node: Environment110824
Node: Exit Status112483
Node: Signals114153
Node: Shell Scripts116120
Node: Shell Builtin Commands118635
Node: Bourne Shell Builtins120669
Node: Bash Builtins141269
Node: Modifying Shell Behavior169914
Node: The Set Builtin170259
Node: The Shopt Builtin180672
Node: Special Builtins196471
Node: Shell Variables197450
Node: Bourne Shell Variables197887
Node: Bash Variables199918
Node: Bash Features228298
Node: Invoking Bash229197
Node: Bash Startup Files235146
Node: Interactive Shells240249
Node: What is an Interactive Shell?240659
Node: Is this Shell Interactive?241308
Node: Interactive Shell Behavior242123
Node: Bash Conditional Expressions245498
Node: Shell Arithmetic249499
Node: Aliases252316
Node: Arrays254864
Node: The Directory Stack259948
Node: Directory Stack Builtins260732
Node: Controlling the Prompt263700
Node: The Restricted Shell266446
Node: Bash POSIX Mode268271
Node: Job Control278324
Node: Job Control Basics278784
Node: Job Control Builtins283503
Node: Job Control Variables288033
Node: Command Line Editing289189
Node: Introduction and Notation290860
Node: Readline Interaction292483
Node: Readline Bare Essentials293674
Node: Readline Movement Commands295457
Node: Readline Killing Commands296417
Node: Readline Arguments298335
Node: Searching299379
Node: Readline Init File301565
Node: Readline Init File Syntax302712
Node: Conditional Init Constructs322899
Node: Sample Init File325424
Node: Bindable Readline Commands328541
Node: Commands For Moving329745
Node: Commands For History330888
Node: Commands For Text335177
Node: Commands For Killing338566
Node: Numeric Arguments341047
Node: Commands For Completion342186
Node: Keyboard Macros346377
Node: Miscellaneous Commands347064
Node: Readline vi Mode352868
Node: Programmable Completion353775
Node: Programmable Completion Builtins361236
Node: A Programmable Completion Example371122
Node: Using History Interactively376374
Node: Bash History Facilities377058
Node: Bash History Builtins380059
Node: History Interaction384056
Node: Event Designators387020
Node: Word Designators388239
Node: Modifiers389876
Node: Installing Bash391278
Node: Basic Installation392415
Node: Compilers and Options395106
Node: Compiling For Multiple Architectures395847
Node: Installation Names397510
Node: Specifying the System Type398328
Node: Sharing Defaults399044
Node: Operation Controls399717
Node: Optional Features400675
Node: Reporting Bugs410932
Node: Major Differences From The Bourne Shell412126
Node: GNU Free Documentation License428978
Node: Indexes454155
Node: Builtin Index454609
Node: Reserved Word Index461436
Node: Variable Index463884
Node: Function Index479343
Node: Concept Index492500
Node: Executing Commands103081
Node: Simple Command Expansion103751
Node: Command Search and Execution105681
Node: Command Execution Environment108017
Node: Environment111001
Node: Exit Status112660
Node: Signals114330
Node: Shell Scripts116297
Node: Shell Builtin Commands118812
Node: Bourne Shell Builtins120846
Node: Bash Builtins141446
Node: Modifying Shell Behavior170091
Node: The Set Builtin170436
Node: The Shopt Builtin180849
Node: Special Builtins196648
Node: Shell Variables197627
Node: Bourne Shell Variables198064
Node: Bash Variables200095
Node: Bash Features228475
Node: Invoking Bash229374
Node: Bash Startup Files235323
Node: Interactive Shells240426
Node: What is an Interactive Shell?240836
Node: Is this Shell Interactive?241485
Node: Interactive Shell Behavior242300
Node: Bash Conditional Expressions245675
Node: Shell Arithmetic249676
Node: Aliases252493
Node: Arrays255041
Node: The Directory Stack260125
Node: Directory Stack Builtins260909
Node: Controlling the Prompt263877
Node: The Restricted Shell266623
Node: Bash POSIX Mode268448
Node: Job Control278501
Node: Job Control Basics278961
Node: Job Control Builtins283680
Node: Job Control Variables288210
Node: Command Line Editing289366
Node: Introduction and Notation291037
Node: Readline Interaction292660
Node: Readline Bare Essentials293851
Node: Readline Movement Commands295634
Node: Readline Killing Commands296594
Node: Readline Arguments298512
Node: Searching299556
Node: Readline Init File301742
Node: Readline Init File Syntax302889
Node: Conditional Init Constructs323076
Node: Sample Init File325601
Node: Bindable Readline Commands328718
Node: Commands For Moving329922
Node: Commands For History331065
Node: Commands For Text335354
Node: Commands For Killing338743
Node: Numeric Arguments341224
Node: Commands For Completion342363
Node: Keyboard Macros346554
Node: Miscellaneous Commands347241
Node: Readline vi Mode353045
Node: Programmable Completion353952
Node: Programmable Completion Builtins361413
Node: A Programmable Completion Example371299
Node: Using History Interactively376551
Node: Bash History Facilities377235
Node: Bash History Builtins380236
Node: History Interaction384233
Node: Event Designators387197
Node: Word Designators388416
Node: Modifiers390053
Node: Installing Bash391455
Node: Basic Installation392592
Node: Compilers and Options395283
Node: Compiling For Multiple Architectures396024
Node: Installation Names397687
Node: Specifying the System Type398505
Node: Sharing Defaults399221
Node: Operation Controls399894
Node: Optional Features400852
Node: Reporting Bugs411109
Node: Major Differences From The Bourne Shell412303
Node: GNU Free Documentation License429155
Node: Indexes454332
Node: Builtin Index454786
Node: Reserved Word Index461613
Node: Variable Index464061
Node: Function Index479520
Node: Concept Index492677

End Tag Table
BIN
View File
Binary file not shown.
+3398 -3398
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+4 -1
View File
@@ -3179,7 +3179,10 @@ because the standard error was made a copy of the standard output
before the standard output was redirected to <var>dirlist</var>.
</p>
<p>Bash handles several filenames specially when they are used in
redirections, as described in the following table:
redirections, as described in the following table.
If the operating system on which Bash is running provides these
special files, bash will use them; otherwise it will emulate them
internally with the behavior described below.
</p>
<dl compact="compact">
<dt><code>/dev/fd/<var>fd</var></code></dt>
+92 -89
View File
@@ -2201,7 +2201,10 @@ error was made a copy of the standard output before the standard output
was redirected to DIRLIST.
Bash handles several filenames specially when they are used in
redirections, as described in the following table:
redirections, as described in the following table. If the operating
system on which Bash is running provides these special files, bash will
use them; otherwise it will emulate them internally with the behavior
described below.
'/dev/fd/FD'
If FD is a valid integer, file descriptor FD is duplicated.
@@ -11375,93 +11378,93 @@ Node: Filename Expansion87384
Node: Pattern Matching89668
Node: Quote Removal93366
Node: Redirections93661
Node: Executing Commands102904
Node: Simple Command Expansion103574
Node: Command Search and Execution105504
Node: Command Execution Environment107840
Node: Environment110824
Node: Exit Status112483
Node: Signals114153
Node: Shell Scripts116120
Node: Shell Builtin Commands118635
Node: Bourne Shell Builtins120669
Node: Bash Builtins141269
Node: Modifying Shell Behavior169914
Node: The Set Builtin170259
Node: The Shopt Builtin180672
Node: Special Builtins196471
Node: Shell Variables197450
Node: Bourne Shell Variables197887
Node: Bash Variables199918
Node: Bash Features228298
Node: Invoking Bash229197
Node: Bash Startup Files235146
Node: Interactive Shells240249
Node: What is an Interactive Shell?240659
Node: Is this Shell Interactive?241308
Node: Interactive Shell Behavior242123
Node: Bash Conditional Expressions245498
Node: Shell Arithmetic249499
Node: Aliases252316
Node: Arrays254864
Node: The Directory Stack259948
Node: Directory Stack Builtins260732
Node: Controlling the Prompt263700
Node: The Restricted Shell266446
Node: Bash POSIX Mode268271
Node: Job Control278324
Node: Job Control Basics278784
Node: Job Control Builtins283503
Node: Job Control Variables288033
Node: Command Line Editing289189
Node: Introduction and Notation290860
Node: Readline Interaction292483
Node: Readline Bare Essentials293674
Node: Readline Movement Commands295457
Node: Readline Killing Commands296417
Node: Readline Arguments298335
Node: Searching299379
Node: Readline Init File301565
Node: Readline Init File Syntax302712
Node: Conditional Init Constructs322899
Node: Sample Init File325424
Node: Bindable Readline Commands328541
Node: Commands For Moving329745
Node: Commands For History330888
Node: Commands For Text335177
Node: Commands For Killing338566
Node: Numeric Arguments341047
Node: Commands For Completion342186
Node: Keyboard Macros346377
Node: Miscellaneous Commands347064
Node: Readline vi Mode352868
Node: Programmable Completion353775
Node: Programmable Completion Builtins361236
Node: A Programmable Completion Example371122
Node: Using History Interactively376374
Node: Bash History Facilities377058
Node: Bash History Builtins380059
Node: History Interaction384056
Node: Event Designators387020
Node: Word Designators388239
Node: Modifiers389876
Node: Installing Bash391278
Node: Basic Installation392415
Node: Compilers and Options395106
Node: Compiling For Multiple Architectures395847
Node: Installation Names397510
Node: Specifying the System Type398328
Node: Sharing Defaults399044
Node: Operation Controls399717
Node: Optional Features400675
Node: Reporting Bugs410932
Node: Major Differences From The Bourne Shell412126
Node: GNU Free Documentation License428978
Node: Indexes454155
Node: Builtin Index454609
Node: Reserved Word Index461436
Node: Variable Index463884
Node: Function Index479343
Node: Concept Index492500
Node: Executing Commands103081
Node: Simple Command Expansion103751
Node: Command Search and Execution105681
Node: Command Execution Environment108017
Node: Environment111001
Node: Exit Status112660
Node: Signals114330
Node: Shell Scripts116297
Node: Shell Builtin Commands118812
Node: Bourne Shell Builtins120846
Node: Bash Builtins141446
Node: Modifying Shell Behavior170091
Node: The Set Builtin170436
Node: The Shopt Builtin180849
Node: Special Builtins196648
Node: Shell Variables197627
Node: Bourne Shell Variables198064
Node: Bash Variables200095
Node: Bash Features228475
Node: Invoking Bash229374
Node: Bash Startup Files235323
Node: Interactive Shells240426
Node: What is an Interactive Shell?240836
Node: Is this Shell Interactive?241485
Node: Interactive Shell Behavior242300
Node: Bash Conditional Expressions245675
Node: Shell Arithmetic249676
Node: Aliases252493
Node: Arrays255041
Node: The Directory Stack260125
Node: Directory Stack Builtins260909
Node: Controlling the Prompt263877
Node: The Restricted Shell266623
Node: Bash POSIX Mode268448
Node: Job Control278501
Node: Job Control Basics278961
Node: Job Control Builtins283680
Node: Job Control Variables288210
Node: Command Line Editing289366
Node: Introduction and Notation291037
Node: Readline Interaction292660
Node: Readline Bare Essentials293851
Node: Readline Movement Commands295634
Node: Readline Killing Commands296594
Node: Readline Arguments298512
Node: Searching299556
Node: Readline Init File301742
Node: Readline Init File Syntax302889
Node: Conditional Init Constructs323076
Node: Sample Init File325601
Node: Bindable Readline Commands328718
Node: Commands For Moving329922
Node: Commands For History331065
Node: Commands For Text335354
Node: Commands For Killing338743
Node: Numeric Arguments341224
Node: Commands For Completion342363
Node: Keyboard Macros346554
Node: Miscellaneous Commands347241
Node: Readline vi Mode353045
Node: Programmable Completion353952
Node: Programmable Completion Builtins361413
Node: A Programmable Completion Example371299
Node: Using History Interactively376551
Node: Bash History Facilities377235
Node: Bash History Builtins380236
Node: History Interaction384233
Node: Event Designators387197
Node: Word Designators388416
Node: Modifiers390053
Node: Installing Bash391455
Node: Basic Installation392592
Node: Compilers and Options395283
Node: Compiling For Multiple Architectures396024
Node: Installation Names397687
Node: Specifying the System Type398505
Node: Sharing Defaults399221
Node: Operation Controls399894
Node: Optional Features400852
Node: Reporting Bugs411109
Node: Major Differences From The Bourne Shell412303
Node: GNU Free Documentation License429155
Node: Indexes454332
Node: Builtin Index454786
Node: Reserved Word Index461613
Node: Variable Index464061
Node: Function Index479520
Node: Concept Index492677

End Tag Table
+10 -10
View File
@@ -1,4 +1,4 @@
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/MacPorts 2015_11) (preloaded format=pdfetex 2015.7.15) 20 JUN 2016 15:38
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/MacPorts 2016_0) (preloaded format=pdfetex 2016.7.6) 14 JUL 2016 11:48
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
@@ -244,7 +244,7 @@ arallel -k traceroute[]
[41] [42] [43]
[44] [45] [46] [47] [48] [49] [50] [51] [52] [53]
Overfull \hbox (26.76846pt too wide) in paragraph at lines 4261--4261
Overfull \hbox (26.76846pt too wide) in paragraph at lines 4264--4264
[]@texttt mapfile [-d @textttsl de-lim@texttt ] [-n @textttsl count@texttt ] [
-O @textttsl ori-gin@texttt ] [-s @textttsl count@texttt ] [-t] [-u @textttsl f
d@texttt ][]
@@ -258,7 +258,7 @@ d@texttt ][]
.etc.
[54] [55]
Overfull \hbox (38.26584pt too wide) in paragraph at lines 4465--4465
Overfull \hbox (38.26584pt too wide) in paragraph at lines 4468--4468
[]@texttt readarray [-d @textttsl de-lim@texttt ] [-n @textttsl count@texttt ]
[-O @textttsl ori-gin@texttt ] [-s @textttsl count@texttt ] [-t] [-u @textttsl
fd@texttt ][]
@@ -273,7 +273,7 @@ Overfull \hbox (38.26584pt too wide) in paragraph at lines 4465--4465
[56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] Chapter 5
[69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] Chapter 6 [80]
Overfull \hbox (49.43388pt too wide) in paragraph at lines 6176--6176
Overfull \hbox (49.43388pt too wide) in paragraph at lines 6179--6179
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -286,7 +286,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
Overfull \hbox (72.42863pt too wide) in paragraph at lines 6177--6177
Overfull \hbox (72.42863pt too wide) in paragraph at lines 6180--6180
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
-
@@ -300,7 +300,7 @@ Overfull \hbox (72.42863pt too wide) in paragraph at lines 6177--6177
.etc.
Overfull \hbox (32.18782pt too wide) in paragraph at lines 6178--6178
Overfull \hbox (32.18782pt too wide) in paragraph at lines 6181--6181
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -388,10 +388,10 @@ texinfo.tex: doing @include of fdl.texi
[158] [159] [160] [161]) Appendix D [162] [163] [164] [165] [166] [167]
[168] [169] [170] [171] )
Here is how much of TeX's memory you used:
4059 strings out of 497110
47055 string characters out of 6206872
4059 strings out of 497105
47054 string characters out of 6206776
136588 words of memory out of 5000000
4843 multiletter control sequences out of 15000+600000
4846 multiletter control sequences out of 15000+600000
34315 words of font info for 116 fonts, out of 8000000 for 9000
51 hyphenation exceptions out of 8191
16i,6n,16p,394b,968s stack positions out of 5000i,500n,10000p,200000b,80000s
@@ -412,7 +412,7 @@ fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/local/share/texmf-texlive/fonts
lic/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm
-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm-super
/sfrm1440.pfb>
Output written on bashref.pdf (177 pages, 733317 bytes).
Output written on bashref.pdf (177 pages, 733442 bytes).
PDF statistics:
2573 PDF objects out of 2984 (max. 8388607)
2351 compressed objects within 24 object streams
BIN
View File
Binary file not shown.
+35 -30
View File
@@ -1,7 +1,7 @@
%!PS-Adobe-2.0
%%Creator: dvips(k) 5.995 Copyright 2015 Radical Eye Software
%%Creator: dvips(k) 5.996 Copyright 2016 Radical Eye Software
%%Title: bashref.dvi
%%CreationDate: Mon Jun 20 15:38:16 2016
%%CreationDate: Thu Jul 14 11:47:59 2016
%%Pages: 177
%%PageOrder: Ascend
%%BoundingBox: 0 0 612 792
@@ -12,7 +12,7 @@
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -D 600 -t letter -o bashref.ps bashref.dvi
%DVIPSParameters: dpi=600
%DVIPSSource: TeX output 2016.06.20:1538
%DVIPSSource: TeX output 2016.07.14:1147
%%BeginProcSet: tex.pro 0 0
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@@ -10497,49 +10497,54 @@ y(The)31 b(w)m(ord)h(follo)m(wing)i(the)f(redirection)g(op)s(erator)f
518 y(substitution,)31 b(arithmetic)h(expansion,)f(quote)h(remo)m(v)-5
b(al,)33 b(\014lename)e(expansion,)g(and)f(w)m(ord)h(splitting.)150
628 y(If)f(it)h(expands)e(to)i(more)g(than)f(one)h(w)m(ord,)f(Bash)h
(rep)s(orts)e(an)h(error.)275 790 y(Note)h(that)g(the)g(order)f(of)g
(rep)s(orts)e(an)h(error.)275 778 y(Note)h(that)g(the)g(order)f(of)g
(redirections)h(is)g(signi\014can)m(t.)41 b(F)-8 b(or)31
b(example,)h(the)e(command)390 953 y Ft(ls)47 b(>)h Fj(dirlist)d
Ft(2>&1)150 1115 y Fu(directs)28 b(b)s(oth)f(standard)g(output)g
b(example,)h(the)e(command)390 928 y Ft(ls)47 b(>)h Fj(dirlist)d
Ft(2>&1)150 1079 y Fu(directs)28 b(b)s(oth)f(standard)g(output)g
(\(\014le)h(descriptor)f(1\))i(and)e(standard)f(error)i(\(\014le)g
(descriptor)f(2\))h(to)h(the)150 1225 y(\014le)h Fr(dirlist)p
Fu(,)h(while)f(the)h(command)390 1388 y Ft(ls)47 b(2>&1)g(>)g
Fj(dirlist)150 1550 y Fu(directs)28 b(only)f(the)h(standard)e(output)i
(descriptor)f(2\))h(to)h(the)150 1188 y(\014le)h Fr(dirlist)p
Fu(,)h(while)f(the)h(command)390 1339 y Ft(ls)47 b(2>&1)g(>)g
Fj(dirlist)150 1489 y Fu(directs)28 b(only)f(the)h(standard)e(output)i
(to)g(\014le)f Fr(dirlist)p Fu(,)h(b)s(ecause)g(the)f(standard)g(error)
g(w)m(as)h(made)f(a)h(cop)m(y)150 1660 y(of)j(the)f(standard)g(output)g
g(w)m(as)h(made)f(a)h(cop)m(y)150 1599 y(of)j(the)f(standard)g(output)g
(b)s(efore)g(the)g(standard)g(output)g(w)m(as)g(redirected)h(to)g
Fr(dirlist)p Fu(.)275 1822 y(Bash)26 b(handles)f(sev)m(eral)j
Fr(dirlist)p Fu(.)275 1749 y(Bash)26 b(handles)f(sev)m(eral)j
(\014lenames)e(sp)s(ecially)h(when)f(they)g(are)g(used)g(in)g
(redirections,)i(as)e(describ)s(ed)150 1932 y(in)k(the)h(follo)m(wing)g
(table:)150 2133 y Ft(/dev/fd/)p Fj(fd)630 2243 y Fu(If)f
Fr(fd)j Fu(is)d(a)h(v)-5 b(alid)31 b(in)m(teger,)h(\014le)e(descriptor)
h Fr(fd)i Fu(is)d(duplicated.)150 2431 y Ft(/dev/stdin)630
2540 y Fu(File)i(descriptor)e(0)h(is)f(duplicated.)150
2728 y Ft(/dev/stdout)630 2837 y Fu(File)i(descriptor)e(1)h(is)f
(duplicated.)150 3025 y Ft(/dev/stderr)630 3134 y Fu(File)i(descriptor)
e(2)h(is)f(duplicated.)150 3322 y Ft(/dev/tcp/)p Fj(host)p
Ft(/)p Fj(port)630 3431 y Fu(If)41 b Fr(host)i Fu(is)f(a)g(v)-5
(redirections,)i(as)e(describ)s(ed)150 1859 y(in)38 b(the)h(follo)m
(wing)h(table.)66 b(If)38 b(the)h(op)s(erating)g(system)f(on)h(whic)m
(h)f(Bash)h(is)f(running)f(pro)m(vides)h(these)150 1968
y(sp)s(ecial)27 b(\014les,)g(bash)e(will)i(use)f(them;)h(otherwise)g
(it)f(will)h(em)m(ulate)h(them)e(in)m(ternally)h(with)f(the)g(b)s(eha)m
(vior)150 2078 y(describ)s(ed)j(b)s(elo)m(w.)150 2261
y Ft(/dev/fd/)p Fj(fd)630 2371 y Fu(If)h Fr(fd)j Fu(is)d(a)h(v)-5
b(alid)31 b(in)m(teger,)h(\014le)e(descriptor)h Fr(fd)i
Fu(is)d(duplicated.)150 2546 y Ft(/dev/stdin)630 2656
y Fu(File)i(descriptor)e(0)h(is)f(duplicated.)150 2831
y Ft(/dev/stdout)630 2941 y Fu(File)i(descriptor)e(1)h(is)f
(duplicated.)150 3116 y Ft(/dev/stderr)630 3226 y Fu(File)i(descriptor)
e(2)h(is)f(duplicated.)150 3401 y Ft(/dev/tcp/)p Fj(host)p
Ft(/)p Fj(port)630 3511 y Fu(If)41 b Fr(host)i Fu(is)f(a)g(v)-5
b(alid)41 b(hostname)h(or)f(In)m(ternet)h(address,)i(and)c
Fr(p)s(ort)j Fu(is)f(an)f(in)m(teger)i(p)s(ort)630 3541
Fr(p)s(ort)j Fu(is)f(an)f(in)m(teger)i(p)s(ort)630 3620
y(n)m(um)m(b)s(er)23 b(or)i(service)h(name,)g(Bash)f(attempts)h(to)f
(op)s(en)f(the)h(corresp)s(onding)f(TCP)g(so)s(c)m(k)m(et.)150
3728 y Ft(/dev/udp/)p Fj(host)p Ft(/)p Fj(port)630 3838
3795 y Ft(/dev/udp/)p Fj(host)p Ft(/)p Fj(port)630 3905
y Fu(If)41 b Fr(host)i Fu(is)f(a)g(v)-5 b(alid)41 b(hostname)h(or)f(In)
m(ternet)h(address,)i(and)c Fr(p)s(ort)j Fu(is)f(an)f(in)m(teger)i(p)s
(ort)630 3948 y(n)m(um)m(b)s(er)23 b(or)h(service)h(name,)h(Bash)e
(ort)630 4015 y(n)m(um)m(b)s(er)23 b(or)h(service)h(name,)h(Bash)e
(attempts)h(to)g(op)s(en)f(the)g(corresp)s(onding)f(UDP)i(so)s(c)m(k)m
(et.)275 4149 y(A)30 b(failure)h(to)g(op)s(en)e(or)i(create)h(a)e
(et.)275 4198 y(A)30 b(failure)h(to)g(op)s(en)e(or)i(create)h(a)e
(\014le)h(causes)g(the)f(redirection)h(to)g(fail.)275
4312 y(Redirections)f(using)e(\014le)i(descriptors)f(greater)h(than)f
4348 y(Redirections)f(using)e(\014le)i(descriptors)f(greater)h(than)f
(9)h(should)e(b)s(e)h(used)f(with)h(care,)h(as)g(they)f(ma)m(y)150
4421 y(con\015ict)i(with)f(\014le)h(descriptors)f(the)g(shell)h(uses)f
(in)m(ternally)-8 b(.)150 4649 y Fk(3.6.1)63 b(Redirecting)40
b(Input)150 4796 y Fu(Redirection)35 b(of)f(input)f(causes)i(the)f
4458 y(con\015ict)i(with)f(\014le)h(descriptors)f(the)g(shell)h(uses)f
(in)m(ternally)-8 b(.)150 4673 y Fk(3.6.1)63 b(Redirecting)40
b(Input)150 4820 y Fu(Redirection)35 b(of)f(input)f(causes)i(the)f
(\014le)g(whose)g(name)g(results)g(from)g(the)g(expansion)g(of)g
Fr(w)m(ord)k Fu(to)d(b)s(e)150 4905 y(op)s(ened)d(for)g(reading)g(on)g
Fr(w)m(ord)k Fu(to)d(b)s(e)150 4930 y(op)s(ened)d(for)g(reading)g(on)g
(\014le)h(descriptor)f Ft(n)p Fu(,)h(or)f(the)g(standard)g(input)f
(\(\014le)i(descriptor)f(0\))h(if)f Ft(n)g Fu(is)h(not)150
5015 y(sp)s(eci\014ed.)275 5177 y(The)c(general)j(format)e(for)h
5039 y(sp)s(eci\014ed.)275 5190 y(The)c(general)j(format)e(for)h
(redirecting)g(input)e(is:)390 5340 y Ft([)p Fj(n)p Ft(]<)p
Fj(word)p eop end
%%Page: 34 40
+4 -1
View File
@@ -2592,7 +2592,10 @@ because the standard error was made a copy of the standard output
before the standard output was redirected to @var{dirlist}.
Bash handles several filenames specially when they are used in
redirections, as described in the following table:
redirections, as described in the following table.
If the operating system on which Bash is running provides these
special files, bash will use them; otherwise it will emulate them
internally with the behavior described below.
@table @code
@item /dev/fd/@var{fd}
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.22.3
%%CreationDate: Mon Jun 20 15:38:03 2016
%%CreationDate: Thu Jul 14 11:47:50 2016
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.22.3
%%CreationDate: Mon Jun 20 15:38:03 2016
%%CreationDate: Thu Jul 14 11:47:50 2016
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.22 3
+27 -5
View File
@@ -2928,7 +2928,11 @@ execute_arith_for_command (arith_for_command)
and the DEBUG trap. */
line_number = arith_lineno = arith_for_command->line;
if (variable_context && interactive_shell)
line_number -= function_line_number;
{
line_number -= function_line_number;
if (line_number < 0)
line_number = 0;
}
/* Evaluate the initialization expression. */
expresult = eval_arith_for_expr (arith_for_command->init, &expok);
@@ -3482,17 +3486,22 @@ execute_while_or_until (while_command, type)
loop. The job control code will set `breaking' to loop_level
when a job in a loop is stopped with SIGTSTP. If the stopped job
is in the loop test, `breaking' will not be reset unless we do
this, and the shell will cease to execute commands. */
this, and the shell will cease to execute commands. The same holds
true for `continue'. */
if (type == CMD_WHILE && return_value != EXECUTION_SUCCESS)
{
if (breaking)
breaking--;
if (continuing)
continuing--;
break;
}
if (type == CMD_UNTIL && return_value == EXECUTION_SUCCESS)
{
if (breaking)
breaking--;
if (continuing)
continuing--;
break;
}
@@ -3569,7 +3578,11 @@ execute_arith_command (arith_command)
line_number = arith_command->line;
/* If we're in a function, update the line number information. */
if (variable_context && interactive_shell)
line_number -= function_line_number;
{
line_number -= function_line_number;
if (line_number < 0)
line_number = 0;
}
command_string_index = 0;
print_arith_command (arith_command->exp);
@@ -3767,7 +3780,11 @@ execute_cond_command (cond_command)
line_number = cond_command->line;
/* If we're in a function, update the line number information. */
if (variable_context && interactive_shell)
line_number -= function_line_number;
{
line_number -= function_line_number;
if (line_number < 0)
line_number = 0;
}
command_string_index = 0;
print_cond_command (cond_command);
@@ -4008,7 +4025,11 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
/* If we're in a function, update the line number information. */
if (variable_context && interactive_shell && sourcelevel == 0)
line_number -= function_line_number;
{
line_number -= function_line_number;
if (line_number < 0)
line_number = 0;
}
/* Remember what this command line looks like at invocation. */
command_string_index = 0;
@@ -4619,6 +4640,7 @@ execute_function (var, words, flags, fds_to_close, async, subshell)
add_unwind_protect (pop_context, (char *)NULL);
unwind_protect_int (line_number);
unwind_protect_int (line_number_for_err_trap);
unwind_protect_int (function_line_number);
unwind_protect_int (return_catch_flag);
unwind_protect_jmp_buf (return_catch);
add_unwind_protect (dispose_command, (char *)tc);
+2
View File
@@ -3845,6 +3845,7 @@ run_sigchld_trap (nchild)
unwind_protect_pointer (the_pipeline);
unwind_protect_pointer (subst_assign_varlist);
unwind_protect_pointer (this_shell_builtin);
unwind_protect_pointer (temporary_env);
/* We have to add the commands this way because they will be run
in reverse order of adding. We don't want maybe_set_sigchld_trap ()
@@ -3854,6 +3855,7 @@ run_sigchld_trap (nchild)
subst_assign_varlist = (WORD_LIST *)NULL;
the_pipeline = (PROCESS *)NULL;
temporary_env = 0; /* traps should not run with temporary env */
running_trap = SIGCHLD + 1;
+17 -2
View File
@@ -50,6 +50,14 @@
_rl_callback_func_t *_rl_callback_func = 0;
_rl_callback_generic_arg *_rl_callback_data = 0;
/* Applications can set this to non-zero to have readline's signal handlers
installed during the entire duration of reading a complete line, as in
readline-6.2. This should be used with care, because it can result in
readline receiving signals and not handling them until it's called again
via rl_callback_read_char, thereby stealing them from the application.
By default, signal handlers are only active while readline is active. */
int rl_persistent_signal_handlers = 0;
/* **************************************************************** */
/* */
/* Callback Readline Functions */
@@ -82,6 +90,11 @@ _rl_callback_newline ()
if (rl_prep_term_function)
(*rl_prep_term_function) (_rl_meta_flag);
#if defined (HANDLE_SIGNALS)
if (rl_persistent_signal_handlers)
rl_set_signals ();
#endif
}
readline_internal_setup ();
@@ -103,7 +116,8 @@ rl_callback_handler_install (prompt, linefunc)
#if defined (HANDLE_SIGNALS)
#define CALLBACK_READ_RETURN() \
do { \
rl_clear_signals (); \
if (rl_persistent_signal_handlers == 0) \
rl_clear_signals (); \
return; \
} while (0)
#else
@@ -140,7 +154,8 @@ rl_callback_read_char ()
#if defined (HANDLE_SIGNALS)
/* Install signal handlers only when readline has control. */
rl_set_signals ();
if (rl_persistent_signal_handlers == 0)
rl_set_signals ();
#endif
do
+30
View File
@@ -1591,6 +1591,22 @@ using the callback interface should be prepared to clean up Readline's
state if they wish to handle the signal before the line handler completes
and restores the terminal state.
If an application using the callback interface wishes to have Readline
install its signal handlers at the time the application calls
@code{rl_callback_handler_install} and remove them only when a complete
line of input has been read, it should set the
@code{rl_persistent_signal_handlers} variable to a non-zero value.
This allows an application to defer all of the handling of the signals
Readline catches to Readline.
Applications should use this variable with care; it can result in Readline
catching signals and not acting on them (or allowing the application to react
to them) until the application calls @code{rl_callback_read_char}. This
can result in an application becoming less responsive to keyboard signals
like SIGINT.
If an application does not want or need to perform any signal handling, or
does not need to do any processing between calls to @code{rl_callback_read_char},
setting this variable may be desirable.
Readline provides two variables that allow application writers to
control whether or not it will catch certain signals and act on them
when they are received. It is important that applications change the
@@ -1612,6 +1628,15 @@ Readline will install a signal handler for @code{SIGWINCH}.
The default value of @code{rl_catch_sigwinch} is 1.
@end deftypevar
@deftypevar int rl_persistent_signal_handlers
If an application using the callback interface wishes Readline's signal
handlers to be installed and active during the set of calls to
@code{rl_callback_read_char} that constitutes an entire single line,
it should set this variable to a non-zero value.
The default value of @code{rl_persistent_signal_handlers} is 0.
@end deftypevar
@deftypevar int rl_change_environment
If this variable is set to a non-zero value,
and Readline is handling @code{SIGWINCH}, Readline will modify the
@@ -1627,6 +1652,11 @@ for example),
Readline provides convenience functions to do the necessary terminal
and internal state cleanup upon receipt of a signal.
@deftypefun int rl_pending_signal (void)
Return the signal number of the most recent signal Readline received but
has not yet handled, or 0 if there is no pending signal.
@end deftypefun
@deftypefun void rl_cleanup_after_signal (void)
This function will reset the state of the terminal to what it was before
@code{readline()} was called, and remove the Readline signal handlers for
+3 -3
View File
@@ -4,7 +4,7 @@ Copyright (C) 1988-2016 Free Software Foundation, Inc.
@set EDITION 7.0
@set VERSION 7.0
@set UPDATED 20 April 2016
@set UPDATED-MONTH April 2016
@set UPDATED 16 July 2016
@set UPDATED-MONTH July 2016
@set LASTCHANGE Wed Apr 20 13:32:48 PDT 2016
@set LASTCHANGE Sat Jul 16 13:43:15 EDT 2016
+11 -1
View File
@@ -442,6 +442,8 @@ extern void rl_cleanup_after_signal PARAMS((void));
extern void rl_reset_after_signal PARAMS((void));
extern void rl_free_line_state PARAMS((void));
extern int rl_pending_signal PARAMS((void));
extern void rl_echo_signal_char PARAMS((int));
extern int rl_set_paren_blink_timeout PARAMS((int));
@@ -640,7 +642,7 @@ extern rl_compentry_func_t *rl_completion_entry_function;
/* Optional generator for menu completion. Default is
rl_completion_entry_function (rl_filename_completion_function). */
extern rl_compentry_func_t *rl_menu_completion_entry_function;
extern rl_compentry_func_t *rl_menu_completion_entry_function;
/* If rl_ignore_some_completions_function is non-NULL it is the address
of a function to call after all of the possible matches have been
@@ -832,6 +834,14 @@ extern int rl_ignore_completion_duplicates;
completion character will be inserted as any other. */
extern int rl_inhibit_completion;
/* Applications can set this to non-zero to have readline's signal handlers
installed during the entire duration of reading a complete line, as in
readline-6.2. This should be used with care, because it can result in
readline receiving signals and not handling them until it's called again
via rl_callback_read_char, thereby stealing them from the application.
By default, signal handlers are only active while readline is active. */
extern int rl_persistent_signal_handlers;
/* Input error; can be returned by (*rl_getc_function) if readline is reading
a top-level command (RL_ISSTATE (RL_STATE_READCMD)). */
#define READERR (-2)
+6 -1
View File
@@ -1,6 +1,6 @@
/* signals.c -- signal handling support for readline. */
/* Copyright (C) 1987-2015 Free Software Foundation, Inc.
/* Copyright (C) 1987-2016 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
@@ -585,6 +585,11 @@ rl_free_line_state ()
_rl_reset_argument ();
}
int
rl_pending_signal ()
{
return (_rl_caught_signal);
}
#endif /* HANDLE_SIGNALS */
/* **************************************************************** */
+14 -4
View File
@@ -109,6 +109,9 @@ extern int errno;
#define WRPAREN L')'
#endif
#define DOLLAR_AT_STAR(c) ((c) == '@' || (c) == '*')
#define STR_DOLLAR_AT_STAR(s) (DOLLAR_AT_STAR ((s)[0]) && (s)[1] == '\0')
/* Evaluates to 1 if C is one of the shell's special parameters whose length
can be taken, but is also one of the special expansion characters. */
#define VALID_SPECIAL_LENGTH_PARAM(c) \
@@ -6797,7 +6800,7 @@ parameter_brace_expand_length (name)
if (name[1] == '\0') /* ${#} */
number = number_of_args ();
else if ((name[1] == '@' || name[1] == '*') && name[2] == '\0') /* ${#@}, ${#*} */
else if (DOLLAR_AT_STAR (name[1]) && name[2] == '\0') /* ${#@}, ${#*} */
number = number_of_args ();
else if ((sh_syntaxtab[(unsigned char) name[1]] & CSPECVAR) && name[2] == '\0')
{
@@ -7067,7 +7070,7 @@ get_var_and_type (varname, value, ind, quoted, flags, varp, valp)
}
/* This sets vtype to VT_VARIABLE or VT_POSPARMS */
vtype = (vname[0] == '@' || vname[0] == '*') && vname[1] == '\0';
vtype = STR_DOLLAR_AT_STAR (vname);
if (vtype == VT_POSPARMS && vname[0] == '*')
vtype |= VT_STARSUB;
*varp = (SHELL_VAR *)NULL;
@@ -7824,7 +7827,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
int want_substring, want_indir, want_patsub, want_casemod;
char *name, *value, *temp, *temp1;
WORD_DESC *tdesc, *ret;
int t_index, sindex, c, tflag, modspec;
int t_index, sindex, c, tflag, modspec, all_element_arrayref;
intmax_t number;
arrayind_t ind;
@@ -7832,6 +7835,8 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
var_is_set = var_is_null = var_is_special = check_nullness = 0;
want_substring = want_indir = want_patsub = want_casemod = 0;
all_element_arrayref = 0;
sindex = *indexp;
t_index = ++sindex;
/* ${#var} doesn't have any of the other parameter expansions on it. */
@@ -8124,6 +8129,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
if (valid_array_reference (name, 0))
{
int qflags;
char *t;
qflags = quoted;
/* If in a context where word splitting will not take place, treat as
@@ -8131,6 +8137,10 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
if (pflags & PF_ASSIGNRHS)
qflags |= Q_DOUBLE_QUOTES;
chk_atstar (name, qflags, quoted_dollar_atp, contains_dollar_at);
/* We duplicate a little code here */
t = mbschr (name, '[');
if (t && ALL_ELEMENT_SUB (t[1]) && t[2] == ']')
all_element_arrayref = 1;
}
#endif
@@ -8160,7 +8170,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
variable error. */
if (want_substring || want_patsub || want_casemod || c == '#' || c == '%' || c == RBRACE)
{
if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1]))
if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1]) && all_element_arrayref == 0)
{
last_command_exit_value = EXECUTION_FAILURE;
err_unboundvar (name);
+1 -1
View File
@@ -1,4 +1,4 @@
BUILD_DIR=/usr/local/build/chet/bash/bash-current
BUILD_DIR=/usr/local/build/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
+9
View File
@@ -286,6 +286,7 @@ run_pending_traps ()
register int sig;
int old_exit_value, x;
WORD_LIST *save_subst_varlist;
HASH_TABLE *save_tempenv;
sh_parser_state_t pstate;
#if defined (ARRAY_VARS)
ARRAY *ps;
@@ -397,6 +398,8 @@ run_pending_traps ()
save_parser_state (&pstate);
save_subst_varlist = subst_assign_varlist;
subst_assign_varlist = 0;
save_tempenv = temporary_env;
temporary_env = 0; /* traps should not run with temporary env */
#if defined (JOB_CONTROL)
save_pipeline (1); /* XXX only provides one save level */
@@ -410,6 +413,7 @@ run_pending_traps ()
subst_assign_varlist = save_subst_varlist;
restore_parser_state (&pstate);
temporary_env = save_tempenv;
}
pending_traps[sig] = 0; /* XXX - move before evalstring? */
@@ -941,6 +945,7 @@ _run_trap_internal (sig, tag)
int flags;
procenv_t save_return_catch;
WORD_LIST *save_subst_varlist;
HASH_TABLE *save_tempenv;
sh_parser_state_t pstate;
#if defined (ARRAY_VARS)
ARRAY *ps;
@@ -977,6 +982,8 @@ _run_trap_internal (sig, tag)
save_parser_state (&pstate);
save_subst_varlist = subst_assign_varlist;
subst_assign_varlist = 0;
save_tempenv = temporary_env;
temporary_env = 0; /* traps should not run with temporary env */
#if defined (JOB_CONTROL)
if (sig != DEBUG_TRAP) /* run_debug_trap does this */
@@ -1014,6 +1021,8 @@ _run_trap_internal (sig, tag)
restore_pipestatus_array (ps);
#endif
temporary_env = save_tempenv;
sigmodes[sig] &= ~SIG_INPROGRESS;
running_trap = 0;
interrupt_state = old_int;