mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-28 07:59:50 +02:00
additional tests; documentation updates
This commit is contained in:
@@ -3749,3 +3749,31 @@ parse.y
|
||||
the connection command with a '\n' connector. Makes the text
|
||||
output of parse_comsub closer to the original source text. From a
|
||||
report from Martijn Dekker <martijn@inlv.org>
|
||||
|
||||
7/6
|
||||
---
|
||||
doc/bash.1,lib/readline/doc/rluser.texi
|
||||
- complete: add note about arguments passed to command specified by
|
||||
`complete -C'; suggested by Mark Chandler <mcp@synq.so>
|
||||
|
||||
builtins/setattr.def
|
||||
- show_local_var_attributes: special-case `local -', since there is
|
||||
no `declare -' equivalent.
|
||||
Reported by Emanuele Torre <torreemanuele6@gmail.com>.
|
||||
- show_all_var_attributes: use `local -' when printing a variable named
|
||||
`-' at the current non-zero variable context
|
||||
|
||||
parse.y
|
||||
- shell_getc: if we are at the end of an alias, returning a space,
|
||||
make sure we mark the previous character as single-byte by modifying
|
||||
shell_input_line_property so the space we return is properly
|
||||
recognized. This would fail before if the last character of the
|
||||
alias was a multi-byte character. Reported by
|
||||
Vangelis Natsios <vnatsios@gmail.com>
|
||||
|
||||
7/12
|
||||
----
|
||||
lib/readline/isearch.c
|
||||
- rl_display_search: don't call rl_redisplay_function before returning;
|
||||
rl_message already calls it. Reported by
|
||||
Frédéric Moulins <frederic@moulins.org>
|
||||
|
||||
@@ -890,6 +890,7 @@ tests/alias2.sub f
|
||||
tests/alias3.sub f
|
||||
tests/alias4.sub f
|
||||
tests/alias5.sub f
|
||||
tests/alias6.sub f
|
||||
tests/alias.right f
|
||||
tests/appendop.tests f
|
||||
tests/appendop1.sub f
|
||||
|
||||
+10
-2
@@ -363,7 +363,11 @@ show_all_var_attributes (v, nodefs)
|
||||
|
||||
for (i = any_failed = 0; var = variable_list[i]; i++)
|
||||
{
|
||||
show_var_attributes (var, READONLY_OR_EXPORT, nodefs);
|
||||
/* There is no equivalent `declare -'. */
|
||||
if (variable_context && var->context == variable_context && STREQ (var->name, "-"))
|
||||
printf ("local -\n");
|
||||
else
|
||||
show_var_attributes (var, READONLY_OR_EXPORT, nodefs);
|
||||
if (any_failed = sh_chkwrite (any_failed))
|
||||
break;
|
||||
}
|
||||
@@ -387,7 +391,11 @@ show_local_var_attributes (v, nodefs)
|
||||
|
||||
for (i = any_failed = 0; var = variable_list[i]; i++)
|
||||
{
|
||||
show_var_attributes (var, READONLY_OR_EXPORT, nodefs);
|
||||
/* There is no equivalent `declare -'. */
|
||||
if (STREQ (var->name, "-"))
|
||||
printf ("local -\n");
|
||||
else
|
||||
show_var_attributes (var, READONLY_OR_EXPORT, nodefs);
|
||||
if (any_failed = sh_chkwrite (any_failed))
|
||||
break;
|
||||
}
|
||||
|
||||
+872
-869
File diff suppressed because it is too large
Load Diff
+10
-6
@@ -864,21 +864,24 @@ that is executed, or false if any of the expressions is invalid.
|
||||
.TP
|
||||
\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fBdo\fP \fIlist\fP ; \fBdone\fP
|
||||
The list of words following \fBin\fP is expanded, generating a list
|
||||
of items. The set of expanded words is printed on the standard
|
||||
of items, and the set of expanded words is printed on the standard
|
||||
error, each preceded by a number. If the \fBin\fP
|
||||
\fIword\fP is omitted, the positional parameters are printed (see
|
||||
.SM
|
||||
.B PARAMETERS
|
||||
below). The
|
||||
below).
|
||||
.B select
|
||||
then displays the
|
||||
.SM
|
||||
.B PS3
|
||||
prompt is then displayed and a line read from the standard input.
|
||||
prompt and reads a line from the standard input.
|
||||
If the line consists of a number corresponding to one of
|
||||
the displayed words, then the value of
|
||||
.I name
|
||||
is set to that word. If the line is empty, the words and prompt
|
||||
are displayed again. If EOF is read, the command completes. Any
|
||||
other value read causes
|
||||
is set to that word.
|
||||
If the line is empty, the words and prompt are displayed again.
|
||||
If EOF is read, the \fBselect\fP command completes and returns 1.
|
||||
Any other value read causes
|
||||
.I name
|
||||
to be set to null. The line read is saved in the variable
|
||||
.SM
|
||||
@@ -8220,6 +8223,7 @@ Names of all shell variables. May also be specified as \fB\-v\fP.
|
||||
\fB\-C\fP \fIcommand\fP
|
||||
\fIcommand\fP is executed in a subshell environment, and its output is
|
||||
used as the possible completions.
|
||||
Arguments are passed as with the \fB\-F\fP option.
|
||||
.TP 8
|
||||
\fB\-F\fP \fIfunction\fP
|
||||
The shell function \fIfunction\fP is executed in the current shell
|
||||
|
||||
+128
-124
@@ -949,16 +949,16 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev:
|
||||
select NAME [in WORDS ...]; do COMMANDS; done
|
||||
|
||||
The list of words following 'in' is expanded, generating a list of
|
||||
items. The set of expanded words is printed on the standard error
|
||||
output stream, each preceded by a number. If the 'in WORDS' is
|
||||
omitted, the positional parameters are printed, as if 'in "$@"' had
|
||||
been specified. The 'PS3' prompt is then displayed and a line is
|
||||
read from the standard input. If the line consists of a number
|
||||
corresponding to one of the displayed words, then the value of NAME
|
||||
is set to that word. If the line is empty, the words and prompt
|
||||
are displayed again. If 'EOF' is read, the 'select' command
|
||||
completes. Any other value read causes NAME to be set to null.
|
||||
The line read is saved in the variable 'REPLY'.
|
||||
items, and the set of expanded words is printed on the standard
|
||||
error output stream, each preceded by a number. If the 'in WORDS'
|
||||
is omitted, the positional parameters are printed, as if 'in "$@"'
|
||||
had been specified. 'select' then displays the 'PS3' prompt and
|
||||
reads a line from the standard input. If the line consists of a
|
||||
number corresponding to one of the displayed words, then the value
|
||||
of NAME is set to that word. If the line is empty, the words and
|
||||
prompt are displayed again. If 'EOF' is read, the 'select' command
|
||||
completes and returns 1. Any other value read causes NAME to be
|
||||
set to null. The line read is saved in the variable 'REPLY'.
|
||||
|
||||
The COMMANDS are executed after each selection until a 'break'
|
||||
command is executed, at which point the 'select' command completes.
|
||||
@@ -7294,7 +7294,7 @@ be a temporary solution.
|
||||
This section does not mention behavior that is standard for a
|
||||
particular version (e.g., setting 'compat32' means that quoting the rhs
|
||||
of the regexp matching operator quotes special regexp characters in the
|
||||
word, which is default behavior in bash-3.2 and above).
|
||||
word, which is default behavior in bash-3.2 and subsequent versions).
|
||||
|
||||
If a user enables, say, 'compat32', it may affect the behavior of
|
||||
other compatibility levels up to and including the current compatibility
|
||||
@@ -7638,7 +7638,10 @@ File: bash.info, Node: Job Control Builtins, Next: Job Control Variables, Pre
|
||||
'wait' to wait for each PID or JOBSPEC to terminate before
|
||||
returning its status, intead of returning when it changes status.
|
||||
If neither JOBSPEC nor PID specifies an active child process of the
|
||||
shell, the return status is 127.
|
||||
shell, the return status is 127. If 'wait' is interrupted by a
|
||||
signal, the return status will be greater than 128, as described
|
||||
above (*note Signals::). Otherwise, the return status is the exit
|
||||
status of the last process or job waited for.
|
||||
|
||||
'disown'
|
||||
disown [-ar] [-h] [JOBSPEC ... | PID ... ]
|
||||
@@ -9698,7 +9701,8 @@ happening.
|
||||
|
||||
'-C COMMAND'
|
||||
COMMAND is executed in a subshell environment, and its output
|
||||
is used as the possible completions.
|
||||
is used as the possible completions. Arguments are passed as
|
||||
with the '-F' option.
|
||||
|
||||
'-F FUNCTION'
|
||||
The shell function FUNCTION is executed in the current shell
|
||||
@@ -11774,14 +11778,14 @@ D.1 Index of Shell Builtin Commands
|
||||
* complete: Programmable Completion Builtins.
|
||||
(line 30)
|
||||
* compopt: Programmable Completion Builtins.
|
||||
(line 237)
|
||||
(line 238)
|
||||
* continue: Bourne Shell Builtins.
|
||||
(line 89)
|
||||
* declare: Bash Builtins. (line 154)
|
||||
* dirs: Directory Stack Builtins.
|
||||
(line 7)
|
||||
* disown: Job Control Builtins.
|
||||
(line 101)
|
||||
(line 104)
|
||||
* echo: Bash Builtins. (line 257)
|
||||
* enable: Bash Builtins. (line 306)
|
||||
* eval: Bourne Shell Builtins.
|
||||
@@ -11830,7 +11834,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 594)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 113)
|
||||
(line 116)
|
||||
* test: Bourne Shell Builtins.
|
||||
(line 274)
|
||||
* times: Bourne Shell Builtins.
|
||||
@@ -12532,114 +12536,114 @@ Node: Lists29209
|
||||
Node: Compound Commands31001
|
||||
Node: Looping Constructs32010
|
||||
Node: Conditional Constructs34502
|
||||
Node: Command Grouping48966
|
||||
Node: Coprocesses50441
|
||||
Node: GNU Parallel53101
|
||||
Node: Shell Functions54015
|
||||
Node: Shell Parameters61897
|
||||
Node: Positional Parameters66282
|
||||
Node: Special Parameters67181
|
||||
Node: Shell Expansions70392
|
||||
Node: Brace Expansion72516
|
||||
Node: Tilde Expansion75247
|
||||
Node: Shell Parameter Expansion77865
|
||||
Node: Command Substitution96213
|
||||
Node: Arithmetic Expansion97565
|
||||
Node: Process Substitution98530
|
||||
Node: Word Splitting99647
|
||||
Node: Filename Expansion101588
|
||||
Node: Pattern Matching104334
|
||||
Node: Quote Removal108988
|
||||
Node: Redirections109280
|
||||
Node: Executing Commands118937
|
||||
Node: Simple Command Expansion119604
|
||||
Node: Command Search and Execution121711
|
||||
Node: Command Execution Environment124086
|
||||
Node: Environment127118
|
||||
Node: Exit Status128778
|
||||
Node: Signals130559
|
||||
Node: Shell Scripts134005
|
||||
Node: Shell Builtin Commands137029
|
||||
Node: Bourne Shell Builtins139064
|
||||
Node: Bash Builtins160522
|
||||
Node: Modifying Shell Behavior191375
|
||||
Node: The Set Builtin191717
|
||||
Node: The Shopt Builtin202315
|
||||
Node: Special Builtins218224
|
||||
Node: Shell Variables219200
|
||||
Node: Bourne Shell Variables219634
|
||||
Node: Bash Variables221735
|
||||
Node: Bash Features254548
|
||||
Node: Invoking Bash255558
|
||||
Node: Bash Startup Files261568
|
||||
Node: Interactive Shells266696
|
||||
Node: What is an Interactive Shell?267103
|
||||
Node: Is this Shell Interactive?267749
|
||||
Node: Interactive Shell Behavior268561
|
||||
Node: Bash Conditional Expressions272187
|
||||
Node: Shell Arithmetic276826
|
||||
Node: Aliases279767
|
||||
Node: Arrays282377
|
||||
Node: The Directory Stack288765
|
||||
Node: Directory Stack Builtins289546
|
||||
Node: Controlling the Prompt293803
|
||||
Node: The Restricted Shell296765
|
||||
Node: Bash POSIX Mode299372
|
||||
Node: Shell Compatibility Mode311293
|
||||
Node: Job Control319319
|
||||
Node: Job Control Basics319776
|
||||
Node: Job Control Builtins324775
|
||||
Node: Job Control Variables330342
|
||||
Node: Command Line Editing331495
|
||||
Node: Introduction and Notation333163
|
||||
Node: Readline Interaction334783
|
||||
Node: Readline Bare Essentials335971
|
||||
Node: Readline Movement Commands337751
|
||||
Node: Readline Killing Commands338708
|
||||
Node: Readline Arguments340623
|
||||
Node: Searching341664
|
||||
Node: Readline Init File343847
|
||||
Node: Readline Init File Syntax345105
|
||||
Node: Conditional Init Constructs368301
|
||||
Node: Sample Init File372494
|
||||
Node: Bindable Readline Commands375615
|
||||
Node: Commands For Moving376816
|
||||
Node: Commands For History378864
|
||||
Node: Commands For Text383855
|
||||
Node: Commands For Killing387501
|
||||
Node: Numeric Arguments390531
|
||||
Node: Commands For Completion391667
|
||||
Node: Keyboard Macros395855
|
||||
Node: Miscellaneous Commands396539
|
||||
Node: Readline vi Mode402475
|
||||
Node: Programmable Completion403379
|
||||
Node: Programmable Completion Builtins411156
|
||||
Node: A Programmable Completion Example421848
|
||||
Node: Using History Interactively427092
|
||||
Node: Bash History Facilities427773
|
||||
Node: Bash History Builtins430775
|
||||
Node: History Interaction435780
|
||||
Node: Event Designators439397
|
||||
Node: Word Designators440748
|
||||
Node: Modifiers442505
|
||||
Node: Installing Bash444313
|
||||
Node: Basic Installation445447
|
||||
Node: Compilers and Options449166
|
||||
Node: Compiling For Multiple Architectures449904
|
||||
Node: Installation Names451594
|
||||
Node: Specifying the System Type453700
|
||||
Node: Sharing Defaults454413
|
||||
Node: Operation Controls455083
|
||||
Node: Optional Features456038
|
||||
Node: Reporting Bugs467253
|
||||
Node: Major Differences From The Bourne Shell468525
|
||||
Node: GNU Free Documentation License485372
|
||||
Node: Indexes510546
|
||||
Node: Builtin Index510997
|
||||
Node: Reserved Word Index517821
|
||||
Node: Variable Index520266
|
||||
Node: Function Index537037
|
||||
Node: Concept Index550818
|
||||
Node: Command Grouping48987
|
||||
Node: Coprocesses50462
|
||||
Node: GNU Parallel53122
|
||||
Node: Shell Functions54036
|
||||
Node: Shell Parameters61918
|
||||
Node: Positional Parameters66303
|
||||
Node: Special Parameters67202
|
||||
Node: Shell Expansions70413
|
||||
Node: Brace Expansion72537
|
||||
Node: Tilde Expansion75268
|
||||
Node: Shell Parameter Expansion77886
|
||||
Node: Command Substitution96234
|
||||
Node: Arithmetic Expansion97586
|
||||
Node: Process Substitution98551
|
||||
Node: Word Splitting99668
|
||||
Node: Filename Expansion101609
|
||||
Node: Pattern Matching104355
|
||||
Node: Quote Removal109009
|
||||
Node: Redirections109301
|
||||
Node: Executing Commands118958
|
||||
Node: Simple Command Expansion119625
|
||||
Node: Command Search and Execution121732
|
||||
Node: Command Execution Environment124107
|
||||
Node: Environment127139
|
||||
Node: Exit Status128799
|
||||
Node: Signals130580
|
||||
Node: Shell Scripts134026
|
||||
Node: Shell Builtin Commands137050
|
||||
Node: Bourne Shell Builtins139085
|
||||
Node: Bash Builtins160543
|
||||
Node: Modifying Shell Behavior191396
|
||||
Node: The Set Builtin191738
|
||||
Node: The Shopt Builtin202336
|
||||
Node: Special Builtins218245
|
||||
Node: Shell Variables219221
|
||||
Node: Bourne Shell Variables219655
|
||||
Node: Bash Variables221756
|
||||
Node: Bash Features254569
|
||||
Node: Invoking Bash255579
|
||||
Node: Bash Startup Files261589
|
||||
Node: Interactive Shells266717
|
||||
Node: What is an Interactive Shell?267124
|
||||
Node: Is this Shell Interactive?267770
|
||||
Node: Interactive Shell Behavior268582
|
||||
Node: Bash Conditional Expressions272208
|
||||
Node: Shell Arithmetic276847
|
||||
Node: Aliases279788
|
||||
Node: Arrays282398
|
||||
Node: The Directory Stack288786
|
||||
Node: Directory Stack Builtins289567
|
||||
Node: Controlling the Prompt293824
|
||||
Node: The Restricted Shell296786
|
||||
Node: Bash POSIX Mode299393
|
||||
Node: Shell Compatibility Mode311314
|
||||
Node: Job Control319354
|
||||
Node: Job Control Basics319811
|
||||
Node: Job Control Builtins324810
|
||||
Node: Job Control Variables330601
|
||||
Node: Command Line Editing331754
|
||||
Node: Introduction and Notation333422
|
||||
Node: Readline Interaction335042
|
||||
Node: Readline Bare Essentials336230
|
||||
Node: Readline Movement Commands338010
|
||||
Node: Readline Killing Commands338967
|
||||
Node: Readline Arguments340882
|
||||
Node: Searching341923
|
||||
Node: Readline Init File344106
|
||||
Node: Readline Init File Syntax345364
|
||||
Node: Conditional Init Constructs368560
|
||||
Node: Sample Init File372753
|
||||
Node: Bindable Readline Commands375874
|
||||
Node: Commands For Moving377075
|
||||
Node: Commands For History379123
|
||||
Node: Commands For Text384114
|
||||
Node: Commands For Killing387760
|
||||
Node: Numeric Arguments390790
|
||||
Node: Commands For Completion391926
|
||||
Node: Keyboard Macros396114
|
||||
Node: Miscellaneous Commands396798
|
||||
Node: Readline vi Mode402734
|
||||
Node: Programmable Completion403638
|
||||
Node: Programmable Completion Builtins411415
|
||||
Node: A Programmable Completion Example422164
|
||||
Node: Using History Interactively427408
|
||||
Node: Bash History Facilities428089
|
||||
Node: Bash History Builtins431091
|
||||
Node: History Interaction436096
|
||||
Node: Event Designators439713
|
||||
Node: Word Designators441064
|
||||
Node: Modifiers442821
|
||||
Node: Installing Bash444629
|
||||
Node: Basic Installation445763
|
||||
Node: Compilers and Options449482
|
||||
Node: Compiling For Multiple Architectures450220
|
||||
Node: Installation Names451910
|
||||
Node: Specifying the System Type454016
|
||||
Node: Sharing Defaults454729
|
||||
Node: Operation Controls455399
|
||||
Node: Optional Features456354
|
||||
Node: Reporting Bugs467569
|
||||
Node: Major Differences From The Bourne Shell468841
|
||||
Node: GNU Free Documentation License485688
|
||||
Node: Indexes510862
|
||||
Node: Builtin Index511313
|
||||
Node: Reserved Word Index518137
|
||||
Node: Variable Index520582
|
||||
Node: Function Index537353
|
||||
Node: Concept Index551134
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
+128
-124
@@ -950,16 +950,16 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre
|
||||
select NAME [in WORDS ...]; do COMMANDS; done
|
||||
|
||||
The list of words following 'in' is expanded, generating a list of
|
||||
items. The set of expanded words is printed on the standard error
|
||||
output stream, each preceded by a number. If the 'in WORDS' is
|
||||
omitted, the positional parameters are printed, as if 'in "$@"' had
|
||||
been specified. The 'PS3' prompt is then displayed and a line is
|
||||
read from the standard input. If the line consists of a number
|
||||
corresponding to one of the displayed words, then the value of NAME
|
||||
is set to that word. If the line is empty, the words and prompt
|
||||
are displayed again. If 'EOF' is read, the 'select' command
|
||||
completes. Any other value read causes NAME to be set to null.
|
||||
The line read is saved in the variable 'REPLY'.
|
||||
items, and the set of expanded words is printed on the standard
|
||||
error output stream, each preceded by a number. If the 'in WORDS'
|
||||
is omitted, the positional parameters are printed, as if 'in "$@"'
|
||||
had been specified. 'select' then displays the 'PS3' prompt and
|
||||
reads a line from the standard input. If the line consists of a
|
||||
number corresponding to one of the displayed words, then the value
|
||||
of NAME is set to that word. If the line is empty, the words and
|
||||
prompt are displayed again. If 'EOF' is read, the 'select' command
|
||||
completes and returns 1. Any other value read causes NAME to be
|
||||
set to null. The line read is saved in the variable 'REPLY'.
|
||||
|
||||
The COMMANDS are executed after each selection until a 'break'
|
||||
command is executed, at which point the 'select' command completes.
|
||||
@@ -7295,7 +7295,7 @@ be a temporary solution.
|
||||
This section does not mention behavior that is standard for a
|
||||
particular version (e.g., setting 'compat32' means that quoting the rhs
|
||||
of the regexp matching operator quotes special regexp characters in the
|
||||
word, which is default behavior in bash-3.2 and above).
|
||||
word, which is default behavior in bash-3.2 and subsequent versions).
|
||||
|
||||
If a user enables, say, 'compat32', it may affect the behavior of
|
||||
other compatibility levels up to and including the current compatibility
|
||||
@@ -7639,7 +7639,10 @@ File: bashref.info, Node: Job Control Builtins, Next: Job Control Variables,
|
||||
'wait' to wait for each PID or JOBSPEC to terminate before
|
||||
returning its status, intead of returning when it changes status.
|
||||
If neither JOBSPEC nor PID specifies an active child process of the
|
||||
shell, the return status is 127.
|
||||
shell, the return status is 127. If 'wait' is interrupted by a
|
||||
signal, the return status will be greater than 128, as described
|
||||
above (*note Signals::). Otherwise, the return status is the exit
|
||||
status of the last process or job waited for.
|
||||
|
||||
'disown'
|
||||
disown [-ar] [-h] [JOBSPEC ... | PID ... ]
|
||||
@@ -9699,7 +9702,8 @@ happening.
|
||||
|
||||
'-C COMMAND'
|
||||
COMMAND is executed in a subshell environment, and its output
|
||||
is used as the possible completions.
|
||||
is used as the possible completions. Arguments are passed as
|
||||
with the '-F' option.
|
||||
|
||||
'-F FUNCTION'
|
||||
The shell function FUNCTION is executed in the current shell
|
||||
@@ -11775,14 +11779,14 @@ D.1 Index of Shell Builtin Commands
|
||||
* complete: Programmable Completion Builtins.
|
||||
(line 30)
|
||||
* compopt: Programmable Completion Builtins.
|
||||
(line 237)
|
||||
(line 238)
|
||||
* continue: Bourne Shell Builtins.
|
||||
(line 89)
|
||||
* declare: Bash Builtins. (line 154)
|
||||
* dirs: Directory Stack Builtins.
|
||||
(line 7)
|
||||
* disown: Job Control Builtins.
|
||||
(line 101)
|
||||
(line 104)
|
||||
* echo: Bash Builtins. (line 257)
|
||||
* enable: Bash Builtins. (line 306)
|
||||
* eval: Bourne Shell Builtins.
|
||||
@@ -11831,7 +11835,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 594)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 113)
|
||||
(line 116)
|
||||
* test: Bourne Shell Builtins.
|
||||
(line 274)
|
||||
* times: Bourne Shell Builtins.
|
||||
@@ -12533,114 +12537,114 @@ Node: Lists29272
|
||||
Node: Compound Commands31067
|
||||
Node: Looping Constructs32079
|
||||
Node: Conditional Constructs34574
|
||||
Node: Command Grouping49041
|
||||
Node: Coprocesses50519
|
||||
Node: GNU Parallel53182
|
||||
Node: Shell Functions54099
|
||||
Node: Shell Parameters61984
|
||||
Node: Positional Parameters66372
|
||||
Node: Special Parameters67274
|
||||
Node: Shell Expansions70488
|
||||
Node: Brace Expansion72615
|
||||
Node: Tilde Expansion75349
|
||||
Node: Shell Parameter Expansion77970
|
||||
Node: Command Substitution96321
|
||||
Node: Arithmetic Expansion97676
|
||||
Node: Process Substitution98644
|
||||
Node: Word Splitting99764
|
||||
Node: Filename Expansion101708
|
||||
Node: Pattern Matching104457
|
||||
Node: Quote Removal109114
|
||||
Node: Redirections109409
|
||||
Node: Executing Commands119069
|
||||
Node: Simple Command Expansion119739
|
||||
Node: Command Search and Execution121849
|
||||
Node: Command Execution Environment124227
|
||||
Node: Environment127262
|
||||
Node: Exit Status128925
|
||||
Node: Signals130709
|
||||
Node: Shell Scripts134158
|
||||
Node: Shell Builtin Commands137185
|
||||
Node: Bourne Shell Builtins139223
|
||||
Node: Bash Builtins160684
|
||||
Node: Modifying Shell Behavior191540
|
||||
Node: The Set Builtin191885
|
||||
Node: The Shopt Builtin202486
|
||||
Node: Special Builtins218398
|
||||
Node: Shell Variables219377
|
||||
Node: Bourne Shell Variables219814
|
||||
Node: Bash Variables221918
|
||||
Node: Bash Features254734
|
||||
Node: Invoking Bash255747
|
||||
Node: Bash Startup Files261760
|
||||
Node: Interactive Shells266891
|
||||
Node: What is an Interactive Shell?267301
|
||||
Node: Is this Shell Interactive?267950
|
||||
Node: Interactive Shell Behavior268765
|
||||
Node: Bash Conditional Expressions272394
|
||||
Node: Shell Arithmetic277036
|
||||
Node: Aliases279980
|
||||
Node: Arrays282593
|
||||
Node: The Directory Stack288984
|
||||
Node: Directory Stack Builtins289768
|
||||
Node: Controlling the Prompt294028
|
||||
Node: The Restricted Shell296993
|
||||
Node: Bash POSIX Mode299603
|
||||
Node: Shell Compatibility Mode311527
|
||||
Node: Job Control319556
|
||||
Node: Job Control Basics320016
|
||||
Node: Job Control Builtins325018
|
||||
Node: Job Control Variables330588
|
||||
Node: Command Line Editing331744
|
||||
Node: Introduction and Notation333415
|
||||
Node: Readline Interaction335038
|
||||
Node: Readline Bare Essentials336229
|
||||
Node: Readline Movement Commands338012
|
||||
Node: Readline Killing Commands338972
|
||||
Node: Readline Arguments340890
|
||||
Node: Searching341934
|
||||
Node: Readline Init File344120
|
||||
Node: Readline Init File Syntax345381
|
||||
Node: Conditional Init Constructs368580
|
||||
Node: Sample Init File372776
|
||||
Node: Bindable Readline Commands375900
|
||||
Node: Commands For Moving377104
|
||||
Node: Commands For History379155
|
||||
Node: Commands For Text384149
|
||||
Node: Commands For Killing387798
|
||||
Node: Numeric Arguments390831
|
||||
Node: Commands For Completion391970
|
||||
Node: Keyboard Macros396161
|
||||
Node: Miscellaneous Commands396848
|
||||
Node: Readline vi Mode402787
|
||||
Node: Programmable Completion403694
|
||||
Node: Programmable Completion Builtins411474
|
||||
Node: A Programmable Completion Example422169
|
||||
Node: Using History Interactively427416
|
||||
Node: Bash History Facilities428100
|
||||
Node: Bash History Builtins431105
|
||||
Node: History Interaction436113
|
||||
Node: Event Designators439733
|
||||
Node: Word Designators441087
|
||||
Node: Modifiers442847
|
||||
Node: Installing Bash444658
|
||||
Node: Basic Installation445795
|
||||
Node: Compilers and Options449517
|
||||
Node: Compiling For Multiple Architectures450258
|
||||
Node: Installation Names451951
|
||||
Node: Specifying the System Type454060
|
||||
Node: Sharing Defaults454776
|
||||
Node: Operation Controls455449
|
||||
Node: Optional Features456407
|
||||
Node: Reporting Bugs467625
|
||||
Node: Major Differences From The Bourne Shell468900
|
||||
Node: GNU Free Documentation License485750
|
||||
Node: Indexes510927
|
||||
Node: Builtin Index511381
|
||||
Node: Reserved Word Index518208
|
||||
Node: Variable Index520656
|
||||
Node: Function Index537430
|
||||
Node: Concept Index551214
|
||||
Node: Command Grouping49062
|
||||
Node: Coprocesses50540
|
||||
Node: GNU Parallel53203
|
||||
Node: Shell Functions54120
|
||||
Node: Shell Parameters62005
|
||||
Node: Positional Parameters66393
|
||||
Node: Special Parameters67295
|
||||
Node: Shell Expansions70509
|
||||
Node: Brace Expansion72636
|
||||
Node: Tilde Expansion75370
|
||||
Node: Shell Parameter Expansion77991
|
||||
Node: Command Substitution96342
|
||||
Node: Arithmetic Expansion97697
|
||||
Node: Process Substitution98665
|
||||
Node: Word Splitting99785
|
||||
Node: Filename Expansion101729
|
||||
Node: Pattern Matching104478
|
||||
Node: Quote Removal109135
|
||||
Node: Redirections109430
|
||||
Node: Executing Commands119090
|
||||
Node: Simple Command Expansion119760
|
||||
Node: Command Search and Execution121870
|
||||
Node: Command Execution Environment124248
|
||||
Node: Environment127283
|
||||
Node: Exit Status128946
|
||||
Node: Signals130730
|
||||
Node: Shell Scripts134179
|
||||
Node: Shell Builtin Commands137206
|
||||
Node: Bourne Shell Builtins139244
|
||||
Node: Bash Builtins160705
|
||||
Node: Modifying Shell Behavior191561
|
||||
Node: The Set Builtin191906
|
||||
Node: The Shopt Builtin202507
|
||||
Node: Special Builtins218419
|
||||
Node: Shell Variables219398
|
||||
Node: Bourne Shell Variables219835
|
||||
Node: Bash Variables221939
|
||||
Node: Bash Features254755
|
||||
Node: Invoking Bash255768
|
||||
Node: Bash Startup Files261781
|
||||
Node: Interactive Shells266912
|
||||
Node: What is an Interactive Shell?267322
|
||||
Node: Is this Shell Interactive?267971
|
||||
Node: Interactive Shell Behavior268786
|
||||
Node: Bash Conditional Expressions272415
|
||||
Node: Shell Arithmetic277057
|
||||
Node: Aliases280001
|
||||
Node: Arrays282614
|
||||
Node: The Directory Stack289005
|
||||
Node: Directory Stack Builtins289789
|
||||
Node: Controlling the Prompt294049
|
||||
Node: The Restricted Shell297014
|
||||
Node: Bash POSIX Mode299624
|
||||
Node: Shell Compatibility Mode311548
|
||||
Node: Job Control319591
|
||||
Node: Job Control Basics320051
|
||||
Node: Job Control Builtins325053
|
||||
Node: Job Control Variables330847
|
||||
Node: Command Line Editing332003
|
||||
Node: Introduction and Notation333674
|
||||
Node: Readline Interaction335297
|
||||
Node: Readline Bare Essentials336488
|
||||
Node: Readline Movement Commands338271
|
||||
Node: Readline Killing Commands339231
|
||||
Node: Readline Arguments341149
|
||||
Node: Searching342193
|
||||
Node: Readline Init File344379
|
||||
Node: Readline Init File Syntax345640
|
||||
Node: Conditional Init Constructs368839
|
||||
Node: Sample Init File373035
|
||||
Node: Bindable Readline Commands376159
|
||||
Node: Commands For Moving377363
|
||||
Node: Commands For History379414
|
||||
Node: Commands For Text384408
|
||||
Node: Commands For Killing388057
|
||||
Node: Numeric Arguments391090
|
||||
Node: Commands For Completion392229
|
||||
Node: Keyboard Macros396420
|
||||
Node: Miscellaneous Commands397107
|
||||
Node: Readline vi Mode403046
|
||||
Node: Programmable Completion403953
|
||||
Node: Programmable Completion Builtins411733
|
||||
Node: A Programmable Completion Example422485
|
||||
Node: Using History Interactively427732
|
||||
Node: Bash History Facilities428416
|
||||
Node: Bash History Builtins431421
|
||||
Node: History Interaction436429
|
||||
Node: Event Designators440049
|
||||
Node: Word Designators441403
|
||||
Node: Modifiers443163
|
||||
Node: Installing Bash444974
|
||||
Node: Basic Installation446111
|
||||
Node: Compilers and Options449833
|
||||
Node: Compiling For Multiple Architectures450574
|
||||
Node: Installation Names452267
|
||||
Node: Specifying the System Type454376
|
||||
Node: Sharing Defaults455092
|
||||
Node: Operation Controls455765
|
||||
Node: Optional Features456723
|
||||
Node: Reporting Bugs467941
|
||||
Node: Major Differences From The Bourne Shell469216
|
||||
Node: GNU Free Documentation License486066
|
||||
Node: Indexes511243
|
||||
Node: Builtin Index511697
|
||||
Node: Reserved Word Index518524
|
||||
Node: Variable Index520972
|
||||
Node: Function Index537746
|
||||
Node: Concept Index551530
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
+4
-4
@@ -1096,16 +1096,16 @@ select @var{name} [in @var{words} @dots{}]; do @var{commands}; done
|
||||
@end example
|
||||
|
||||
The list of words following @code{in} is expanded, generating a list
|
||||
of items. The set of expanded words is printed on the standard
|
||||
of items, and the set of expanded words is printed on the standard
|
||||
error output stream, each preceded by a number. If the
|
||||
@samp{in @var{words}} is omitted, the positional parameters are printed,
|
||||
as if @samp{in "$@@"} had been specified.
|
||||
The @env{PS3} prompt is then displayed and a line is read from the
|
||||
standard input.
|
||||
@code{select} then displays the @env{PS3}
|
||||
prompt and reads a line from the standard input.
|
||||
If the line consists of a number corresponding to one of the displayed
|
||||
words, then the value of @var{name} is set to that word.
|
||||
If the line is empty, the words and prompt are displayed again.
|
||||
If @code{EOF} is read, the @code{select} command completes.
|
||||
If @code{EOF} is read, the @code{select} command completes and returns 1.
|
||||
Any other value read causes @var{name} to be set to null.
|
||||
The line read is saved in the variable @env{REPLY}.
|
||||
|
||||
|
||||
@@ -139,8 +139,8 @@
|
||||
#define COMMA ','
|
||||
|
||||
/* This should be the function corresponding to the operator with the
|
||||
highest precedence. */
|
||||
#define EXP_HIGHEST expcomma
|
||||
lowest precedence. */
|
||||
#define EXP_LOWEST expcomma
|
||||
|
||||
#ifndef MAX_INT_LEN
|
||||
# define MAX_INT_LEN 32
|
||||
@@ -472,8 +472,9 @@ subexpr (expr)
|
||||
|
||||
readtok ();
|
||||
|
||||
val = EXP_HIGHEST ();
|
||||
val = EXP_LOWEST ();
|
||||
|
||||
/*TAG:bash-5.3 make it clear that these are arithmetic syntax errors */
|
||||
if (curtok != 0)
|
||||
evalerror (_("syntax error in expression"));
|
||||
|
||||
@@ -639,7 +640,7 @@ expcond ()
|
||||
if (curtok == 0 || curtok == COL)
|
||||
evalerror (_("expression expected"));
|
||||
|
||||
val1 = EXP_HIGHEST ();
|
||||
val1 = EXP_LOWEST ();
|
||||
|
||||
if (set_noeval)
|
||||
noeval--;
|
||||
@@ -1051,7 +1052,7 @@ exp0 ()
|
||||
{
|
||||
/* XXX - save curlval here? Or entire expression context? */
|
||||
readtok ();
|
||||
val = EXP_HIGHEST ();
|
||||
val = EXP_LOWEST ();
|
||||
|
||||
if (curtok != RPAR) /* ( */
|
||||
evalerror (_("missing `)'"));
|
||||
@@ -1446,9 +1447,14 @@ readtok ()
|
||||
c = POWER;
|
||||
else if ((c == '-' || c == '+') && c1 == c && curtok == STR)
|
||||
c = (c == '-') ? POSTDEC : POSTINC;
|
||||
#if STRICT_ARITH_PARSING
|
||||
else if ((c == '-' || c == '+') && c1 == c && curtok == NUM)
|
||||
#else
|
||||
else if ((c == '-' || c == '+') && c1 == c && curtok == NUM && (lasttok == PREINC || lasttok == PREDEC))
|
||||
#endif
|
||||
{
|
||||
/* This catches something like --FOO++ */
|
||||
/* TAG:bash-5.3 add gettext calls here or make this a separate function */
|
||||
if (c == '-')
|
||||
evalerror ("--: assignment requires lvalue");
|
||||
else
|
||||
@@ -1465,7 +1471,7 @@ readtok ()
|
||||
c = (c == '-') ? PREDEC : PREINC;
|
||||
else
|
||||
/* Could force parsing as preinc or predec and throw an error */
|
||||
#if 0
|
||||
#if STRICT_ARITH_PARSING
|
||||
{
|
||||
/* Posix says unary plus and minus have higher priority than
|
||||
preinc and predec. */
|
||||
@@ -1541,7 +1547,7 @@ strlong (num)
|
||||
register char *s;
|
||||
register unsigned char c;
|
||||
int base, foundbase;
|
||||
intmax_t val;
|
||||
intmax_t val, pval;
|
||||
|
||||
s = num;
|
||||
|
||||
@@ -1559,6 +1565,10 @@ strlong (num)
|
||||
{
|
||||
base = 16;
|
||||
s++;
|
||||
#if STRICT_ARITH_PARSING
|
||||
if (*s == 0)
|
||||
evalerror (_("invalid number"));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
base = 8;
|
||||
@@ -1602,7 +1612,14 @@ strlong (num)
|
||||
if (c >= base)
|
||||
evalerror (_("value too great for base"));
|
||||
|
||||
#ifdef CHECK_OVERFLOW
|
||||
pval = val;
|
||||
val = (val * base) + c;
|
||||
if (val < 0 || val < pval) /* overflow */
|
||||
return INTMAX_MAX;
|
||||
#else
|
||||
val = (val * base) + c;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
@@ -2282,6 +2282,7 @@ Names of all shell variables. May also be specified as @option{-v}.
|
||||
@item -C @var{command}
|
||||
@var{command} is executed in a subshell environment, and its output is
|
||||
used as the possible completions.
|
||||
Arguments are passed as with the @option{-F} option.
|
||||
|
||||
@item -F @var{function}
|
||||
The shell function @var{function} is executed in the current shell
|
||||
|
||||
@@ -194,7 +194,10 @@ rl_display_search (char *search_string, int flags, int where)
|
||||
|
||||
rl_message ("%s", message);
|
||||
xfree (message);
|
||||
#if 0
|
||||
/* rl_message calls this */
|
||||
(*rl_redisplay_function) ();
|
||||
#endif
|
||||
}
|
||||
|
||||
static _rl_search_cxt *
|
||||
|
||||
@@ -114,6 +114,16 @@ typedef void *alias_t;
|
||||
# define MBTEST(x) ((x))
|
||||
#endif
|
||||
|
||||
#define EXTEND_SHELL_INPUT_LINE_PROPERTY() \
|
||||
do { \
|
||||
if (shell_input_line_len + 2 > shell_input_line_propsize) \
|
||||
{ \
|
||||
shell_input_line_propsize = shell_input_line_len + 2; \
|
||||
shell_input_line_property = (char *)xrealloc (shell_input_line_property, \
|
||||
shell_input_line_propsize); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#if defined (EXTENDED_GLOB)
|
||||
extern int extended_glob;
|
||||
#endif
|
||||
@@ -2555,21 +2565,12 @@ shell_getc (remove_quoted_newline)
|
||||
shell_input_line[shell_input_line_len] = '\n';
|
||||
shell_input_line[shell_input_line_len + 1] = '\0';
|
||||
|
||||
#if 0
|
||||
set_line_mbstate (); /* XXX - this is wasteful */
|
||||
#else
|
||||
# if defined (HANDLE_MULTIBYTE)
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
/* This is kind of an abstraction violation, but there's no need to
|
||||
go through the entire shell_input_line again with a call to
|
||||
set_line_mbstate(). */
|
||||
if (shell_input_line_len + 2 > shell_input_line_propsize)
|
||||
{
|
||||
shell_input_line_propsize = shell_input_line_len + 2;
|
||||
shell_input_line_property = (char *)xrealloc (shell_input_line_property,
|
||||
shell_input_line_propsize);
|
||||
}
|
||||
EXTEND_SHELL_INPUT_LINE_PROPERTY();
|
||||
shell_input_line_property[shell_input_line_len] = 1;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -2622,6 +2623,21 @@ next_alias_char:
|
||||
(current_delimiter (dstack) != '\'' && current_delimiter (dstack) != '"'))
|
||||
{
|
||||
parser_state |= PST_ENDALIAS;
|
||||
/* We need to do this to make sure last_shell_getc_is_singlebyte returns
|
||||
true, since we are returning a single-byte space. */
|
||||
if (shell_input_line_index == shell_input_line_len && last_shell_getc_is_singlebyte == 0)
|
||||
{
|
||||
#if 0
|
||||
EXTEND_SHELL_INPUT_LINE_PROPERTY();
|
||||
shell_input_line_property[shell_input_line_len++] = 1;
|
||||
/* extend shell_input_line to accommodate the shell_ungetc that
|
||||
read_token_word() will perform, since we're extending the index */
|
||||
RESIZE_MALLOCED_BUFFER (shell_input_line, shell_input_line_index, 2, shell_input_line_size, 16);
|
||||
shell_input_line[++shell_input_line_index] = '\0'; /* XXX */
|
||||
#else
|
||||
shell_input_line_property[shell_input_line_index - 1] = 1;
|
||||
#endif
|
||||
}
|
||||
return ' '; /* END_ALIAS */
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -41,3 +41,5 @@ baz
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
<áa>
|
||||
<aá>
|
||||
|
||||
@@ -62,3 +62,4 @@ ${THIS_SH} ./alias2.sub
|
||||
${THIS_SH} ./alias3.sub
|
||||
${THIS_SH} ./alias4.sub
|
||||
${THIS_SH} ./alias5.sub
|
||||
${THIS_SH} ./alias6.sub
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# make sure aliases that end in multibyte characters don't interfere with the
|
||||
# space sentinel alias expansion adds; problem through bash-5.1
|
||||
shopt -s expand_aliases
|
||||
|
||||
LC_ALL=en_US.UTF-8
|
||||
|
||||
alias a1='printf "<%s>\\n" áa'
|
||||
a1
|
||||
|
||||
alias a2='printf "<%s>\\n" aá'
|
||||
a2
|
||||
|
||||
unalias a1 a2
|
||||
@@ -19,6 +19,7 @@ argv[1] = <sed> argv[2] = <-e> argv[3] = <s/[^I:]//g>
|
||||
argv[1] = <foo\^Jbar>
|
||||
argv[1] = <foobar>
|
||||
argv[1] = <foo\^Jbar>
|
||||
nested
|
||||
#esac
|
||||
a
|
||||
ok 1
|
||||
@@ -62,5 +63,6 @@ ok 4
|
||||
ok 5
|
||||
ok 6
|
||||
ok 7
|
||||
ok 9
|
||||
ok 8
|
||||
ok 8
|
||||
|
||||
@@ -69,6 +69,13 @@ comsub_foo_1()
|
||||
echo $(while true; do case $HOME in /*) echo abs ;; esac; done)
|
||||
}
|
||||
|
||||
echo $(
|
||||
echo $(
|
||||
echo $(echo $( echo nested )
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
${THIS_SH} ./comsub1.sub
|
||||
${THIS_SH} ./comsub2.sub
|
||||
${THIS_SH} ./comsub3.sub
|
||||
|
||||
@@ -36,6 +36,12 @@ echo "$( nest echo ok 7 ) )"
|
||||
|
||||
alias short='echo ok 8 )'
|
||||
|
||||
alias DO='{ '
|
||||
alias DONE='}'
|
||||
got=$(DO
|
||||
echo ok 9; DONE)
|
||||
echo "$got"
|
||||
|
||||
echo $( short
|
||||
echo "$( short "
|
||||
|
||||
|
||||
Reference in New Issue
Block a user