remove (' from chars that can follow ${' command substitution; fix for empty command substitutions; fix for adding incomplete command substitutions to history; fix for function source file with -c command; fix for EOF at PS2 when ignoreeof is set

This commit is contained in:
Chet Ramey
2023-05-26 17:29:41 -04:00
parent 782af56204
commit e252024788
29 changed files with 10680 additions and 10512 deletions
+53
View File
@@ -6389,3 +6389,56 @@ subst.c
subst.c
- quote_escapes_internal: use ifs_cmap instead of iterating through
ifs_value to set skip_ctlesc and skip_ctlnul
5/23
----
parser.h
- remove `(' from FUNSUB_CHARS
parse.y
- parse_comsub: don't bother with `(' as one of the FUNSUB_CHARS
doc/bash.1,doc/bashref.texi
- command substitution: remove mention of `(' as a valid character
following the open brace in nofork command substitution
5/24
----
parse.y
- parse_comsub: avoid adding `;' to an empty ${ command substitution
- parse_comsub: if open == '{', push back a newline we read into
peekc to get PS2 prompting right.
From a report by Grisha Levit <grishalevit@gmail.com>
subst.c
- skip_double_quoted: pass the SX_COMPLETE flag down to
extract_dollar_brace_string in case it contains an unclosed command
substitution.
From a report by Grisha Levit <grishalevit@gmail.com>
5/25
----
shell.c
- make sure shell_initialized is set to 1 before running -c command
make_cmd.c
- make_function_def: initialize source_file to something other than
`main' or `environment' if the shell is not interactive.
From a report from Emanuele Torre <torreemanuele6@gmail.com>
parse.y
- save_token_state,restore_token_state: save and restore token_to_read
- read_token_word: if we read EOF in an interactive shell, set
token_to_read to yacc_EOF and EOF_Reached to 1 so the token will
be delimited but the next call to read_token returns yacc_EOF
- handle_ignoreeof: broke the code that checks eof_encountered and
possibly exceeds the ignoreeof limit out into a separate public
function, called from handle_eof_input_unit
eval.c
- reader_loop: if EOF_Reached is set in an interactive shell after
parse_command and execute_command, and ignoreeof has been enabled,
check for ignoreeof with handle_ignoreeof and reset EOF_Reached
back to 0 if we should not exit. This can occur when EOF delimits
a simple command (simple_command_terminator)
From a report by Grisha Levit <grishalevit@gmail.com>
+2070 -2073
View File
File diff suppressed because it is too large Load Diff
+5 -8
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Sun May 14 15:32:59 EDT 2023
.\" Last Change: Tue May 23 11:29:30 EDT 2023
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2023 May 14" "GNU Bash 5.2"
.TH BASH 1 "2023 May 23" "GNU Bash 5.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -3622,7 +3622,7 @@ which executes \fIcommand\fP in the current execution environment
and captures its output, again with trailing newlines removed.
.PP
The character \fIc\fP following the open brace must be a space, tab,
newline, \fB(\fP, or \fB|\fP, and the close brace must be in a position
newline, or \fB|\fP, and the close brace must be in a position
where a reserved word may appear (i.e., preceded by a command terminator
such as semicolon).
\fBBash\fP allows the close brace to be joined to the remaining characters in
@@ -3641,11 +3641,8 @@ function is executing, and the \fBreturn\fP builtin forces
however, the rest of the execution environment,
including the positional parameters, is shared with the caller.
.PP
If the first character following the open brace is a \fB(\fP,
\fIcommand\fP is executed in a subshell, and \fIcommand\fP must be
terminated by a \fB)\fP. This is similar to the \fB(\fP compound
command (see \fBCompound Commands\fP above).
If the first character is a \fB|\fP, the construct expands to the
If the first character following the open brace
is a \fB|\fP, the construct expands to the
value of the \fBREPLY\fP shell variable after \fIcommand\fP executes,
without removing any trailing newlines,
and the standard output of \fIcommand\fP remains the same as in the
+7 -10
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2023 May 14<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2023 May 23<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -4520,7 +4520,7 @@ and captures its output, again with trailing newlines removed.
<P>
The character <I>c</I> following the open brace must be a space, tab,
newline, <B>(</B>, or <B>|</B>, and the close brace must be in a position
newline, or <B>|</B>, and the close brace must be in a position
where a reserved word may appear (i.e., preceded by a command terminator
such as semicolon).
<B>Bash</B> allows the close brace to be joined to the remaining characters in
@@ -4542,11 +4542,8 @@ however, the rest of the execution environment,
including the positional parameters, is shared with the caller.
<P>
If the first character following the open brace is a <B>(</B>,
<I>command</I> is executed in a subshell, and <I>command</I> must be
terminated by a <B>)</B>. This is similar to the <B>(</B> compound
command (see <B>Compound Commands</B> above).
If the first character is a <B>|</B>, the construct expands to the
If the first character following the open brace
is a <B>|</B>, the construct expands to the
value of the <B>REPLY</B> shell variable after <I>command</I> executes,
without removing any trailing newlines,
and the standard output of <I>command</I> remains the same as in the
@@ -15002,7 +14999,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 5.2<TH ALIGN=CENTER width=33%>2023 May 14<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 5.2<TH ALIGN=CENTER width=33%>2023 May 23<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -15108,7 +15105,7 @@ There may be only one active coprocess at a time.
<DT><A HREF="#lbDI">BUGS</A><DD>
</DL>
<HR>
This document was created by man2html from /usr/local/src/bash/bash-20230515/doc/bash.1.<BR>
Time: 20 May 2023 11:02:33 EDT
This document was created by man2html from /usr/local/src/bash/bash-20230522/doc/bash.1.<BR>
Time: 23 May 2023 11:31:51 EDT
</BODY>
</HTML>
+109 -111
View File
@@ -1,9 +1,9 @@
This is bash.info, produced by makeinfo version 6.8 from bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.2, 14 May 2023).
Bash shell (version 5.2, 23 May 2023).
This is Edition 5.2, last updated 14 May 2023, of 'The GNU Bash
This is Edition 5.2, last updated 23 May 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Copyright (C) 1988-2023 Free Software Foundation, Inc.
@@ -26,10 +26,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.2, 14 May 2023). The Bash home page is
Bash shell (version 5.2, 23 May 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.2, last updated 14 May 2023, of 'The GNU Bash
This is Edition 5.2, last updated 23 May 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Bash contains features that appear in other popular shells, and some
@@ -2266,7 +2266,7 @@ which executes COMMAND in the current execution environment and captures
its output, again with trailing newlines removed.
The character C following the open brace must be a space, tab,
newline, '(', or '|', and the close brace must be in a position where a
newline, or '|', and the close brace must be in a position where a
reserved word may appear (i.e., preceded by a command terminator such as
semicolon). Bash allows the close brace to be joined to the remaining
characters in the word without being followed by a shell metacharacter
@@ -2282,20 +2282,18 @@ function is executing, and the 'return' builtin forces COMMAND to
complete; however, the rest of the execution environment, including the
positional parameters, is shared with the caller.
If the first character following the open brace is a '(', COMMAND is
executed in a subshell, and COMMAND must be terminated by a ')'. This
is similar to the '(' compound command (*note Command Grouping::). If
the first character is a '|', the construct expands to the value of the
'REPLY' shell variable after COMMAND executes, without removing any
trailing newlines, and the standard output of COMMAND remains the same
as in the calling shell. Bash creates 'REPLY' as an initially-unset
local variable when COMMAND executes, and restores 'REPLY' to the value
it had before the command substitution after COMMAND completes, as with
any local variable.
If the first character following the open brace is a '|', the
construct expands to the value of the 'REPLY' shell variable after
COMMAND executes, without removing any trailing newlines, and the
standard output of COMMAND remains the same as in the calling shell.
Bash creates 'REPLY' as an initially-unset local variable when COMMAND
executes, and restores 'REPLY' to the value it had before the command
substitution after COMMAND completes, as with any local variable.
For example, this construct expands to '12345', and leaves the shell
variable 'X' unchanged in the current execution environment:
${ local X=12345 ; echo $X; }
(not declaring 'X' as local would modify its value in the current
@@ -12805,102 +12803,102 @@ Node: Brace Expansion72539
Node: Tilde Expansion75270
Node: Shell Parameter Expansion77888
Node: Command Substitution96287
Node: Arithmetic Expansion99936
Node: Process Substitution100901
Node: Word Splitting102018
Node: Filename Expansion104063
Node: Pattern Matching106993
Node: Quote Removal111992
Node: Redirections112284
Node: Executing Commands121974
Node: Simple Command Expansion122641
Node: Command Search and Execution124748
Node: Command Execution Environment127132
Node: Environment130164
Node: Exit Status131824
Node: Signals133605
Node: Shell Scripts137051
Node: Shell Builtin Commands140075
Node: Bourne Shell Builtins142110
Node: Bash Builtins164441
Node: Modifying Shell Behavior196437
Node: The Set Builtin196779
Node: The Shopt Builtin207374
Node: Special Builtins223283
Node: Shell Variables224259
Node: Bourne Shell Variables224693
Node: Bash Variables226794
Node: Bash Features260856
Node: Invoking Bash261866
Node: Bash Startup Files267876
Node: Interactive Shells273004
Node: What is an Interactive Shell?273412
Node: Is this Shell Interactive?274058
Node: Interactive Shell Behavior274870
Node: Bash Conditional Expressions278496
Node: Shell Arithmetic283135
Node: Aliases286093
Node: Arrays288984
Node: The Directory Stack295544
Node: Directory Stack Builtins296325
Node: Controlling the Prompt300582
Node: The Restricted Shell303544
Node: Bash POSIX Mode306151
Node: Shell Compatibility Mode321941
Node: Job Control330182
Node: Job Control Basics330639
Node: Job Control Builtins335638
Node: Job Control Variables341430
Node: Command Line Editing342583
Node: Introduction and Notation344251
Node: Readline Interaction345871
Node: Readline Bare Essentials347059
Node: Readline Movement Commands348845
Node: Readline Killing Commands349802
Node: Readline Arguments351720
Node: Searching352761
Node: Readline Init File354944
Node: Readline Init File Syntax356202
Node: Conditional Init Constructs379990
Node: Sample Init File384183
Node: Bindable Readline Commands387304
Node: Commands For Moving388505
Node: Commands For History390553
Node: Commands For Text395544
Node: Commands For Killing399190
Node: Numeric Arguments402220
Node: Commands For Completion403356
Node: Keyboard Macros407544
Node: Miscellaneous Commands408229
Node: Readline vi Mode414264
Node: Programmable Completion415168
Node: Programmable Completion Builtins422945
Node: A Programmable Completion Example433930
Node: Using History Interactively439175
Node: Bash History Facilities439856
Node: Bash History Builtins442858
Node: History Interaction447879
Node: Event Designators451496
Node: Word Designators452847
Node: Modifiers454604
Node: Installing Bash456409
Node: Basic Installation457543
Node: Compilers and Options461262
Node: Compiling For Multiple Architectures462000
Node: Installation Names463689
Node: Specifying the System Type465795
Node: Sharing Defaults466509
Node: Operation Controls467179
Node: Optional Features468134
Node: Reporting Bugs479350
Node: Major Differences From The Bourne Shell480681
Node: GNU Free Documentation License497527
Node: Indexes522701
Node: Builtin Index523152
Node: Reserved Word Index530250
Node: Variable Index532695
Node: Function Index549680
Node: Concept Index563461
Node: Arithmetic Expansion99748
Node: Process Substitution100713
Node: Word Splitting101830
Node: Filename Expansion103875
Node: Pattern Matching106805
Node: Quote Removal111804
Node: Redirections112096
Node: Executing Commands121786
Node: Simple Command Expansion122453
Node: Command Search and Execution124560
Node: Command Execution Environment126944
Node: Environment129976
Node: Exit Status131636
Node: Signals133417
Node: Shell Scripts136863
Node: Shell Builtin Commands139887
Node: Bourne Shell Builtins141922
Node: Bash Builtins164253
Node: Modifying Shell Behavior196249
Node: The Set Builtin196591
Node: The Shopt Builtin207186
Node: Special Builtins223095
Node: Shell Variables224071
Node: Bourne Shell Variables224505
Node: Bash Variables226606
Node: Bash Features260668
Node: Invoking Bash261678
Node: Bash Startup Files267688
Node: Interactive Shells272816
Node: What is an Interactive Shell?273224
Node: Is this Shell Interactive?273870
Node: Interactive Shell Behavior274682
Node: Bash Conditional Expressions278308
Node: Shell Arithmetic282947
Node: Aliases285905
Node: Arrays288796
Node: The Directory Stack295356
Node: Directory Stack Builtins296137
Node: Controlling the Prompt300394
Node: The Restricted Shell303356
Node: Bash POSIX Mode305963
Node: Shell Compatibility Mode321753
Node: Job Control329994
Node: Job Control Basics330451
Node: Job Control Builtins335450
Node: Job Control Variables341242
Node: Command Line Editing342395
Node: Introduction and Notation344063
Node: Readline Interaction345683
Node: Readline Bare Essentials346871
Node: Readline Movement Commands348657
Node: Readline Killing Commands349614
Node: Readline Arguments351532
Node: Searching352573
Node: Readline Init File354756
Node: Readline Init File Syntax356014
Node: Conditional Init Constructs379802
Node: Sample Init File383995
Node: Bindable Readline Commands387116
Node: Commands For Moving388317
Node: Commands For History390365
Node: Commands For Text395356
Node: Commands For Killing399002
Node: Numeric Arguments402032
Node: Commands For Completion403168
Node: Keyboard Macros407356
Node: Miscellaneous Commands408041
Node: Readline vi Mode414076
Node: Programmable Completion414980
Node: Programmable Completion Builtins422757
Node: A Programmable Completion Example433742
Node: Using History Interactively438987
Node: Bash History Facilities439668
Node: Bash History Builtins442670
Node: History Interaction447691
Node: Event Designators451308
Node: Word Designators452659
Node: Modifiers454416
Node: Installing Bash456221
Node: Basic Installation457355
Node: Compilers and Options461074
Node: Compiling For Multiple Architectures461812
Node: Installation Names463501
Node: Specifying the System Type465607
Node: Sharing Defaults466321
Node: Operation Controls466991
Node: Optional Features467946
Node: Reporting Bugs479162
Node: Major Differences From The Bourne Shell480493
Node: GNU Free Documentation License497339
Node: Indexes522513
Node: Builtin Index522964
Node: Reserved Word Index530062
Node: Variable Index532507
Node: Function Index549492
Node: Concept Index563273

End Tag Table
BIN
View File
Binary file not shown.
+2342 -2348
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+10 -11
View File
@@ -4,9 +4,9 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This text is a brief description of the features that are present in
the Bash shell (version 5.2, 14 May 2023).
the Bash shell (version 5.2, 23 May 2023).
This is Edition 5.2, last updated 14 May 2023,
This is Edition 5.2, last updated 23 May 2023,
of The GNU Bash Reference Manual,
for Bash, Version 5.2.
@@ -77,10 +77,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
<span id="Bash-Features-1"></span><h1 class="top">Bash Features</h1>
<p>This text is a brief description of the features that are present in
the Bash shell (version 5.2, 14 May 2023).
the Bash shell (version 5.2, 23 May 2023).
The Bash home page is <a href="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</a>.
</p>
<p>This is Edition 5.2, last updated 14 May 2023,
<p>This is Edition 5.2, last updated 23 May 2023,
of <cite>The GNU Bash Reference Manual</cite>,
for <code>Bash</code>, Version 5.2.
</p>
@@ -3085,7 +3085,7 @@ the parentheses make up the command; none are treated specially.
and captures its output, again with trailing newlines removed.
</p>
<p>The character <var>c</var> following the open brace must be a space, tab,
newline, &lsquo;<samp>(</samp>&rsquo;, or &lsquo;<samp>|</samp>&rsquo;, and the close brace must be in a position
newline, or &lsquo;<samp>|</samp>&rsquo;, and the close brace must be in a position
where a reserved word may appear (i.e., preceded by a command terminator
such as semicolon).
Bash allows the close brace to be joined to the remaining characters in
@@ -3104,11 +3104,8 @@ function is executing, and the <code>return</code> builtin forces
however, the rest of the execution environment,
including the positional parameters, is shared with the caller.
</p>
<p>If the first character following the open brace is a &lsquo;<samp>(</samp>&rsquo;,
<var>command</var> is executed in a subshell, and <var>command</var> must be
terminated by a &lsquo;<samp>)</samp>&rsquo;. This is similar to the <code>(</code> compound
command (see <a href="#Command-Grouping">Grouping Commands</a>).
If the first character is a &lsquo;<samp>|</samp>&rsquo;, the construct expands to the
<p>If the first character following the open brace
is a &lsquo;<samp>|</samp>&rsquo;, the construct expands to the
value of the <code>REPLY</code> shell variable after <var>command</var> executes,
without removing any trailing newlines,
and the standard output of <var>command</var> remains the same as in the
@@ -3122,7 +3119,9 @@ as with any local variable.
shell variable <code>X</code> unchanged in the current execution environment:
</p>
<div class="example">
<pre class="example">${ local X=12345 ; echo $X; }
<pre class="example">
${ local X=12345 ; echo $X; }
</pre></div>
<p>(not declaring <code>X</code> as local would modify its value in the current
+109 -111
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.8 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.2, 14 May 2023).
Bash shell (version 5.2, 23 May 2023).
This is Edition 5.2, last updated 14 May 2023, of 'The GNU Bash
This is Edition 5.2, last updated 23 May 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Copyright (C) 1988-2023 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.2, 14 May 2023). The Bash home page is
Bash shell (version 5.2, 23 May 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.2, last updated 14 May 2023, of 'The GNU Bash
This is Edition 5.2, last updated 23 May 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Bash contains features that appear in other popular shells, and some
@@ -2267,7 +2267,7 @@ which executes COMMAND in the current execution environment and captures
its output, again with trailing newlines removed.
The character C following the open brace must be a space, tab,
newline, '(', or '|', and the close brace must be in a position where a
newline, or '|', and the close brace must be in a position where a
reserved word may appear (i.e., preceded by a command terminator such as
semicolon). Bash allows the close brace to be joined to the remaining
characters in the word without being followed by a shell metacharacter
@@ -2283,20 +2283,18 @@ function is executing, and the 'return' builtin forces COMMAND to
complete; however, the rest of the execution environment, including the
positional parameters, is shared with the caller.
If the first character following the open brace is a '(', COMMAND is
executed in a subshell, and COMMAND must be terminated by a ')'. This
is similar to the '(' compound command (*note Command Grouping::). If
the first character is a '|', the construct expands to the value of the
'REPLY' shell variable after COMMAND executes, without removing any
trailing newlines, and the standard output of COMMAND remains the same
as in the calling shell. Bash creates 'REPLY' as an initially-unset
local variable when COMMAND executes, and restores 'REPLY' to the value
it had before the command substitution after COMMAND completes, as with
any local variable.
If the first character following the open brace is a '|', the
construct expands to the value of the 'REPLY' shell variable after
COMMAND executes, without removing any trailing newlines, and the
standard output of COMMAND remains the same as in the calling shell.
Bash creates 'REPLY' as an initially-unset local variable when COMMAND
executes, and restores 'REPLY' to the value it had before the command
substitution after COMMAND completes, as with any local variable.
For example, this construct expands to '12345', and leaves the shell
variable 'X' unchanged in the current execution environment:
${ local X=12345 ; echo $X; }
(not declaring 'X' as local would modify its value in the current
@@ -12806,102 +12804,102 @@ Node: Brace Expansion72638
Node: Tilde Expansion75372
Node: Shell Parameter Expansion77993
Node: Command Substitution96395
Node: Arithmetic Expansion100047
Node: Process Substitution101015
Node: Word Splitting102135
Node: Filename Expansion104183
Node: Pattern Matching107116
Node: Quote Removal112118
Node: Redirections112413
Node: Executing Commands122106
Node: Simple Command Expansion122776
Node: Command Search and Execution124886
Node: Command Execution Environment127273
Node: Environment130308
Node: Exit Status131971
Node: Signals133755
Node: Shell Scripts137204
Node: Shell Builtin Commands140231
Node: Bourne Shell Builtins142269
Node: Bash Builtins164603
Node: Modifying Shell Behavior196602
Node: The Set Builtin196947
Node: The Shopt Builtin207545
Node: Special Builtins223457
Node: Shell Variables224436
Node: Bourne Shell Variables224873
Node: Bash Variables226977
Node: Bash Features261042
Node: Invoking Bash262055
Node: Bash Startup Files268068
Node: Interactive Shells273199
Node: What is an Interactive Shell?273610
Node: Is this Shell Interactive?274259
Node: Interactive Shell Behavior275074
Node: Bash Conditional Expressions278703
Node: Shell Arithmetic283345
Node: Aliases286306
Node: Arrays289200
Node: The Directory Stack295763
Node: Directory Stack Builtins296547
Node: Controlling the Prompt300807
Node: The Restricted Shell303772
Node: Bash POSIX Mode306382
Node: Shell Compatibility Mode322175
Node: Job Control330419
Node: Job Control Basics330879
Node: Job Control Builtins335881
Node: Job Control Variables341676
Node: Command Line Editing342832
Node: Introduction and Notation344503
Node: Readline Interaction346126
Node: Readline Bare Essentials347317
Node: Readline Movement Commands349106
Node: Readline Killing Commands350066
Node: Readline Arguments351987
Node: Searching353031
Node: Readline Init File355217
Node: Readline Init File Syntax356478
Node: Conditional Init Constructs380269
Node: Sample Init File384465
Node: Bindable Readline Commands387589
Node: Commands For Moving388793
Node: Commands For History390844
Node: Commands For Text395838
Node: Commands For Killing399487
Node: Numeric Arguments402520
Node: Commands For Completion403659
Node: Keyboard Macros407850
Node: Miscellaneous Commands408538
Node: Readline vi Mode414576
Node: Programmable Completion415483
Node: Programmable Completion Builtins423263
Node: A Programmable Completion Example434251
Node: Using History Interactively439499
Node: Bash History Facilities440183
Node: Bash History Builtins443188
Node: History Interaction448212
Node: Event Designators451832
Node: Word Designators453186
Node: Modifiers454946
Node: Installing Bash456754
Node: Basic Installation457891
Node: Compilers and Options461613
Node: Compiling For Multiple Architectures462354
Node: Installation Names464046
Node: Specifying the System Type466155
Node: Sharing Defaults466872
Node: Operation Controls467545
Node: Optional Features468503
Node: Reporting Bugs479722
Node: Major Differences From The Bourne Shell481056
Node: GNU Free Documentation License497905
Node: Indexes523082
Node: Builtin Index523536
Node: Reserved Word Index530637
Node: Variable Index533085
Node: Function Index550073
Node: Concept Index563857
Node: Arithmetic Expansion99859
Node: Process Substitution100827
Node: Word Splitting101947
Node: Filename Expansion103995
Node: Pattern Matching106928
Node: Quote Removal111930
Node: Redirections112225
Node: Executing Commands121918
Node: Simple Command Expansion122588
Node: Command Search and Execution124698
Node: Command Execution Environment127085
Node: Environment130120
Node: Exit Status131783
Node: Signals133567
Node: Shell Scripts137016
Node: Shell Builtin Commands140043
Node: Bourne Shell Builtins142081
Node: Bash Builtins164415
Node: Modifying Shell Behavior196414
Node: The Set Builtin196759
Node: The Shopt Builtin207357
Node: Special Builtins223269
Node: Shell Variables224248
Node: Bourne Shell Variables224685
Node: Bash Variables226789
Node: Bash Features260854
Node: Invoking Bash261867
Node: Bash Startup Files267880
Node: Interactive Shells273011
Node: What is an Interactive Shell?273422
Node: Is this Shell Interactive?274071
Node: Interactive Shell Behavior274886
Node: Bash Conditional Expressions278515
Node: Shell Arithmetic283157
Node: Aliases286118
Node: Arrays289012
Node: The Directory Stack295575
Node: Directory Stack Builtins296359
Node: Controlling the Prompt300619
Node: The Restricted Shell303584
Node: Bash POSIX Mode306194
Node: Shell Compatibility Mode321987
Node: Job Control330231
Node: Job Control Basics330691
Node: Job Control Builtins335693
Node: Job Control Variables341488
Node: Command Line Editing342644
Node: Introduction and Notation344315
Node: Readline Interaction345938
Node: Readline Bare Essentials347129
Node: Readline Movement Commands348918
Node: Readline Killing Commands349878
Node: Readline Arguments351799
Node: Searching352843
Node: Readline Init File355029
Node: Readline Init File Syntax356290
Node: Conditional Init Constructs380081
Node: Sample Init File384277
Node: Bindable Readline Commands387401
Node: Commands For Moving388605
Node: Commands For History390656
Node: Commands For Text395650
Node: Commands For Killing399299
Node: Numeric Arguments402332
Node: Commands For Completion403471
Node: Keyboard Macros407662
Node: Miscellaneous Commands408350
Node: Readline vi Mode414388
Node: Programmable Completion415295
Node: Programmable Completion Builtins423075
Node: A Programmable Completion Example434063
Node: Using History Interactively439311
Node: Bash History Facilities439995
Node: Bash History Builtins443000
Node: History Interaction448024
Node: Event Designators451644
Node: Word Designators452998
Node: Modifiers454758
Node: Installing Bash456566
Node: Basic Installation457703
Node: Compilers and Options461425
Node: Compiling For Multiple Architectures462166
Node: Installation Names463858
Node: Specifying the System Type465967
Node: Sharing Defaults466684
Node: Operation Controls467357
Node: Optional Features468315
Node: Reporting Bugs479534
Node: Major Differences From The Bourne Shell480868
Node: GNU Free Documentation License497717
Node: Indexes522894
Node: Builtin Index523348
Node: Reserved Word Index530449
Node: Variable Index532897
Node: Function Index549885
Node: Concept Index563669

End Tag Table
+20 -21
View File
@@ -1,12 +1,11 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_0) (preloaded format=pdfetex 2021.8.30) 20 MAY 2023 11:02
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_0) (preloaded format=pdfetex 2021.8.30) 23 MAY 2023 11:32
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**\input /usr/local/src/bash/bash-20230515/doc/bashref.texi \input /usr/local/s
rc/bash/bash-20230515/doc/bashref.texi
(/usr/local/src/bash/bash-20230515/doc/bashref.texi
(/usr/local/src/bash/bash-20230515/doc/texinfo.tex
**\input /usr/local/src/bash/bash-20230522/doc/bashref.texi
(/usr/local/src/bash/bash-20230522/doc/bashref.texi
(/usr/local/src/bash/bash-20230522/doc/texinfo.tex
Loading texinfo [version 2015-11-22.14]:
\outerhsize=\dimen16
\outervsize=\dimen17
@@ -162,15 +161,15 @@ This is `epsf.tex' v2.7.4 <14 February 2011>
texinfo.tex: doing @include of version.texi
(/usr/local/src/bash/bash-20230515/doc/version.texi) [1{/opt/local/var/db/texmf
(/usr/local/src/bash/bash-20230522/doc/version.texi) [1{/opt/local/var/db/texmf
/fonts/map/pdftex/updmap/pdftex.map}] [2]
(/usr/local/build/bash/bash-20230515/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20230515/doc/bashref.toc)
(/usr/local/build/bash/bash-20230515/doc/bashref.toc) Chapter 1
(/usr/local/build/bash/bash-20230522/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20230522/doc/bashref.toc)
(/usr/local/build/bash/bash-20230522/doc/bashref.toc) Chapter 1
\openout0 = `bashref.toc'.
(/usr/local/build/bash/bash-20230515/doc/bashref.aux)
(/usr/local/build/bash/bash-20230522/doc/bashref.aux)
\openout1 = `bashref.aux'.
Chapter 2 [1] [2]
@@ -230,7 +229,7 @@ Overfull \hbox (5.95723pt too wide) in paragraph at lines 724--725
[49] [50] [51]
[52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66]
[67]
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5360--5360
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5358--5358
[]@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -243,7 +242,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5360--5360
.etc.
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5361--5361
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5359--5359
[]@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -262,7 +261,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5361--5361
[118] [119]
texinfo.tex: doing @include of rluser.texi
(/usr/local/src/bash/bash-20230515/lib/readline/doc/rluser.texi
(/usr/local/src/bash/bash-20230522/lib/readline/doc/rluser.texi
Chapter 8 [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130]
[131]
Underfull \hbox (badness 7540) in paragraph at lines 874--880
@@ -312,10 +311,10 @@ gnored[]
texinfo.tex: doing @include of hsuser.texi
(/usr/local/src/bash/bash-20230515/lib/readline/doc/hsuser.texi Chapter 9
(/usr/local/src/bash/bash-20230522/lib/readline/doc/hsuser.texi Chapter 9
[155] [156] [157] [158] [159] [160]) Chapter 10 [161] [162] [163] [164]
[165]
Underfull \hbox (badness 10000) in paragraph at lines 9640--9649
Underfull \hbox (badness 10000) in paragraph at lines 9638--9647
[]@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
entation[]@textrm '[],
@@ -328,7 +327,7 @@ entation[]@textrm '[],
.etc.
Underfull \hbox (badness 10000) in paragraph at lines 9640--9649
Underfull \hbox (badness 10000) in paragraph at lines 9638--9647
@textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
extrm '[], `@texttt strict-posix-default[]@textrm '[], and
@@ -344,7 +343,7 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
[175] [176] Appendix C [177]
texinfo.tex: doing @include of fdl.texi
(/usr/local/src/bash/bash-20230515/doc/fdl.texi
(/usr/local/src/bash/bash-20230522/doc/fdl.texi
[178] [179] [180] [181] [182] [183] [184]) Appendix D [185] [186] [187]
[188] [189] [190] [191] [192] [193] [194] )
Here is how much of TeX's memory you used:
@@ -354,7 +353,7 @@ Here is how much of TeX's memory you used:
4869 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,389b,983s stack positions out of 5000i,500n,10000p,200000b,80000s
16i,6n,16p,331b,983s stack positions out of 5000i,500n,10000p,200000b,80000s
{/opt/local/share/texmf-texlive/font
s/enc/dvips/cm-super/cm-super-t1.enc}</opt/local/share/texmf-texlive/fonts/type
1/public/amsfonts/cm/cmbx12.pfb></opt/local/share/texmf-texlive/fonts/type1/pub
@@ -372,10 +371,10 @@ texlive/fonts/type1/public/amsfonts/cm/cmtt12.pfb></opt/local/share/texmf-texli
ve/fonts/type1/public/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texlive/fon
ts/type1/public/cm-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fonts/typ
e1/public/cm-super/sfrm1440.pfb>
Output written on bashref.pdf (200 pages, 807897 bytes).
Output written on bashref.pdf (200 pages, 807513 bytes).
PDF statistics:
2800 PDF objects out of 2984 (max. 8388607)
2553 compressed objects within 26 object streams
2799 PDF objects out of 2984 (max. 8388607)
2552 compressed objects within 26 object streams
328 named destinations out of 1000 (max. 500000)
1157 words of extra memory for PDF output out of 10000 (max. 10000000)
BIN
View File
Binary file not shown.
+4527 -4449
View File
File diff suppressed because it is too large Load Diff
+4 -6
View File
@@ -2667,7 +2667,7 @@ which executes @var{command} in the current execution environment
and captures its output, again with trailing newlines removed.
The character @var{c} following the open brace must be a space, tab,
newline, @samp{(}, or @samp{|}, and the close brace must be in a position
newline, or @samp{|}, and the close brace must be in a position
where a reserved word may appear (i.e., preceded by a command terminator
such as semicolon).
Bash allows the close brace to be joined to the remaining characters in
@@ -2686,11 +2686,8 @@ function is executing, and the @code{return} builtin forces
however, the rest of the execution environment,
including the positional parameters, is shared with the caller.
If the first character following the open brace is a @samp{(},
@var{command} is executed in a subshell, and @var{command} must be
terminated by a @samp{)}. This is similar to the @code{(} compound
command (@pxref{Command Grouping}).
If the first character is a @samp{|}, the construct expands to the
If the first character following the open brace
is a @samp{|}, the construct expands to the
value of the @code{REPLY} shell variable after @var{command} executes,
without removing any trailing newlines,
and the standard output of @var{command} remains the same as in the
@@ -2704,6 +2701,7 @@ For example, this construct expands to @samp{12345}, and leaves the
shell variable @code{X} unchanged in the current execution environment:
@example
$@{ local X=12345 ; echo $X; @}
@end example
+4
View File
@@ -609,6 +609,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
of the _n_a_m_e_s is not a valid shell variable name, or --ff is sup-
plied with a _n_a_m_e that is not a function.
ffaallssee Does nothing, returns a non-zero status.
ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t]
ffcc --ss [_p_a_t=_r_e_p] [_c_m_d]
The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t
@@ -1836,6 +1838,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
or subshell environment when one is created. The return status
is false if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true.
ttrruuee Does nothing, returns a 0 status.
ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...]
With no options, indicate how each _n_a_m_e would be interpreted if
used as a command name. If the --tt option is used, ttyyppee prints a
+1322 -1322
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.22.4
%%CreationDate: Tue Apr 18 10:26:00 2023
%%CreationDate: Mon May 22 09:42:13 2023
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.22 4
+2 -2
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2023 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Sun May 14 15:33:30 EDT 2023
@set LASTCHANGE Tue May 23 11:29:48 EDT 2023
@set EDITION 5.2
@set VERSION 5.2
@set UPDATED 14 May 2023
@set UPDATED 23 May 2023
@set UPDATED-MONTH May 2023
+5
View File
@@ -183,6 +183,11 @@ reader_loop (void)
current_command = (COMMAND *)NULL;
}
}
if (EOF_Reached && interactive && ignoreeof && parse_and_execute_level == 0)
{
if (handle_ignoreeof (1))
EOF_Reached = 0;
}
}
else
{
+3 -1
View File
@@ -113,6 +113,7 @@ extern char *xparse_dolparen (const char *, char *, int *, int);
extern COMMAND *parse_string_to_command (char *, int);
extern void reset_parser (void);
extern void reset_readahead_token (void);
extern void unset_readahead_token (void);
extern WORD_LIST *parse_string_to_word_list (char *, int, const char *);
extern int parser_will_prompt (void);
@@ -123,9 +124,10 @@ extern void free_pushed_string_input (void);
extern int parser_expanding_alias (void);
extern void parser_save_alias (void);
extern void parser_restore_alias (void);
extern void clear_shell_input_line (void);
extern int handle_ignoreeof (int);
extern char *decode_prompt_string (char *);
extern int get_current_prompt_level (void);
+1 -1
View File
@@ -73,7 +73,7 @@ extern int _rl_stricmp (const char *, const char *);
extern int _rl_strnicmp (const char *, const char *, int);
#endif
#if defined (HAVE_STRPBRK) && !defined (HAVE_MULTIBYTE)
#if defined (HAVE_STRPBRK) && !defined (HANDLE_MULTIBYTE)
# define _rl_strpbrk(a,b) strpbrk((a),(b))
#else
extern char *_rl_strpbrk (const char *, const char *);
+3 -2
View File
@@ -281,9 +281,10 @@ _rl_strindex (const char *s1, const char *s2)
return ((char *)NULL);
}
#ifndef HAVE_STRPBRK
#if !defined (HAVE_STRPBRK) || defined (HANDLE_MULTIBYTE)
/* Find the first occurrence in STRING1 of any character from STRING2.
Return a pointer to the character in STRING1. */
Return a pointer to the character in STRING1. Understands multibyte
characters. */
char *
_rl_strpbrk (const char *string1, const char *string2)
{
+11 -2
View File
@@ -738,7 +738,7 @@ make_function_def (WORD_DESC *name, COMMAND *command, int lineno, int lstart)
temp->flags = 0;
command->line = lstart;
/* Information used primarily for debugging. */
/* Information used primarily for debugging and error messages. */
temp->source_file = 0;
#if defined (ARRAY_VARS)
GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a);
@@ -749,7 +749,16 @@ make_function_def (WORD_DESC *name, COMMAND *command, int lineno, int lstart)
initialized come from the environment. Otherwise default to "main"
(usually functions being defined interactively) */
if (temp->source_file == 0)
temp->source_file = shell_initialized ? "main" : "environment";
{
if (shell_initialized == 0)
temp->source_file = "environment";
else if (interactive_shell)
temp->source_file = "main";
else if (interactive == 0) /* assume -c command */
temp->source_file = dollar_vars[0];
else
temp->source_file = shell_name; /* this clause is never hit */
}
#if defined (DEBUGGER)
bind_function_def (name->word, temp, 0);
+61 -26
View File
@@ -305,6 +305,11 @@ static size_t shell_input_line_len; /* strlen (shell_input_line) */
/* Either zero or EOF. */
static int shell_input_line_terminator;
/* This implements one-character lookahead/lookbehind across physical input
lines, to avoid something being lost because it's pushed back with
shell_ungetc when we're at the start of a line. */
static int eol_ungetc_lookahead = 0;
/* The line number in a script on which a function definition starts. */
static int function_dstart;
static int save_dstart = -1;
@@ -401,7 +406,7 @@ static FILE *yyerrstream;
%type <word_list> word_list pattern
%type <pattern> pattern_list case_clause_sequence case_clause
%type <number> timespec
%type <number> list_terminator
%type <number> list_terminator simple_list_terminator
%start inputunit
@@ -1241,7 +1246,9 @@ list1: list1 AND_AND newline_list list1
;
simple_list_terminator: '\n'
{ $$ = '\n'; }
| yacc_EOF
{ $$ = yacc_EOF; }
;
list_terminator:'\n'
@@ -1876,11 +1883,12 @@ save_token_state (void)
{
int *ret;
ret = (int *)xmalloc (4 * sizeof (int));
ret = (int *)xmalloc (5 * sizeof (int));
ret[0] = last_read_token;
ret[1] = token_before_that;
ret[2] = two_tokens_ago;
ret[3] = current_token;
ret[4] = token_to_read;
return ret;
}
@@ -1893,6 +1901,7 @@ restore_token_state (int *ts)
token_before_that = ts[1];
two_tokens_ago = ts[2];
current_token = ts[3];
token_to_read = ts[4];
}
/*
@@ -2330,11 +2339,6 @@ static struct dstack temp_dstack = { (char *)NULL, 0, 0 };
read the next line. This is called by read_token when the shell is
processing normal command input. */
/* This implements one-character lookahead/lookbehind across physical input
lines, to avoid something being lost because it's pushed back with
shell_ungetc when we're at the start of a line. */
static int eol_ungetc_lookahead = 0;
static int unquoted_backslash = 0;
static int
@@ -3390,6 +3394,12 @@ reset_readahead_token (void)
token_to_read = 0;
}
void
unset_readahead_token (void)
{
token_to_read = 0;
}
/* Read the next token. Command can be READ (normal operation) or
RESET (to normalize state). */
static int
@@ -4305,8 +4315,13 @@ parse_comsub (int qc, int open, int close, size_t *lenp, int flags)
if (FUNSUB_CHAR (peekc))
{
dolbrace_spec = peekc;
#if 0
if (dolbrace_spec == '(') /* ksh93 compatibility ) */
shell_ungetc (peekc);
#else
if (dolbrace_spec == '\n')
shell_ungetc (peekc); /* get PS2 prompting right */
#endif
}
else
{
@@ -4369,6 +4384,7 @@ parse_comsub (int qc, int open, int close, size_t *lenp, int flags)
r = yyparse ();
#if 0
if (open == '{')
{
if (current_token == shell_eof_token &&
@@ -4376,6 +4392,7 @@ parse_comsub (int qc, int open, int close, size_t *lenp, int flags)
(token_before_that == WORD || token_before_that == ASSIGNMENT_WORD))
was_word = 1;
}
#endif
if (need_here_doc > 0)
{
@@ -4455,6 +4472,11 @@ INTERNAL_DEBUG(("current_token (%d) != shell_eof_token (%c)", current_token, she
else
strcpy (ret, tcmd);
}
else if (retlen == 0) /* open == '{' }, empty command */
{
ret = xmalloc (3);
ret[retlen++] = ' ';
}
else /* open == '{' } */
{
int lastc;
@@ -4464,9 +4486,7 @@ INTERNAL_DEBUG(("current_token (%d) != shell_eof_token (%c)", current_token, she
ret = xmalloc (retlen + 4);
ret[0] = (dolbrace_spec == '|') ? '|' : ' ';
strcpy (ret + 1, tcmd); /* ( */
if (lastc != '\n' && lastc != ';' && lastc != '&' && lastc != ')')
ret[retlen++] = ';';
else if (lastc == ')' && was_word) /* right paren can end a word */
if (lastc != '\n' && lastc != ';' && lastc != '&')
ret[retlen++] = ';';
ret[retlen++] = ' ';
}
@@ -5138,7 +5158,16 @@ read_token_word (int character)
for (;;)
{
if (character == EOF)
goto got_token;
{
/* delimit the current token, then return EOF if the shell is
interactive. */
if (interactive)
{
EOF_Reached = 1;
token_to_read = yacc_EOF;
}
goto got_token;
}
if (pass_next_character)
{
@@ -6667,6 +6696,25 @@ int eof_encountered = 0;
/* The limit for eof_encountered. */
int eof_encountered_limit = 10;
int
handle_ignoreeof (int reset_prompt)
{
if (eof_encountered < eof_encountered_limit)
{
fprintf (stderr, _("Use \"%s\" to leave the shell.\n"),
login_shell ? "logout" : "exit");
eof_encountered++;
/* Reset the parsing state. */
last_read_token = current_token = '\n';
if (reset_prompt)
/* Reset the prompt string to be $PS1. */
prompt_string_pointer = (char **)NULL;
prompt_again (0);
return 1;
}
return 0;
}
/* If we have EOF as the only input unit, this user wants to leave
the shell. If the shell is not interactive, then just leave.
Otherwise, if ignoreeof is set, and we haven't done this the
@@ -6683,21 +6731,8 @@ handle_eof_input_unit (void)
EOF_Reached = 0;
/* If the user wants to "ignore" eof, then let her do so, kind of. */
if (ignoreeof)
{
if (eof_encountered < eof_encountered_limit)
{
fprintf (stderr, _("Use \"%s\" to leave the shell.\n"),
login_shell ? "logout" : "exit");
eof_encountered++;
/* Reset the parsing state. */
last_read_token = current_token = '\n';
/* Reset the prompt string to be $PS1. */
prompt_string_pointer = (char **)NULL;
prompt_again (0);
return;
}
}
if (ignoreeof && handle_ignoreeof (1))
return;
/* In this case EOF should exit the shell. Do it now. */
reset_parser ();
+6 -2
View File
@@ -76,9 +76,13 @@ struct dstack {
#define DOLBRACE_QUOTE 0x40 /* single quote is special in double quotes */
#define DOLBRACE_QUOTE2 0x80 /* single quote is semi-special in double quotes */
/* characters that can appear following ${ to introduce a function or value
substitution (this is mksh terminology and needs to be changed). */
/* characters that can appear following ${ to introduce a nofork command
substitution. */
#if 0
#define FUNSUB_CHAR(n) ((n) == ' ' || (n) == '\t' || (n) == '\n' || (n) == '|' || (n) == '(') /* ) */
#else
#define FUNSUB_CHAR(n) ((n) == ' ' || (n) == '\t' || (n) == '\n' || (n) == '|')
#endif
/* variable declarations from parse.y */
extern struct dstack dstack;
+1 -1
View File
@@ -751,7 +751,7 @@ main (int argc, char **argv, char **env)
start_debugger ();
#if defined (ONESHOT)
executing = 1;
executing = shell_initialized = 1;
run_one_command (command_execution_string);
exit_shell (last_command_exit_value);
#else /* ONESHOT */
+1 -1
View File
@@ -1,6 +1,6 @@
/* shell.h -- The data structures used by the shell */
/* Copyright (C) 1993-2022 Free Software Foundation, Inc.
/* Copyright (C) 1993-2023 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+1 -1
View File
@@ -1044,7 +1044,7 @@ skip_double_quoted (const char *string, size_t slen, int sind, int flags)
else if (string[i + 1] == LBRACE && FUNSUB_CHAR (string[si]))
ret = extract_function_subst (string, &si, Q_DOUBLE_QUOTES, (flags & SX_COMPLETE));
else
ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, SX_NOALLOC);
ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, SX_NOALLOC|(flags&SX_COMPLETE));
/* These can consume the entire string if they are unterminated */
CHECK_STRING_OVERRUN (i, si, slen, c);
+2 -2
View File
@@ -47,7 +47,7 @@ declare -f func
xx=${ unset -f func; }
declare -f func
echo ${( echo abcde )} # works in ksh93
echo ${ ( echo abcde );}
echo ${| echo 67890; REPLY=12345; } # works in mksh
x=${| REPLY= ;}
@@ -126,7 +126,7 @@ echo after: "$@"
set -- 1 2
echo before: "$@"
: "${( shift)}"
: "${ ( shift) }" # parse_comsub adds the closing semicolon anyway
echo after: "$@"
# nested funsubs