mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-01 09:29:51 +02:00
updates for nofork command substitution; changes for z/OS machines; fix for race in wait_for_any_job
This commit is contained in:
@@ -6331,3 +6331,61 @@ builtins/evalstring.c
|
||||
doc/bash.1,doc/bashref.texi
|
||||
- function substitution (or lambda substitution, or nofork command
|
||||
substitution): document
|
||||
|
||||
5/15
|
||||
----
|
||||
subst.c
|
||||
- function_substitute: make sure to decrement variable_context in the
|
||||
unwind-protects since we don't unwind_protect it individually.
|
||||
Report from Oguz <oguzismailuysal@gmail.com>
|
||||
|
||||
5/17
|
||||
----
|
||||
configure.ac
|
||||
- i370 machines cannot use the bash malloc
|
||||
Patch from Igor Todorovski <itodorov@ca.ibm.com>
|
||||
|
||||
support/signames.c
|
||||
- initialize_signames: add support for z/OS signals.
|
||||
Patch from Igor Todorovski <itodorov@ca.ibm.com>
|
||||
|
||||
lib/glob/smatch.c
|
||||
- collseqcmp: new name for collequiv[_wc], that function apparently
|
||||
exists in libc on z/OS
|
||||
Patch from Igor Todorovski <itodorov@ca.ibm.com>
|
||||
|
||||
jobs.c
|
||||
- mark_all_jobs_as_dead: make sure to reset js.j_ndead to the right
|
||||
number of jobs in the array
|
||||
|
||||
execute_cmd.c
|
||||
- execute_while_or_until: move call to REAP() after the action
|
||||
executes, like other loop functions
|
||||
|
||||
shell.c,parse.y,lib/intl/gettextP.h
|
||||
- add some __MVS__ checks for z/OS systems
|
||||
|
||||
5/18
|
||||
----
|
||||
jobs.c
|
||||
- wait_for_any_job: catch jobs that can terminate and be reaped
|
||||
when we call UNBLOCK_CHILD between the loop where we check the
|
||||
jobs list for dead jobs and the loop where we check for running
|
||||
jobs and poll for them with wait_for().
|
||||
Fixes bug reported by Aleksey Covacevice <aleksey.covacevice@gmail.com>
|
||||
|
||||
5/20
|
||||
----
|
||||
subst.c
|
||||
- read_comsub: quote CTLNUL if it's in $IFS and we're parsing the
|
||||
RHS of an assignment statement
|
||||
- comsub_quote_string: ditto
|
||||
- comsub_shouldquote: break code that decides whether to CTLESC escape
|
||||
a character read from a command substitution or $REPLY into its own
|
||||
inline function; change read_comsub/comsub_quote_string callers
|
||||
|
||||
5/21
|
||||
----
|
||||
subst.c
|
||||
- quote_escapes_internal: use ifs_cmap instead of iterating through
|
||||
ifs_value to set skip_ctlesc and skip_ctlnul
|
||||
|
||||
@@ -1017,6 +1017,9 @@ tests/comsub2.tests f
|
||||
tests/comsub2.right f
|
||||
tests/comsub21.sub f
|
||||
tests/comsub22.sub f
|
||||
tests/comsub23.sub f
|
||||
tests/comsub24.sub f
|
||||
tests/comsub25.sub f
|
||||
tests/comsub-eof.tests f
|
||||
tests/comsub-eof0.sub f
|
||||
tests/comsub-eof1.sub f
|
||||
|
||||
+2
-1
@@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
AC_REVISION([for Bash 5.2, version 5.050])dnl
|
||||
AC_REVISION([for Bash 5.2, version 5.051])dnl
|
||||
|
||||
define(bashvers, 5.2)
|
||||
define(relstatus, maint)
|
||||
@@ -75,6 +75,7 @@ m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir
|
||||
*-beos*) opt_bash_malloc=no ;; # they say it's suitable
|
||||
# These need additional investigation
|
||||
sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
|
||||
i370-*) opt_bash_malloc=no ;; # IBM z/OS machines
|
||||
*-aix*) opt_bash_malloc=no ;; # AIX machines
|
||||
*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
|
||||
# These lack a working sbrk(2)
|
||||
|
||||
+12
-6
@@ -1997,20 +1997,22 @@ EEXXPPAANNSSIIOONN
|
||||
|
||||
There is an alternate form of command substitution:
|
||||
|
||||
$${{_C _c_o_m_m_a_n_d;;}}
|
||||
$${{_c _c_o_m_m_a_n_d;;}}
|
||||
|
||||
which executes _c_o_m_m_a_n_d in the current execution environment. This
|
||||
means that side effects of _c_o_m_m_a_n_d take effect immediately in the cur-
|
||||
rent execution environment and persist in the current environment after
|
||||
the command completes (e.g., the eexxiitt builtin will exit the shell).
|
||||
which executes _c_o_m_m_a_n_d in the current execution environment and cap-
|
||||
tures its output, again with trailing newlines removed.
|
||||
|
||||
The character _C following the open brace must be a space, tab, newline,
|
||||
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 reserved
|
||||
word may appear (i.e., preceded by a command terminator such as semi-
|
||||
colon). BBaasshh allows the close brace to be joined to the remaining
|
||||
characters in the word without being followed by a shell metacharacter
|
||||
as a reserved word would usually require.
|
||||
|
||||
Any side effects of _c_o_m_m_a_n_d take effect immediately in the current exe-
|
||||
cution environment and persist in the current environment after the
|
||||
command completes (e.g., the eexxiitt builtin will exit the shell).
|
||||
|
||||
This type of command substitution superficially resembles executing an
|
||||
unnamed shell function: local variables are created as when a shell
|
||||
function is executing, and the rreettuurrnn builtin forces _c_o_m_m_a_n_d to com-
|
||||
@@ -5134,6 +5136,8 @@ SSHHEELLLL 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
|
||||
@@ -6360,6 +6364,8 @@ SSHHEELLLL 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
|
||||
|
||||
+15
-7
@@ -3615,16 +3615,13 @@ parentheses make up the command; none are treated specially.
|
||||
There is an alternate form of command substitution:
|
||||
.RS
|
||||
.PP
|
||||
\fB${\fP\fIC\fP \fIcommand\fP\fB;\fP\|\fB}\fP
|
||||
\fB${\fP\fIc\fP \fIcommand\fP\fB;\fP\|\fB}\fP
|
||||
.RE
|
||||
.PP
|
||||
which executes \fIcommand\fP in the current execution environment.
|
||||
This means that side effects of \fIcommand\fP take effect immediately
|
||||
in the current execution environment and persist in the current
|
||||
environment after the command completes (e.g., the \fBexit\fP builtin
|
||||
will exit the shell).
|
||||
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,
|
||||
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
|
||||
where a reserved word may appear (i.e., preceded by a command terminator
|
||||
such as semicolon).
|
||||
@@ -3632,6 +3629,11 @@ such as semicolon).
|
||||
the word without being followed by a shell metacharacter as a reserved
|
||||
word would usually require.
|
||||
.PP
|
||||
Any side effects of \fIcommand\fP take effect immediately
|
||||
in the current execution environment and persist in the current
|
||||
environment after the command completes (e.g., the \fBexit\fP builtin
|
||||
will exit the shell).
|
||||
.PP
|
||||
This type of command substitution superficially resembles executing an
|
||||
unnamed shell function: local variables are created as when a shell
|
||||
function is executing, and the \fBreturn\fP builtin forces
|
||||
@@ -8883,6 +8885,9 @@ is supplied with a
|
||||
.I name
|
||||
that is not a function.
|
||||
.TP
|
||||
\fBfalse\fP
|
||||
Does nothing, returns a non-zero status.
|
||||
.TP
|
||||
\fBfc\fP [\fB\-e\fP \fIename\fP] [\fB\-lnr\fP] [\fIfirst\fP] [\fIlast\fP]
|
||||
.PD 0
|
||||
.TP
|
||||
@@ -11140,6 +11145,9 @@ is invalid; otherwise
|
||||
.B trap
|
||||
returns true.
|
||||
.TP
|
||||
\fBtrue\fP
|
||||
Does nothing, returns a 0 status.
|
||||
.TP
|
||||
\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...]
|
||||
With no options,
|
||||
indicate how each
|
||||
|
||||
+16
-9
@@ -4510,19 +4510,16 @@ There is an alternate form of command substitution:
|
||||
<DL COMPACT><DT><DD>
|
||||
<P>
|
||||
|
||||
<B>${</B><I>C</I> <I>command</I><B>;</B><B>}</B>
|
||||
<B>${</B><I>c</I> <I>command</I><B>;</B><B>}</B>
|
||||
</DL>
|
||||
|
||||
<P>
|
||||
|
||||
which executes <I>command</I> in the current execution environment.
|
||||
This means that side effects of <I>command</I> take effect immediately
|
||||
in the current execution environment and persist in the current
|
||||
environment after the command completes (e.g., the <B>exit</B> builtin
|
||||
will exit the shell).
|
||||
which executes <I>command</I> in the current execution environment
|
||||
and captures its output, again with trailing newlines removed.
|
||||
<P>
|
||||
|
||||
The character <I>C</I> following the open brace must be a space, tab,
|
||||
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
|
||||
where a reserved word may appear (i.e., preceded by a command terminator
|
||||
such as semicolon).
|
||||
@@ -4531,6 +4528,12 @@ the word without being followed by a shell metacharacter as a reserved
|
||||
word would usually require.
|
||||
<P>
|
||||
|
||||
Any side effects of <I>command</I> take effect immediately
|
||||
in the current execution environment and persist in the current
|
||||
environment after the command completes (e.g., the <B>exit</B> builtin
|
||||
will exit the shell).
|
||||
<P>
|
||||
|
||||
This type of command substitution superficially resembles executing an
|
||||
unnamed shell function: local variables are created as when a shell
|
||||
function is executing, and the <B>return</B> builtin forces
|
||||
@@ -11192,6 +11195,8 @@ is supplied with a
|
||||
<I>name</I>
|
||||
|
||||
that is not a function.
|
||||
<DT><B>false</B><DD>
|
||||
Does nothing, returns a non-zero status.
|
||||
<DT><B>fc</B> [<B>-e</B> <I>ename</I>] [<B>-lnr</B>] [<I>first</I>] [<I>last</I>]<DD>
|
||||
|
||||
<DT><B>fc</B> <B>-s</B> [<I>pat</I>=<I>rep</I>] [<I>cmd</I>]<DD>
|
||||
@@ -13993,6 +13998,8 @@ is invalid; otherwise
|
||||
<B>trap</B>
|
||||
|
||||
returns true.
|
||||
<DT><B>true</B><DD>
|
||||
Does nothing, returns a 0 status.
|
||||
<DT><B>type</B> [<B>-aftpP</B>] <I>name</I> [<I>name</I> ...]<DD>
|
||||
With no options,
|
||||
indicate how each
|
||||
@@ -15101,7 +15108,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-20230509/doc/bash.1.<BR>
|
||||
Time: 14 May 2023 15:37:14 EDT
|
||||
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
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
+129
-113
@@ -2245,7 +2245,7 @@ command is enclosed as follows:
|
||||
or (deprecated)
|
||||
`COMMAND`.
|
||||
|
||||
Bash performs the expansion by executing COMMAND in a subshell
|
||||
Bash performs command substitution by executing COMMAND in a subshell
|
||||
environment and replacing the command substitution with the standard
|
||||
output of the command, with any trailing newlines deleted. Embedded
|
||||
newlines are not deleted, but they may be removed during word splitting.
|
||||
@@ -2262,10 +2262,8 @@ the parentheses make up the command; none are treated specially.
|
||||
|
||||
${C COMMAND; }
|
||||
|
||||
which executes COMMAND in the current execution environment. This means
|
||||
that side effects of COMMAND take effect immediately in the current
|
||||
execution environment and persist in the current environment after the
|
||||
command completes (e.g., the 'exit' builtin will exit the shell).
|
||||
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
|
||||
@@ -2274,6 +2272,10 @@ semicolon). Bash allows the close brace to be joined to the remaining
|
||||
characters in the word without being followed by a shell metacharacter
|
||||
as a reserved word would usually require.
|
||||
|
||||
Any side effects of COMMAND take effect immediately in the current
|
||||
execution environment and persist in the current environment after the
|
||||
command completes (e.g., the 'exit' builtin will exit the shell).
|
||||
|
||||
This type of command substitution superficially resembles executing
|
||||
an unnamed shell function: local variables are created as when a shell
|
||||
function is executing, and the 'return' builtin forces COMMAND to
|
||||
@@ -3402,6 +3404,11 @@ standard.
|
||||
of the names is not a valid shell variable name, or '-f' is
|
||||
supplied with a name that is not a shell function.
|
||||
|
||||
'false'
|
||||
false
|
||||
|
||||
Does nothing, returns a non-zero status.
|
||||
|
||||
'getopts'
|
||||
getopts OPTSTRING NAME [ARG ...]
|
||||
|
||||
@@ -3682,6 +3689,11 @@ standard.
|
||||
The return status is zero unless a SIGSPEC does not specify a valid
|
||||
signal.
|
||||
|
||||
'true'
|
||||
true
|
||||
|
||||
Does nothing, returns a 0 status.
|
||||
|
||||
'umask'
|
||||
umask [-p] [-S] [MODE]
|
||||
|
||||
@@ -11993,7 +12005,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* :: Bourne Shell Builtins.
|
||||
(line 11)
|
||||
* [: Bourne Shell Builtins.
|
||||
(line 275)
|
||||
(line 280)
|
||||
* alias: Bash Builtins. (line 11)
|
||||
* bg: Job Control Builtins.
|
||||
(line 7)
|
||||
@@ -12028,14 +12040,16 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 125)
|
||||
* export: Bourne Shell Builtins.
|
||||
(line 132)
|
||||
* false: Bourne Shell Builtins.
|
||||
(line 148)
|
||||
* fc: Bash History Builtins.
|
||||
(line 10)
|
||||
* fg: Job Control Builtins.
|
||||
(line 17)
|
||||
* getopts: Bourne Shell Builtins.
|
||||
(line 148)
|
||||
(line 153)
|
||||
* hash: Bourne Shell Builtins.
|
||||
(line 192)
|
||||
(line 197)
|
||||
* help: Bash Builtins. (line 342)
|
||||
* history: Bash History Builtins.
|
||||
(line 46)
|
||||
@@ -12053,34 +12067,36 @@ D.1 Index of Shell Builtin Commands
|
||||
* pushd: Directory Stack Builtins.
|
||||
(line 69)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 212)
|
||||
(line 217)
|
||||
* read: Bash Builtins. (line 504)
|
||||
* readarray: Bash Builtins. (line 601)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 222)
|
||||
(line 227)
|
||||
* return: Bourne Shell Builtins.
|
||||
(line 241)
|
||||
(line 246)
|
||||
* set: The Set Builtin. (line 11)
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 262)
|
||||
(line 267)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 610)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 116)
|
||||
* test: Bourne Shell Builtins.
|
||||
(line 275)
|
||||
(line 280)
|
||||
* times: Bourne Shell Builtins.
|
||||
(line 360)
|
||||
(line 365)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 366)
|
||||
(line 371)
|
||||
* true: Bourne Shell Builtins.
|
||||
(line 433)
|
||||
* type: Bash Builtins. (line 615)
|
||||
* typeset: Bash Builtins. (line 653)
|
||||
* ulimit: Bash Builtins. (line 659)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 428)
|
||||
(line 438)
|
||||
* unalias: Bash Builtins. (line 765)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 446)
|
||||
(line 456)
|
||||
* wait: Job Control Builtins.
|
||||
(line 76)
|
||||
|
||||
@@ -12789,102 +12805,102 @@ Node: Brace Expansion72539
|
||||
Node: Tilde Expansion75270
|
||||
Node: Shell Parameter Expansion77888
|
||||
Node: Command Substitution96287
|
||||
Node: Arithmetic Expansion99876
|
||||
Node: Process Substitution100841
|
||||
Node: Word Splitting101958
|
||||
Node: Filename Expansion104003
|
||||
Node: Pattern Matching106933
|
||||
Node: Quote Removal111932
|
||||
Node: Redirections112224
|
||||
Node: Executing Commands121914
|
||||
Node: Simple Command Expansion122581
|
||||
Node: Command Search and Execution124688
|
||||
Node: Command Execution Environment127072
|
||||
Node: Environment130104
|
||||
Node: Exit Status131764
|
||||
Node: Signals133545
|
||||
Node: Shell Scripts136991
|
||||
Node: Shell Builtin Commands140015
|
||||
Node: Bourne Shell Builtins142050
|
||||
Node: Bash Builtins164246
|
||||
Node: Modifying Shell Behavior196242
|
||||
Node: The Set Builtin196584
|
||||
Node: The Shopt Builtin207179
|
||||
Node: Special Builtins223088
|
||||
Node: Shell Variables224064
|
||||
Node: Bourne Shell Variables224498
|
||||
Node: Bash Variables226599
|
||||
Node: Bash Features260661
|
||||
Node: Invoking Bash261671
|
||||
Node: Bash Startup Files267681
|
||||
Node: Interactive Shells272809
|
||||
Node: What is an Interactive Shell?273217
|
||||
Node: Is this Shell Interactive?273863
|
||||
Node: Interactive Shell Behavior274675
|
||||
Node: Bash Conditional Expressions278301
|
||||
Node: Shell Arithmetic282940
|
||||
Node: Aliases285898
|
||||
Node: Arrays288789
|
||||
Node: The Directory Stack295349
|
||||
Node: Directory Stack Builtins296130
|
||||
Node: Controlling the Prompt300387
|
||||
Node: The Restricted Shell303349
|
||||
Node: Bash POSIX Mode305956
|
||||
Node: Shell Compatibility Mode321746
|
||||
Node: Job Control329987
|
||||
Node: Job Control Basics330444
|
||||
Node: Job Control Builtins335443
|
||||
Node: Job Control Variables341235
|
||||
Node: Command Line Editing342388
|
||||
Node: Introduction and Notation344056
|
||||
Node: Readline Interaction345676
|
||||
Node: Readline Bare Essentials346864
|
||||
Node: Readline Movement Commands348650
|
||||
Node: Readline Killing Commands349607
|
||||
Node: Readline Arguments351525
|
||||
Node: Searching352566
|
||||
Node: Readline Init File354749
|
||||
Node: Readline Init File Syntax356007
|
||||
Node: Conditional Init Constructs379795
|
||||
Node: Sample Init File383988
|
||||
Node: Bindable Readline Commands387109
|
||||
Node: Commands For Moving388310
|
||||
Node: Commands For History390358
|
||||
Node: Commands For Text395349
|
||||
Node: Commands For Killing398995
|
||||
Node: Numeric Arguments402025
|
||||
Node: Commands For Completion403161
|
||||
Node: Keyboard Macros407349
|
||||
Node: Miscellaneous Commands408034
|
||||
Node: Readline vi Mode414069
|
||||
Node: Programmable Completion414973
|
||||
Node: Programmable Completion Builtins422750
|
||||
Node: A Programmable Completion Example433735
|
||||
Node: Using History Interactively438980
|
||||
Node: Bash History Facilities439661
|
||||
Node: Bash History Builtins442663
|
||||
Node: History Interaction447684
|
||||
Node: Event Designators451301
|
||||
Node: Word Designators452652
|
||||
Node: Modifiers454409
|
||||
Node: Installing Bash456214
|
||||
Node: Basic Installation457348
|
||||
Node: Compilers and Options461067
|
||||
Node: Compiling For Multiple Architectures461805
|
||||
Node: Installation Names463494
|
||||
Node: Specifying the System Type465600
|
||||
Node: Sharing Defaults466314
|
||||
Node: Operation Controls466984
|
||||
Node: Optional Features467939
|
||||
Node: Reporting Bugs479155
|
||||
Node: Major Differences From The Bourne Shell480486
|
||||
Node: GNU Free Documentation License497332
|
||||
Node: Indexes522506
|
||||
Node: Builtin Index522957
|
||||
Node: Reserved Word Index529781
|
||||
Node: Variable Index532226
|
||||
Node: Function Index549211
|
||||
Node: Concept Index562992
|
||||
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
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Binary file not shown.
+6869
-6813
File diff suppressed because it is too large
Load Diff
+4
-2
@@ -7,6 +7,7 @@
|
||||
\entry{exec}{51}{\code {exec}}
|
||||
\entry{exit}{51}{\code {exit}}
|
||||
\entry{export}{51}{\code {export}}
|
||||
\entry{false}{51}{\code {false}}
|
||||
\entry{getopts}{51}{\code {getopts}}
|
||||
\entry{hash}{52}{\code {hash}}
|
||||
\entry{pwd}{52}{\code {pwd}}
|
||||
@@ -17,20 +18,21 @@
|
||||
\entry{[}{53}{\code {[}}
|
||||
\entry{times}{55}{\code {times}}
|
||||
\entry{trap}{55}{\code {trap}}
|
||||
\entry{true}{56}{\code {true}}
|
||||
\entry{umask}{56}{\code {umask}}
|
||||
\entry{unset}{56}{\code {unset}}
|
||||
\entry{alias}{57}{\code {alias}}
|
||||
\entry{bind}{57}{\code {bind}}
|
||||
\entry{builtin}{58}{\code {builtin}}
|
||||
\entry{caller}{58}{\code {caller}}
|
||||
\entry{command}{58}{\code {command}}
|
||||
\entry{command}{59}{\code {command}}
|
||||
\entry{declare}{59}{\code {declare}}
|
||||
\entry{echo}{60}{\code {echo}}
|
||||
\entry{enable}{61}{\code {enable}}
|
||||
\entry{help}{62}{\code {help}}
|
||||
\entry{let}{62}{\code {let}}
|
||||
\entry{local}{62}{\code {local}}
|
||||
\entry{logout}{62}{\code {logout}}
|
||||
\entry{logout}{63}{\code {logout}}
|
||||
\entry{mapfile}{63}{\code {mapfile}}
|
||||
\entry{printf}{63}{\code {printf}}
|
||||
\entry{read}{64}{\code {read}}
|
||||
|
||||
+4
-2
@@ -14,7 +14,7 @@
|
||||
\initial {C}
|
||||
\entry{\code {caller}}{58}
|
||||
\entry{\code {cd}}{50}
|
||||
\entry{\code {command}}{58}
|
||||
\entry{\code {command}}{59}
|
||||
\entry{\code {compgen}}{150}
|
||||
\entry{\code {complete}}{150}
|
||||
\entry{\code {compopt}}{153}
|
||||
@@ -31,6 +31,7 @@
|
||||
\entry{\code {exit}}{51}
|
||||
\entry{\code {export}}{51}
|
||||
\initial {F}
|
||||
\entry{\code {false}}{51}
|
||||
\entry{\code {fc}}{157}
|
||||
\entry{\code {fg}}{118}
|
||||
\initial {G}
|
||||
@@ -46,7 +47,7 @@
|
||||
\initial {L}
|
||||
\entry{\code {let}}{62}
|
||||
\entry{\code {local}}{62}
|
||||
\entry{\code {logout}}{62}
|
||||
\entry{\code {logout}}{63}
|
||||
\initial {M}
|
||||
\entry{\code {mapfile}}{63}
|
||||
\initial {P}
|
||||
@@ -69,6 +70,7 @@
|
||||
\entry{\code {test}}{53}
|
||||
\entry{\code {times}}{55}
|
||||
\entry{\code {trap}}{55}
|
||||
\entry{\code {true}}{56}
|
||||
\entry{\code {type}}{66}
|
||||
\entry{\code {typeset}}{67}
|
||||
\initial {U}
|
||||
|
||||
+28
-8
@@ -3059,7 +3059,7 @@ enclosed as follows:
|
||||
<pre class="example">`<var>command</var>`.
|
||||
</pre></div>
|
||||
|
||||
<p>Bash performs the expansion by executing <var>command</var> in a subshell
|
||||
<p>Bash performs command substitution by executing <var>command</var> in a subshell
|
||||
environment and replacing the command substitution with the standard
|
||||
output of the command, with any trailing newlines deleted.
|
||||
Embedded newlines are not deleted, but they may be removed during
|
||||
@@ -3078,16 +3078,13 @@ the parentheses make up the command; none are treated specially.
|
||||
<p>There is an alternate form of command substitution:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example">${<var>C</var> <var>command</var>; }
|
||||
<pre class="example">${<var>c</var> <var>command</var>; }
|
||||
</pre></div>
|
||||
|
||||
<p>which executes <var>command</var> in the current execution environment.
|
||||
This means that side effects of <var>command</var> take effect immediately
|
||||
in the current execution environment and persist in the current
|
||||
environment after the command completes (e.g., the <code>exit</code> builtin
|
||||
will exit the shell).
|
||||
<p>which executes <var>command</var> in the current execution environment
|
||||
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,
|
||||
<p>The character <var>c</var> following the open brace must be a space, tab,
|
||||
newline, ‘<samp>(</samp>’, or ‘<samp>|</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).
|
||||
@@ -3095,6 +3092,11 @@ Bash allows the close brace to be joined to the remaining characters in
|
||||
the word without being followed by a shell metacharacter as a reserved
|
||||
word would usually require.
|
||||
</p>
|
||||
<p>Any side effects of <var>command</var> take effect immediately
|
||||
in the current execution environment and persist in the current
|
||||
environment after the command completes (e.g., the <code>exit</code> builtin
|
||||
will exit the shell).
|
||||
</p>
|
||||
<p>This type of command substitution superficially resembles executing an
|
||||
unnamed shell function: local variables are created as when a shell
|
||||
function is executing, and the <code>return</code> builtin forces
|
||||
@@ -4527,6 +4529,14 @@ the names is not a valid shell variable name, or <samp>-f</samp> is supplied
|
||||
with a name that is not a shell function.
|
||||
</p>
|
||||
</dd>
|
||||
<dt id='index-false'><span><code>false</code><a href='#index-false' class='copiable-anchor'> ¶</a></span></dt>
|
||||
<dd><div class="example">
|
||||
<pre class="example">false
|
||||
</pre></div>
|
||||
|
||||
<p>Does nothing, returns a non-zero status.
|
||||
</p>
|
||||
</dd>
|
||||
<dt id='index-getopts'><span><code>getopts</code><a href='#index-getopts' class='copiable-anchor'> ¶</a></span></dt>
|
||||
<dd><div class="example">
|
||||
<pre class="example">getopts <var>optstring</var> <var>name</var> [<var>arg</var> …]
|
||||
@@ -4889,6 +4899,14 @@ values in a subshell or subshell environment when one is created.
|
||||
valid signal.
|
||||
</p>
|
||||
</dd>
|
||||
<dt id='index-true'><span><code>true</code><a href='#index-true' class='copiable-anchor'> ¶</a></span></dt>
|
||||
<dd><div class="example">
|
||||
<pre class="example">true
|
||||
</pre></div>
|
||||
|
||||
<p>Does nothing, returns a 0 status.
|
||||
</p>
|
||||
</dd>
|
||||
<dt id='index-umask'><span><code>umask</code><a href='#index-umask' class='copiable-anchor'> ¶</a></span></dt>
|
||||
<dd><div class="example">
|
||||
<pre class="example">umask [-p] [-S] [<var>mode</var>]
|
||||
@@ -15186,6 +15204,7 @@ Next: <a href="#Reserved-Word-Index" accesskey="n" rel="next">Index of Shell Res
|
||||
<tr><td></td><td valign="top"><a href="#index-export"><code>export</code></a>:</td><td> </td><td valign="top"><a href="#Bourne-Shell-Builtins">Bourne Shell Builtins</a></td></tr>
|
||||
<tr><td colspan="4"> <hr></td></tr>
|
||||
<tr><th id="Builtin-Index_bt_letter-F">F</th><td></td><td></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-false"><code>false</code></a>:</td><td> </td><td valign="top"><a href="#Bourne-Shell-Builtins">Bourne Shell Builtins</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-fc"><code>fc</code></a>:</td><td> </td><td valign="top"><a href="#Bash-History-Builtins">Bash History Builtins</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-fg"><code>fg</code></a>:</td><td> </td><td valign="top"><a href="#Job-Control-Builtins">Job Control Builtins</a></td></tr>
|
||||
<tr><td colspan="4"> <hr></td></tr>
|
||||
@@ -15234,6 +15253,7 @@ Next: <a href="#Reserved-Word-Index" accesskey="n" rel="next">Index of Shell Res
|
||||
<tr><td></td><td valign="top"><a href="#index-test"><code>test</code></a>:</td><td> </td><td valign="top"><a href="#Bourne-Shell-Builtins">Bourne Shell Builtins</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-times"><code>times</code></a>:</td><td> </td><td valign="top"><a href="#Bourne-Shell-Builtins">Bourne Shell Builtins</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-trap"><code>trap</code></a>:</td><td> </td><td valign="top"><a href="#Bourne-Shell-Builtins">Bourne Shell Builtins</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-true"><code>true</code></a>:</td><td> </td><td valign="top"><a href="#Bourne-Shell-Builtins">Bourne Shell Builtins</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-type"><code>type</code></a>:</td><td> </td><td valign="top"><a href="#Bash-Builtins">Bash Builtins</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-typeset"><code>typeset</code></a>:</td><td> </td><td valign="top"><a href="#Bash-Builtins">Bash Builtins</a></td></tr>
|
||||
<tr><td colspan="4"> <hr></td></tr>
|
||||
|
||||
+129
-113
@@ -2246,7 +2246,7 @@ command is enclosed as follows:
|
||||
or (deprecated)
|
||||
`COMMAND`.
|
||||
|
||||
Bash performs the expansion by executing COMMAND in a subshell
|
||||
Bash performs command substitution by executing COMMAND in a subshell
|
||||
environment and replacing the command substitution with the standard
|
||||
output of the command, with any trailing newlines deleted. Embedded
|
||||
newlines are not deleted, but they may be removed during word splitting.
|
||||
@@ -2263,10 +2263,8 @@ the parentheses make up the command; none are treated specially.
|
||||
|
||||
${C COMMAND; }
|
||||
|
||||
which executes COMMAND in the current execution environment. This means
|
||||
that side effects of COMMAND take effect immediately in the current
|
||||
execution environment and persist in the current environment after the
|
||||
command completes (e.g., the 'exit' builtin will exit the shell).
|
||||
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
|
||||
@@ -2275,6 +2273,10 @@ semicolon). Bash allows the close brace to be joined to the remaining
|
||||
characters in the word without being followed by a shell metacharacter
|
||||
as a reserved word would usually require.
|
||||
|
||||
Any side effects of COMMAND take effect immediately in the current
|
||||
execution environment and persist in the current environment after the
|
||||
command completes (e.g., the 'exit' builtin will exit the shell).
|
||||
|
||||
This type of command substitution superficially resembles executing
|
||||
an unnamed shell function: local variables are created as when a shell
|
||||
function is executing, and the 'return' builtin forces COMMAND to
|
||||
@@ -3403,6 +3405,11 @@ standard.
|
||||
of the names is not a valid shell variable name, or '-f' is
|
||||
supplied with a name that is not a shell function.
|
||||
|
||||
'false'
|
||||
false
|
||||
|
||||
Does nothing, returns a non-zero status.
|
||||
|
||||
'getopts'
|
||||
getopts OPTSTRING NAME [ARG ...]
|
||||
|
||||
@@ -3683,6 +3690,11 @@ standard.
|
||||
The return status is zero unless a SIGSPEC does not specify a valid
|
||||
signal.
|
||||
|
||||
'true'
|
||||
true
|
||||
|
||||
Does nothing, returns a 0 status.
|
||||
|
||||
'umask'
|
||||
umask [-p] [-S] [MODE]
|
||||
|
||||
@@ -11994,7 +12006,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* :: Bourne Shell Builtins.
|
||||
(line 11)
|
||||
* [: Bourne Shell Builtins.
|
||||
(line 275)
|
||||
(line 280)
|
||||
* alias: Bash Builtins. (line 11)
|
||||
* bg: Job Control Builtins.
|
||||
(line 7)
|
||||
@@ -12029,14 +12041,16 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 125)
|
||||
* export: Bourne Shell Builtins.
|
||||
(line 132)
|
||||
* false: Bourne Shell Builtins.
|
||||
(line 148)
|
||||
* fc: Bash History Builtins.
|
||||
(line 10)
|
||||
* fg: Job Control Builtins.
|
||||
(line 17)
|
||||
* getopts: Bourne Shell Builtins.
|
||||
(line 148)
|
||||
(line 153)
|
||||
* hash: Bourne Shell Builtins.
|
||||
(line 192)
|
||||
(line 197)
|
||||
* help: Bash Builtins. (line 342)
|
||||
* history: Bash History Builtins.
|
||||
(line 46)
|
||||
@@ -12054,34 +12068,36 @@ D.1 Index of Shell Builtin Commands
|
||||
* pushd: Directory Stack Builtins.
|
||||
(line 69)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 212)
|
||||
(line 217)
|
||||
* read: Bash Builtins. (line 504)
|
||||
* readarray: Bash Builtins. (line 601)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 222)
|
||||
(line 227)
|
||||
* return: Bourne Shell Builtins.
|
||||
(line 241)
|
||||
(line 246)
|
||||
* set: The Set Builtin. (line 11)
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 262)
|
||||
(line 267)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 610)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 116)
|
||||
* test: Bourne Shell Builtins.
|
||||
(line 275)
|
||||
(line 280)
|
||||
* times: Bourne Shell Builtins.
|
||||
(line 360)
|
||||
(line 365)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 366)
|
||||
(line 371)
|
||||
* true: Bourne Shell Builtins.
|
||||
(line 433)
|
||||
* type: Bash Builtins. (line 615)
|
||||
* typeset: Bash Builtins. (line 653)
|
||||
* ulimit: Bash Builtins. (line 659)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 428)
|
||||
(line 438)
|
||||
* unalias: Bash Builtins. (line 765)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 446)
|
||||
(line 456)
|
||||
* wait: Job Control Builtins.
|
||||
(line 76)
|
||||
|
||||
@@ -12790,102 +12806,102 @@ Node: Brace Expansion72638
|
||||
Node: Tilde Expansion75372
|
||||
Node: Shell Parameter Expansion77993
|
||||
Node: Command Substitution96395
|
||||
Node: Arithmetic Expansion99987
|
||||
Node: Process Substitution100955
|
||||
Node: Word Splitting102075
|
||||
Node: Filename Expansion104123
|
||||
Node: Pattern Matching107056
|
||||
Node: Quote Removal112058
|
||||
Node: Redirections112353
|
||||
Node: Executing Commands122046
|
||||
Node: Simple Command Expansion122716
|
||||
Node: Command Search and Execution124826
|
||||
Node: Command Execution Environment127213
|
||||
Node: Environment130248
|
||||
Node: Exit Status131911
|
||||
Node: Signals133695
|
||||
Node: Shell Scripts137144
|
||||
Node: Shell Builtin Commands140171
|
||||
Node: Bourne Shell Builtins142209
|
||||
Node: Bash Builtins164408
|
||||
Node: Modifying Shell Behavior196407
|
||||
Node: The Set Builtin196752
|
||||
Node: The Shopt Builtin207350
|
||||
Node: Special Builtins223262
|
||||
Node: Shell Variables224241
|
||||
Node: Bourne Shell Variables224678
|
||||
Node: Bash Variables226782
|
||||
Node: Bash Features260847
|
||||
Node: Invoking Bash261860
|
||||
Node: Bash Startup Files267873
|
||||
Node: Interactive Shells273004
|
||||
Node: What is an Interactive Shell?273415
|
||||
Node: Is this Shell Interactive?274064
|
||||
Node: Interactive Shell Behavior274879
|
||||
Node: Bash Conditional Expressions278508
|
||||
Node: Shell Arithmetic283150
|
||||
Node: Aliases286111
|
||||
Node: Arrays289005
|
||||
Node: The Directory Stack295568
|
||||
Node: Directory Stack Builtins296352
|
||||
Node: Controlling the Prompt300612
|
||||
Node: The Restricted Shell303577
|
||||
Node: Bash POSIX Mode306187
|
||||
Node: Shell Compatibility Mode321980
|
||||
Node: Job Control330224
|
||||
Node: Job Control Basics330684
|
||||
Node: Job Control Builtins335686
|
||||
Node: Job Control Variables341481
|
||||
Node: Command Line Editing342637
|
||||
Node: Introduction and Notation344308
|
||||
Node: Readline Interaction345931
|
||||
Node: Readline Bare Essentials347122
|
||||
Node: Readline Movement Commands348911
|
||||
Node: Readline Killing Commands349871
|
||||
Node: Readline Arguments351792
|
||||
Node: Searching352836
|
||||
Node: Readline Init File355022
|
||||
Node: Readline Init File Syntax356283
|
||||
Node: Conditional Init Constructs380074
|
||||
Node: Sample Init File384270
|
||||
Node: Bindable Readline Commands387394
|
||||
Node: Commands For Moving388598
|
||||
Node: Commands For History390649
|
||||
Node: Commands For Text395643
|
||||
Node: Commands For Killing399292
|
||||
Node: Numeric Arguments402325
|
||||
Node: Commands For Completion403464
|
||||
Node: Keyboard Macros407655
|
||||
Node: Miscellaneous Commands408343
|
||||
Node: Readline vi Mode414381
|
||||
Node: Programmable Completion415288
|
||||
Node: Programmable Completion Builtins423068
|
||||
Node: A Programmable Completion Example434056
|
||||
Node: Using History Interactively439304
|
||||
Node: Bash History Facilities439988
|
||||
Node: Bash History Builtins442993
|
||||
Node: History Interaction448017
|
||||
Node: Event Designators451637
|
||||
Node: Word Designators452991
|
||||
Node: Modifiers454751
|
||||
Node: Installing Bash456559
|
||||
Node: Basic Installation457696
|
||||
Node: Compilers and Options461418
|
||||
Node: Compiling For Multiple Architectures462159
|
||||
Node: Installation Names463851
|
||||
Node: Specifying the System Type465960
|
||||
Node: Sharing Defaults466677
|
||||
Node: Operation Controls467350
|
||||
Node: Optional Features468308
|
||||
Node: Reporting Bugs479527
|
||||
Node: Major Differences From The Bourne Shell480861
|
||||
Node: GNU Free Documentation License497710
|
||||
Node: Indexes522887
|
||||
Node: Builtin Index523341
|
||||
Node: Reserved Word Index530168
|
||||
Node: Variable Index532616
|
||||
Node: Function Index549604
|
||||
Node: Concept Index563388
|
||||
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
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
+50
-25
@@ -1,12 +1,12 @@
|
||||
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_0) (preloaded format=etex 2021.8.30) 14 MAY 2023 15:39
|
||||
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
|
||||
entering extended mode
|
||||
restricted \write18 enabled.
|
||||
file:line:error style messages enabled.
|
||||
%&-line parsing enabled.
|
||||
**\nonstopmode \input /usr/local/src/bash/bash-20230509/doc/bashref.texi \input
|
||||
/usr/local/src/bash/bash-20230509/doc/bashref.texi
|
||||
(/usr/local/src/bash/bash-20230509/doc/bashref.texi
|
||||
(/usr/local/src/bash/bash-20230509/doc/texinfo.tex
|
||||
**\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
|
||||
Loading texinfo [version 2015-11-22.14]:
|
||||
\outerhsize=\dimen16
|
||||
\outervsize=\dimen17
|
||||
@@ -162,20 +162,23 @@ This is `epsf.tex' v2.7.4 <14 February 2011>
|
||||
texinfo.tex: doing @include of version.texi
|
||||
|
||||
|
||||
(/usr/local/src/bash/bash-20230509/doc/version.texi) [1] [2]
|
||||
(/usr/local/build/bash/bash-20230509/doc/bashref.toc [-1] [-2] [-3]) [-4]
|
||||
Chapter 1
|
||||
(/usr/local/src/bash/bash-20230515/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
|
||||
\openout0 = `bashref.toc'.
|
||||
|
||||
(/usr/local/build/bash/bash-20230509/doc/bashref.aux)
|
||||
|
||||
(/usr/local/build/bash/bash-20230515/doc/bashref.aux)
|
||||
\openout1 = `bashref.aux'.
|
||||
|
||||
Chapter 2
|
||||
[1] [2]
|
||||
Chapter 2 [1] [2]
|
||||
@cpindfile=@write2
|
||||
\openout2 = `bashref.cp'.
|
||||
|
||||
[3] Chapter 3 [4] [5] [6] [7]
|
||||
|
||||
[3] Chapter 3 [4] [5] [6] [7]
|
||||
@vrindfile=@write3
|
||||
\openout3 = `bashref.vr'.
|
||||
|
||||
@@ -227,7 +230,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 5342--5342
|
||||
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5360--5360
|
||||
[]@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
|
||||
-] [@textttsl ar-gu-ment []@texttt ][]
|
||||
|
||||
@@ -240,7 +243,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5342--5342
|
||||
.etc.
|
||||
|
||||
|
||||
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5343--5343
|
||||
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5361--5361
|
||||
[]@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [
|
||||
-] [@textttsl ar-gu-ment []@texttt ][]
|
||||
|
||||
@@ -259,7 +262,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5343--5343
|
||||
[118] [119]
|
||||
texinfo.tex: doing @include of rluser.texi
|
||||
|
||||
(/usr/local/src/bash/bash-20230509/lib/readline/doc/rluser.texi
|
||||
(/usr/local/src/bash/bash-20230515/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
|
||||
@@ -309,10 +312,10 @@ gnored[]
|
||||
texinfo.tex: doing @include of hsuser.texi
|
||||
|
||||
|
||||
(/usr/local/src/bash/bash-20230509/lib/readline/doc/hsuser.texi Chapter 9
|
||||
(/usr/local/src/bash/bash-20230515/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 9622--9631
|
||||
Underfull \hbox (badness 10000) in paragraph at lines 9640--9649
|
||||
[]@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
|
||||
entation[]@textrm '[],
|
||||
|
||||
@@ -325,7 +328,7 @@ entation[]@textrm '[],
|
||||
.etc.
|
||||
|
||||
|
||||
Underfull \hbox (badness 10000) in paragraph at lines 9622--9631
|
||||
Underfull \hbox (badness 10000) in paragraph at lines 9640--9649
|
||||
@textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
|
||||
extrm '[], `@texttt strict-posix-default[]@textrm '[], and
|
||||
|
||||
@@ -341,16 +344,38 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
|
||||
[175] [176] Appendix C [177]
|
||||
texinfo.tex: doing @include of fdl.texi
|
||||
|
||||
(/usr/local/src/bash/bash-20230509/doc/fdl.texi
|
||||
(/usr/local/src/bash/bash-20230515/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:
|
||||
3531 strings out of 497096
|
||||
40273 string characters out of 6206923
|
||||
87712 words of memory out of 5000000
|
||||
4700 multiletter control sequences out of 15000+600000
|
||||
4101 strings out of 497086
|
||||
47605 string characters out of 6206517
|
||||
141996 words of memory out of 5000000
|
||||
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,402b,942s stack positions out of 5000i,500n,10000p,200000b,80000s
|
||||
16i,6n,16p,389b,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
|
||||
lic/amsfonts/cm/cmcsc10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/
|
||||
amsfonts/cm/cmmi10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfo
|
||||
nts/cm/cmmi12.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/c
|
||||
m/cmmi9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr1
|
||||
0.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr9.pfb><
|
||||
/opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsl10.pfb></opt/
|
||||
local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsltt10.pfb></opt/loc
|
||||
al/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsy10.pfb></opt/local/sh
|
||||
are/texmf-texlive/fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/local/share/t
|
||||
exmf-texlive/fonts/type1/public/amsfonts/cm/cmtt10.pfb></opt/local/share/texmf-
|
||||
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).
|
||||
PDF statistics:
|
||||
2800 PDF objects out of 2984 (max. 8388607)
|
||||
2553 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)
|
||||
|
||||
Output written on bashref.dvi (200 pages, 839672 bytes).
|
||||
|
||||
Binary file not shown.
+26
-8
@@ -2640,7 +2640,7 @@ or (deprecated)
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
Bash performs the expansion by executing @var{command} in a subshell
|
||||
Bash performs command substitution by executing @var{command} in a subshell
|
||||
environment and replacing the command substitution with the standard
|
||||
output of the command, with any trailing newlines deleted.
|
||||
Embedded newlines are not deleted, but they may be removed during
|
||||
@@ -2659,17 +2659,14 @@ the parentheses make up the command; none are treated specially.
|
||||
There is an alternate form of command substitution:
|
||||
|
||||
@example
|
||||
$@{@var{C} @var{command}; @}
|
||||
$@{@var{c} @var{command}; @}
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
which executes @var{command} in the current execution environment.
|
||||
This means that side effects of @var{command} take effect immediately
|
||||
in the current execution environment and persist in the current
|
||||
environment after the command completes (e.g., the @code{exit} builtin
|
||||
will exit the shell).
|
||||
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,
|
||||
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
|
||||
where a reserved word may appear (i.e., preceded by a command terminator
|
||||
such as semicolon).
|
||||
@@ -2677,6 +2674,11 @@ Bash allows the close brace to be joined to the remaining characters in
|
||||
the word without being followed by a shell metacharacter as a reserved
|
||||
word would usually require.
|
||||
|
||||
Any side effects of @var{command} take effect immediately
|
||||
in the current execution environment and persist in the current
|
||||
environment after the command completes (e.g., the @code{exit} builtin
|
||||
will exit the shell).
|
||||
|
||||
This type of command substitution superficially resembles executing an
|
||||
unnamed shell function: local variables are created as when a shell
|
||||
function is executing, and the @code{return} builtin forces
|
||||
@@ -4012,6 +4014,14 @@ The return status is zero unless an invalid option is supplied, one of
|
||||
the names is not a valid shell variable name, or @option{-f} is supplied
|
||||
with a name that is not a shell function.
|
||||
|
||||
@item false
|
||||
@btindex false
|
||||
@example
|
||||
false
|
||||
@end example
|
||||
|
||||
Does nothing, returns a non-zero status.
|
||||
|
||||
@item getopts
|
||||
@btindex getopts
|
||||
@example
|
||||
@@ -4371,6 +4381,14 @@ values in a subshell or subshell environment when one is created.
|
||||
The return status is zero unless a @var{sigspec} does not specify a
|
||||
valid signal.
|
||||
|
||||
@item true
|
||||
@btindex true
|
||||
@example
|
||||
true
|
||||
@end example
|
||||
|
||||
Does nothing, returns a 0 status.
|
||||
|
||||
@item umask
|
||||
@btindex umask
|
||||
@example
|
||||
|
||||
+2
-1
@@ -3671,7 +3671,6 @@ execute_while_or_until (WHILE_COM *while_command, int type)
|
||||
while (1)
|
||||
{
|
||||
return_value = execute_command (while_command->test);
|
||||
REAP ();
|
||||
|
||||
/* Need to handle `break' in the test when we would break out of the
|
||||
loop. The job control code will set `breaking' to loop_level
|
||||
@@ -3700,6 +3699,8 @@ execute_while_or_until (WHILE_COM *while_command, int type)
|
||||
body_status = execute_command (while_command->action);
|
||||
QUIT;
|
||||
|
||||
REAP ();
|
||||
|
||||
if (breaking)
|
||||
{
|
||||
breaking--;
|
||||
|
||||
@@ -3267,8 +3267,17 @@ return_job:
|
||||
/* Make sure there is a background job to wait for */
|
||||
BLOCK_CHILD (set, oset);
|
||||
for (i = 0; i < js.j_jobslots; i++)
|
||||
if (jobs[i] && RUNNING (i) && IS_FOREGROUND (i) == 0)
|
||||
break;
|
||||
{
|
||||
if (jobs[i] && RUNNING (i) && IS_FOREGROUND (i) == 0)
|
||||
break;
|
||||
/* It's possible for there to be a dead job that was reaped when
|
||||
SIGCHLD was unblocked before this loop started. */
|
||||
else if ((flags & JWAIT_WAITING) && jobs[i] && IS_WAITING (i) == 0)
|
||||
continue;
|
||||
else if (jobs[i] && DEADJOB (i) && IS_NOTIFIED (i) == 0 && IS_FOREGROUND (i) == 0)
|
||||
goto return_job;
|
||||
}
|
||||
|
||||
if (i == js.j_jobslots)
|
||||
{
|
||||
UNBLOCK_CHILD (oset);
|
||||
@@ -4271,6 +4280,7 @@ notify_of_job_status (void)
|
||||
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
jobs[job]->flags |= J_NOTIFIED;
|
||||
}
|
||||
else if (job_control) /* XXX job control test added */
|
||||
{
|
||||
@@ -4282,6 +4292,8 @@ notify_of_job_status (void)
|
||||
_("(wd now: %s)\n"), polite_directory_format (dir));
|
||||
}
|
||||
|
||||
/* The code above and pretty_print_job take care of setting
|
||||
J_NOTIFIED as appropriate, but this is here for posterity. */
|
||||
jobs[job]->flags |= J_NOTIFIED;
|
||||
break;
|
||||
|
||||
@@ -4745,7 +4757,7 @@ mark_all_jobs_as_dead (void)
|
||||
BLOCK_CHILD (set, oset);
|
||||
|
||||
/* XXX could use js.j_firstj here */
|
||||
for (i = 0; i < js.j_jobslots; i++)
|
||||
for (i = js.j_ndead = 0; i < js.j_jobslots; i++)
|
||||
if (jobs[i])
|
||||
{
|
||||
jobs[i]->state = JDEAD;
|
||||
|
||||
+5
-5
@@ -139,7 +139,7 @@ rangecmp (int c1, int c2, int forcecoll)
|
||||
#if defined (HAVE_STRCOLL)
|
||||
/* Returns 1 if chars C and EQUIV collate equally in the current locale. */
|
||||
static int
|
||||
collequiv (int c, int equiv)
|
||||
collseqcmp (int c, int equiv)
|
||||
{
|
||||
if (charcmp (c, equiv, 1) == 0)
|
||||
return 1;
|
||||
@@ -152,7 +152,7 @@ collequiv (int c, int equiv)
|
||||
|
||||
}
|
||||
#else
|
||||
# define collequiv(c, equiv) ((c) == (equiv))
|
||||
# define collseqcmp(c, equiv) ((c) == (equiv))
|
||||
#endif
|
||||
|
||||
#define _COLLSYM _collsym
|
||||
@@ -321,7 +321,7 @@ is_cclass (int c, const char *name)
|
||||
#define STRLEN(S) strlen(S)
|
||||
#define STRCMP(S1, S2) strcmp((S1), (S2))
|
||||
#define RANGECMP(C1, C2, F) rangecmp((C1), (C2), (F))
|
||||
#define COLLEQUIV(C1, C2) collequiv((C1), (C2))
|
||||
#define COLLEQUIV(C1, C2) collseqcmp((C1), (C2))
|
||||
#define CTYPE_T enum char_class
|
||||
#define IS_CCLASS(C, S) is_cclass((C), (S))
|
||||
#include "sm_loop.c"
|
||||
@@ -407,7 +407,7 @@ rangecmp_wc (wint_t c1, wint_t c2, int forcecoll)
|
||||
|
||||
/* Returns 1 if wide chars C and EQUIV collate equally in the current locale. */
|
||||
static int
|
||||
collequiv_wc (wint_t c, wint_t equiv)
|
||||
collseqcmp_wc (wint_t c, wint_t equiv)
|
||||
{
|
||||
wchar_t s, p;
|
||||
|
||||
@@ -566,7 +566,7 @@ posix_cclass_only (char *pattern)
|
||||
#define STRLEN(S) wcslen(S)
|
||||
#define STRCMP(S1, S2) wcscmp((S1), (S2))
|
||||
#define RANGECMP(C1, C2, F) rangecmp_wc((C1), (C2), (F))
|
||||
#define COLLEQUIV(C1, C2) collequiv_wc((C1), (C2))
|
||||
#define COLLEQUIV(C1, C2) collseqcmp_wc((C1), (C2))
|
||||
#define CTYPE_T enum char_class
|
||||
#define IS_CCLASS(C, S) is_wcclass((C), (S))
|
||||
#include "sm_loop.c"
|
||||
|
||||
@@ -164,11 +164,20 @@ extern int _nl_msg_cat_cntr;
|
||||
const char *_nl_locale_name (int category, const char *categoryname);
|
||||
#endif
|
||||
|
||||
#ifdef __MVS__
|
||||
# undef __locale
|
||||
#endif
|
||||
|
||||
struct loaded_l10nfile *_nl_find_domain (const char *__dirname,
|
||||
char *__locale,
|
||||
const char *__domainname,
|
||||
struct binding *__domainbinding);
|
||||
internal_function;
|
||||
|
||||
#ifdef __MVS__
|
||||
# define __locale 1
|
||||
#endif
|
||||
|
||||
void _nl_load_domain (struct loaded_l10nfile *__domain,
|
||||
struct binding *__domainbinding);
|
||||
internal_function;
|
||||
|
||||
@@ -83,7 +83,7 @@ typedef void *alias_t;
|
||||
#endif /* ALIAS */
|
||||
|
||||
#if defined (PROMPT_STRING_DECODE)
|
||||
# ifndef _MINIX
|
||||
# if !defined (_MINIX) || !defined (__MVS__)
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
# include "posixtime.h"
|
||||
|
||||
@@ -373,11 +373,11 @@ main (int argc, char **argv, char **env)
|
||||
#endif
|
||||
volatile int locally_skip_execution;
|
||||
volatile int arg_index, top_level_arg_index;
|
||||
#ifdef __OPENNT
|
||||
#if defined (__OPENNT) || defined (__MVS__)
|
||||
char **env;
|
||||
|
||||
env = environ;
|
||||
#endif /* __OPENNT */
|
||||
#endif /* __OPENNT || __MVS__ */
|
||||
|
||||
USE_VAR(argc);
|
||||
USE_VAR(argv);
|
||||
|
||||
@@ -4611,11 +4611,8 @@ quote_escapes_internal (const char *string, int flags)
|
||||
quote_spaces = (ifs_value && *ifs_value == 0);
|
||||
nosplit = (flags & PF_NOSPLIT2);
|
||||
|
||||
for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++)
|
||||
{
|
||||
skip_ctlesc |= (nosplit == 0 && *s == CTLESC);
|
||||
skip_ctlnul |= (nosplit == 0 && *s == CTLNUL);
|
||||
}
|
||||
skip_ctlesc = nosplit == 0 && ifs_cmap[CTLESC];
|
||||
skip_ctlnul = nosplit == 0 && ifs_cmap[CTLNUL];
|
||||
|
||||
t = result = (char *)xmalloc ((slen * 2) + 1);
|
||||
s = string;
|
||||
@@ -6602,6 +6599,29 @@ process_substitute (char *string, int open_for_read_in_child)
|
||||
|
||||
#define COMSUB_PIPEBUF 4096
|
||||
|
||||
static inline int
|
||||
comsub_shouldquote (int c, int quoted, int flags, int skip_ctlesc, int skip_ctlnul)
|
||||
{
|
||||
/* This is essentially quote_string inline */
|
||||
if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
|
||||
return 1;
|
||||
else if ((flags & PF_ASSIGNRHS) && skip_ctlesc && c == CTLESC)
|
||||
return 1;
|
||||
else if ((flags & PF_ASSIGNRHS) && skip_ctlnul && c == CTLNUL)
|
||||
return 1;
|
||||
/* Escape CTLESC and CTLNUL in the output to protect those characters
|
||||
from the rest of the word expansions (word splitting and globbing.)
|
||||
This is essentially quote_escapes inline. */
|
||||
else if (skip_ctlesc == 0 && c == CTLESC)
|
||||
return 1;
|
||||
else if (skip_ctlnul == 0 && c == CTLNUL)
|
||||
return 1;
|
||||
else if (c == ' ' && ifs_value && *ifs_value == 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *
|
||||
optimize_cat_file (REDIRECT *r, int quoted, int flags, int *flagp)
|
||||
{
|
||||
@@ -6672,17 +6692,7 @@ read_comsub (int fd, int quoted, int flags, int *rflag)
|
||||
/* Add the character to ISTRING, possibly after resizing it. */
|
||||
RESIZE_MALLOCED_BUFFER (istring, istring_index, locale_mb_cur_max+1, istring_size, 512);
|
||||
|
||||
/* This is essentially quote_string inline */
|
||||
if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) /* || c == CTLESC || c == CTLNUL */)
|
||||
istring[istring_index++] = CTLESC;
|
||||
else if ((flags & PF_ASSIGNRHS) && skip_ctlesc && c == CTLESC)
|
||||
istring[istring_index++] = CTLESC;
|
||||
/* Escape CTLESC and CTLNUL in the output to protect those characters
|
||||
from the rest of the word expansions (word splitting and globbing.)
|
||||
This is essentially quote_escapes inline. */
|
||||
else if (skip_ctlesc == 0 && c == CTLESC)
|
||||
istring[istring_index++] = CTLESC;
|
||||
else if ((skip_ctlnul == 0 && c == CTLNUL) || (c == ' ' && (ifs_value && *ifs_value == 0)))
|
||||
if (comsub_shouldquote (c, quoted, flags, skip_ctlesc, skip_ctlnul))
|
||||
istring[istring_index++] = CTLESC;
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
@@ -6751,7 +6761,10 @@ read_comsub (int fd, int quoted, int flags, int *rflag)
|
||||
static void
|
||||
uw_pop_var_context (void *ignore)
|
||||
{
|
||||
variable_context--;
|
||||
pop_var_context ();
|
||||
|
||||
sv_ifs ("IFS"); /* XXX here for now */
|
||||
}
|
||||
|
||||
#if defined (ARRAY_VARS)
|
||||
@@ -6809,6 +6822,41 @@ uw_restore_errexit (void *eflag)
|
||||
change_flag ('e', (intptr_t) eflag ? FLAG_ON : FLAG_OFF);
|
||||
set_shellopts ();
|
||||
}
|
||||
|
||||
/* Quote the output of nofork varsub command substitution in the way that the
|
||||
caller of function_substitute expects. The caller guarantees that STRING
|
||||
is non-null. This is equivalent to what read_comsub does to the output it
|
||||
reads. The return value will be post-processed to turn "" into CTLNUL if
|
||||
necessary. */
|
||||
static char *
|
||||
comsub_quote_string (char *string, int quoted, int flags)
|
||||
{
|
||||
int skip_ctlesc, skip_ctlnul;
|
||||
size_t ind, slen;
|
||||
const char *send;
|
||||
int i, c;
|
||||
char *ret;
|
||||
DECLARE_MBSTATE;
|
||||
|
||||
slen = strlen (string);
|
||||
send = string + slen;
|
||||
|
||||
ret = (char *)xmalloc ((2 * slen) + 1);
|
||||
|
||||
skip_ctlesc = ifs_cmap[CTLESC];
|
||||
skip_ctlnul = ifs_cmap[CTLNUL];
|
||||
|
||||
for (i = 0, ind = 0; c = string[i]; )
|
||||
{
|
||||
if (comsub_shouldquote (c, quoted, flags, skip_ctlesc, skip_ctlnul))
|
||||
ret[ind++] = CTLESC;
|
||||
|
||||
COPY_CHAR_I (ret, ind, string, send, i);
|
||||
}
|
||||
|
||||
ret[ind] = '\0';
|
||||
return ret;
|
||||
}
|
||||
|
||||
static SHELL_VAR lambdafunc = { ".bash.lambda", 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
@@ -6980,7 +7028,7 @@ function_substitute (char *string, int quoted, int flags)
|
||||
else
|
||||
{
|
||||
s = get_string_value ("REPLY");
|
||||
istring = s ? savestring (s) : savestring ("");
|
||||
istring = s ? comsub_quote_string (s, quoted, flags) : savestring ("");
|
||||
}
|
||||
|
||||
run_unwind_frame ("nofork comsub"); /* restores stdout, job control stuff */
|
||||
|
||||
@@ -298,6 +298,29 @@ initialize_signames (void)
|
||||
signal_names[SIGTHR] = "SIGTHR";
|
||||
#endif
|
||||
|
||||
/* z/OS */
|
||||
#if defined(SIGABND)
|
||||
signal_names[SIGABND] = "SIGABND";
|
||||
#endif
|
||||
#if defined(SIGIOERR)
|
||||
signal_names[SIGIOERR] = "SIGIOERR";
|
||||
#endif
|
||||
#if defined(SIGTHSTOP)
|
||||
signal_names[SIGTHSTOP] = "SIGTHSTOP";
|
||||
#endif
|
||||
#if defined(SIGTHCONT)
|
||||
signal_names[SIGTHCONT] = "SIGTHCONT";
|
||||
#endif
|
||||
#if defined(SIGTRACE)
|
||||
signal_names[SIGTRACE] = "SIGTRACE";
|
||||
#endif
|
||||
#if defined(SIGDCE)
|
||||
signal_names[SIGDCE] = "SIGDCE";
|
||||
#endif
|
||||
#if defined(SIGDUMP)
|
||||
signal_names[SIGDUMP] = "SIGDUMP";
|
||||
#endif
|
||||
|
||||
/* Common */
|
||||
#if defined (SIGHUP) /* hangup */
|
||||
signal_names[SIGHUP] = "SIGHUP";
|
||||
|
||||
+97
-3
@@ -8,23 +8,33 @@ outside: 42
|
||||
aa bb cc dd
|
||||
outside:
|
||||
assignment: 12
|
||||
func ()
|
||||
{
|
||||
echo func-inside
|
||||
}
|
||||
abcde
|
||||
67890
|
||||
12345
|
||||
argv[1] = <>
|
||||
argv[1] = <>
|
||||
aa,bb
|
||||
JOBaa bb cc ddCONTROL
|
||||
./comsub2.tests: line 48: p: command not found
|
||||
./comsub2.tests: line 68: p: command not found
|
||||
NOTFOUND
|
||||
./comsub2.tests: line 56: p: command not found
|
||||
./comsub2.tests: line 56: p: command not found
|
||||
./comsub2.tests: line 79: p: command not found
|
||||
./comsub2.tests: line 79: p: command not found
|
||||
expand_aliases off
|
||||
expand_aliases off
|
||||
outside:
|
||||
./comsub2.tests: line 79: alias: p: not found
|
||||
alias e='echo inside redefine'
|
||||
expand_aliases off
|
||||
1
|
||||
expand_aliases on
|
||||
2
|
||||
expand_aliases on
|
||||
outside:
|
||||
./comsub2.tests: line 89: alias: p: not found
|
||||
expand_aliases on
|
||||
1
|
||||
xx
|
||||
@@ -72,3 +82,87 @@ inside: after false xxx
|
||||
outside after: funsub
|
||||
=====posix mode=====
|
||||
outside before: value
|
||||
.
|
||||
declare -a a=([0]="1" [1]="2" [2]="3" [3]="4")
|
||||
declare -- int="2"
|
||||
after here-doc: 1
|
||||
[1]- Running sleep 1 &
|
||||
[2]+ Running sleep 1 &
|
||||
[1]- Running sleep 1 &
|
||||
[2]+ Running sleep 1 &
|
||||
17772 26794
|
||||
17772 26794
|
||||
a b c == 1 2 3
|
||||
== 1 2 3
|
||||
before return
|
||||
after func
|
||||
1 2 3a b c
|
||||
2 2
|
||||
foobara b c
|
||||
declare -- IFS=" "
|
||||
*???
|
||||
*???
|
||||
yyy zzzz
|
||||
argv[1] = <AA^ABB>
|
||||
argv[1] = <AA^OBB>
|
||||
argv[1] = <AA^?BB>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <AA^ABB>
|
||||
argv[1] = <AA^ABB>
|
||||
argv[1] = <AA^OBB>
|
||||
argv[1] = <AA^OBB>
|
||||
argv[1] = <AA^?BB>
|
||||
argv[1] = <AA^?BB>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^A>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <^?>
|
||||
argv[1] = <AA^ABB>
|
||||
argv[1] = <AA>
|
||||
argv[2] = <BB>
|
||||
argv[1] = <AA^ABB>
|
||||
argv[1] = <AA>
|
||||
argv[2] = <BB>
|
||||
argv[1] = <AA^?BB>
|
||||
argv[1] = <AA>
|
||||
argv[2] = <BB>
|
||||
argv[1] = <AA^?BB>
|
||||
argv[1] = <AA>
|
||||
argv[2] = <BB>
|
||||
argv[1] = <AA BB>
|
||||
argv[1] = <AA>
|
||||
argv[2] = <BB>
|
||||
argv[1] = <AA BB>
|
||||
argv[1] = <AA BB>
|
||||
argv[1] = <AA BB>
|
||||
argv[1] = <AA>
|
||||
argv[2] = <BB>
|
||||
argv[1] = <AA BB>
|
||||
argv[1] = <AA BB>
|
||||
|
||||
+32
-2
@@ -29,15 +29,35 @@ unset x
|
||||
echo ${ printf '%s\n' aa bb cc dd; x=42 ; return 12; echo ee ff; }
|
||||
echo outside: $x
|
||||
unset x
|
||||
echo ${ typeset x; printf '%s\n' aa bb cc dd; x=42 ; return 12; echo ee ff; }
|
||||
echo ${ local x; printf '%s\n' aa bb cc dd; x=42 ; return 12; echo ee ff; }
|
||||
echo outside: $x
|
||||
xx=${ typeset x; printf '%s\n' aa bb cc dd; x=42 ; return 12; echo ee ff; }
|
||||
xx=${ local x; printf '%s\n' aa bb cc dd; x=42 ; return 12; echo ee ff; }
|
||||
echo assignment: $?
|
||||
unset xx
|
||||
|
||||
declare -i x
|
||||
y=${ :;}
|
||||
declare -i z
|
||||
unset -v x y z
|
||||
|
||||
# variables can be local, but all function declarations are global
|
||||
func() { echo func-outside; }
|
||||
xx=${ func() { echo func-inside; }; }
|
||||
declare -f func
|
||||
xx=${ unset -f func; }
|
||||
declare -f func
|
||||
|
||||
echo ${( echo abcde )} # works in ksh93
|
||||
|
||||
echo ${| echo 67890; REPLY=12345; } # works in mksh
|
||||
x=${| REPLY= ;}
|
||||
recho "$x"
|
||||
unset x
|
||||
x=${| :;}
|
||||
recho "$x"
|
||||
unset x
|
||||
|
||||
echo ${ echo aa; },${ echo bb; }
|
||||
|
||||
# basic job control
|
||||
set -m
|
||||
@@ -49,17 +69,24 @@ echo NOT${ p; }FOUND
|
||||
|
||||
# alias handling in command substitutions, default and posix mode
|
||||
alias p=printf
|
||||
alias e='echo aliasval'
|
||||
echo "${ typeset x;
|
||||
for f in 1 2; do p '%s\n' $f ; shopt expand_aliases; done
|
||||
unalias p
|
||||
alias e='echo inside redefine'
|
||||
x=42 ; return; echo this should not be seen; }"
|
||||
echo outside: $x
|
||||
alias p e
|
||||
shopt expand_aliases
|
||||
|
||||
alias p=printf
|
||||
set -o posix
|
||||
echo "${ typeset x;
|
||||
for f in 1 2; do p '%s\n' $f ; shopt expand_aliases; done
|
||||
unalias p;
|
||||
x=42 ; return; echo this should not be seen; }"
|
||||
echo outside: $x
|
||||
alias p
|
||||
shopt expand_aliases
|
||||
|
||||
set +o posix
|
||||
@@ -120,3 +147,6 @@ echo ${ echo $(( 24+18 )); }
|
||||
# alias expansion and nested funsubs in other constructs
|
||||
${THIS_SH} ./comsub21.sub
|
||||
${THIS_SH} ./comsub22.sub
|
||||
${THIS_SH} ./comsub23.sub
|
||||
${THIS_SH} ./comsub24.sub
|
||||
${THIS_SH} ./comsub25.sub
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# more odds and ends for nofork command substitution
|
||||
|
||||
# make sure parsing is right within conditional commands
|
||||
[[ ${ echo -n "[${ echo -n foo; }]" ; } == '[foo]' ]] || echo bad 1
|
||||
[[ "${ echo -n "[${ echo -n foo; }]" ; }" == '[foo]' ]] || echo bad 1
|
||||
|
||||
# mix multiple calls to parse_and_execute
|
||||
got=$(eval 'x=${ for i in test; do case $i in test) echo .;; esac; done; }' ; echo $x)
|
||||
echo $got
|
||||
|
||||
# mix compound assignment and nofork command substitution
|
||||
: ${ a=(1 2 3 ${ echo 4;} ); }
|
||||
declare -p a
|
||||
unset a
|
||||
|
||||
# function execution with side effects
|
||||
int=0
|
||||
incr()
|
||||
{
|
||||
echo incr: $int
|
||||
(( int++ ))
|
||||
}
|
||||
: ${ incr; }
|
||||
: ${ incr; }
|
||||
declare -p int
|
||||
|
||||
# expansion inside here-document body
|
||||
int=0
|
||||
: <<EOF
|
||||
${ incr; }
|
||||
EOF
|
||||
echo after here-doc: $int
|
||||
|
||||
# jobs list in nofork command substitution
|
||||
sleep 1 &
|
||||
sleep 1 &
|
||||
|
||||
jl1=${ jobs; }
|
||||
printf '%s\n' "$jl1"
|
||||
|
||||
jl2=${ jobs; }
|
||||
printf '%s\n' "$jl2"
|
||||
|
||||
# nofork command substitution doesn't affect the shell's random number sequence
|
||||
RANDOM=42
|
||||
echo $RANDOM ${ echo $RANDOM; }
|
||||
|
||||
RANDOM=42
|
||||
echo $RANDOM $RANDOM
|
||||
@@ -0,0 +1,77 @@
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# test function calling in nofork comsubs
|
||||
set -- 1 2 3
|
||||
|
||||
func()
|
||||
{
|
||||
echo "$@"
|
||||
}
|
||||
|
||||
x=${ func a b c; }
|
||||
echo "$x" == "$@"
|
||||
|
||||
x=${ func; }
|
||||
echo "$x" == "$@"
|
||||
|
||||
unset -f func
|
||||
func()
|
||||
{
|
||||
echo before return
|
||||
return 12
|
||||
echo after return
|
||||
}
|
||||
|
||||
x=${ func; echo after func; }
|
||||
echo "$x"
|
||||
|
||||
unset -f func
|
||||
unset x
|
||||
set --
|
||||
|
||||
# more shift and order-of-expansion tests
|
||||
set -- 1 2 3
|
||||
echo "$*${ set -- a b c;}$*"
|
||||
|
||||
set -- 1 2
|
||||
x=${ shift; echo "$@"; }
|
||||
echo $x "$@"
|
||||
|
||||
# order of expansion
|
||||
|
||||
echo "${ IFS= ; echo foo; }${ unset IFS; echo bar;}${ IFS=' '; echo a b c;}"
|
||||
declare -p IFS
|
||||
|
||||
IFS=$' \t\n'
|
||||
|
||||
: ${TMPDIR:=/tmp}
|
||||
TDIR=$TMPDIR/comsub24-$$
|
||||
[ -d "${TDIR}" ] || mkdir "${TDIR}"
|
||||
cd "${TDIR}" || {
|
||||
echo "comsub24: cannot cd to ${TDIR}"
|
||||
exit 2
|
||||
}
|
||||
touch xx yy zz
|
||||
|
||||
echo "${ set -f; echo '*';}${ set +f; echo '???'; }"
|
||||
echo ${ set -f; echo '*';}${ set +f; echo '???'; }
|
||||
|
||||
rm xx yy zz
|
||||
touch xx yyy zzzz
|
||||
|
||||
echo ${ set -f; echo '*';}${ set +f; echo '???'; }
|
||||
|
||||
cd $OLDPWD
|
||||
rm -rf $TDIR
|
||||
@@ -0,0 +1,138 @@
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# tests of internal quoting characters in read_comsub and comsub_quote_string
|
||||
|
||||
CTLESC=$'\001'
|
||||
CTLNUL=$'\177'
|
||||
|
||||
x=${| REPLY=$'AA\001BB' ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
|
||||
x=${| REPLY=$'AA\017BB' ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
|
||||
x=${| REPLY=$'AA\177BB' ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
|
||||
x=${| REPLY=$'\001' ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x=${| REPLY="" ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x=${| REPLY= ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x=${| REPLY=$CTLESC ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x=${| REPLY="$CTLESC" ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x="${| REPLY="$CTLESC" ; }"
|
||||
recho "$x"
|
||||
unset x
|
||||
|
||||
x=${| REPLY=$'\177' ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x=${| REPLY="" ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x=${| REPLY= ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x=${| REPLY=$CTLNUL ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x=${| REPLY="$CTLNUL" ; }
|
||||
recho "$x"
|
||||
unset x
|
||||
x="${| REPLY="$CTLNUL" ; }"
|
||||
recho "$x"
|
||||
unset x
|
||||
|
||||
recho "${ echo $'AA\001BB' ; }"
|
||||
recho ${ echo $'AA\001BB' ; }
|
||||
|
||||
recho "${ echo $'AA\017BB' ; }"
|
||||
recho ${ echo $'AA\017BB' ; }
|
||||
|
||||
recho "${ echo $'AA\177BB' ; }"
|
||||
recho ${ echo $'AA\177BB' ; }
|
||||
|
||||
recho "${ echo $'\001' ; }"
|
||||
recho ${ echo $'\001' ; }
|
||||
|
||||
recho "${ echo "" ; }"
|
||||
recho ${ echo "" ; }
|
||||
recho "${ echo ; }"
|
||||
recho ${ echo ; }
|
||||
|
||||
recho "${ echo $CTLESC ; }"
|
||||
recho ${ echo $CTLESC ; }
|
||||
recho ${ echo "$CTLESC" ; }
|
||||
recho "${ echo "$CTLESC" ; }"
|
||||
|
||||
recho "${ echo $'\177' ; }"
|
||||
recho ${ echo $'\177' ; }
|
||||
|
||||
recho "${ echo "" ; }"
|
||||
recho ${ echo "" ; }
|
||||
recho "${ echo ; }"
|
||||
recho ${ echo ; }
|
||||
recho "${ echo $CTLNUL ; }"
|
||||
recho ${ echo $CTLNUL ; }
|
||||
recho "${ echo "$CTLNUL" ; }"
|
||||
recho ${ echo "$CTLNUL" ; }
|
||||
|
||||
IFS=$CTLESC
|
||||
x=${| REPLY=$'AA\001BB' ; }
|
||||
recho "$x"
|
||||
recho $x
|
||||
unset x
|
||||
|
||||
recho "${ echo $'AA\001BB' ; }"
|
||||
recho ${ echo $'AA\001BB' ; }
|
||||
|
||||
IFS=$CTLNUL
|
||||
x=${| REPLY=$'AA\177BB' ; }
|
||||
recho "$x"
|
||||
recho $x
|
||||
unset x
|
||||
|
||||
recho "${ echo $'AA\177BB' ; }"
|
||||
recho ${ echo $'AA\177BB' ; }
|
||||
|
||||
unset IFS
|
||||
x=${| REPLY=AA" "BB ; }
|
||||
recho "$x"
|
||||
recho $x
|
||||
|
||||
IFS=
|
||||
recho "$x"
|
||||
recho $x
|
||||
unset x
|
||||
|
||||
unset IFS
|
||||
recho "${ echo AA" "BB ; }"
|
||||
recho ${ echo AA" "BB ; }
|
||||
|
||||
IFS=
|
||||
recho "${ echo AA" "BB ; }"
|
||||
recho ${ echo AA" "BB ; }
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
# return different results
|
||||
: ${TMPDIR:=/tmp}
|
||||
|
||||
trap 'rm -f ${TMPDIR}/pipe' 0 1 2 3 6 15
|
||||
trap 'rm -f ${TMPDIR}/pipe' EXIT HUP INT QUIT ABRT TERM
|
||||
|
||||
exec 6>&-
|
||||
echo "t -p /dev/fd/6"
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
# test the trap code
|
||||
|
||||
trap 'echo exiting' 0
|
||||
trap 'echo aborting' 1 2 3 6 15
|
||||
trap 'echo aborting' HUP INT QUIT ABRT TERM
|
||||
|
||||
# make sure a user-specified subshell runs the exit trap, but does not
|
||||
# inherit the exit trap from a parent shell
|
||||
|
||||
Reference in New Issue
Block a user