fix issue with read builtin delimiter in invaild mutibyte char; fix crash if caller passes negative count argument to one of the history file writing functions

This commit is contained in:
Chet Ramey
2024-08-09 10:01:38 -04:00
parent e45ec6f76b
commit 772e7e760e
19 changed files with 3135 additions and 2976 deletions
+22 -1
View File
@@ -5783,7 +5783,7 @@ lib/readline/history.c
3/24
----
lib/readline/history.c
lib/readline/histfile.c
- history_truncate_file: fix off-by-one error that resulted in the
timestamp associated with the first history entry not being written
to the truncated history file
@@ -9908,3 +9908,24 @@ doc/bash.1,doc/bashref.texi
variables.c,hashcmd.c,builtins/hash.def,builtins/history.def,builtins/source.def
- use ABSPATH/RELPATH/absolute_program instead of testing for slash
explicitly
7/30
----
lib/readline/histfile.c
- history_do_write: return 0 immediately if nelements < 0
Report from ZeroIntensity Dev <zintensitydev@gmail.com>
8/3
---
lib/sh/zread.c,externs.h
- zungetc: new function, pushes a character back into a single char of
storage so it can be used with the zread* functions that call read(2)
directly and don't use lbuf. If we try to push back more than one
char, we use lbuf, assuming that the caller will accommodate it
builtins/read.def
- read_mbchar: if we read a partial multibyte character (-2) and then
a delimiter that makes it an invalid multibyte character (-1), use
zungetc to push the delimiter back, adjust mbchar, and return what
we read so far to be added as single bytes
From a report by Kerin Millar <kfm@plushkava.net>
+18 -5
View File
@@ -130,7 +130,7 @@ static void uw_bashline_reset_event_hook (void *);
#endif
static SHELL_VAR *bind_read_variable (char *, char *, int);
#if defined (HANDLE_MULTIBYTE)
static int read_mbchar (int, char *, int, int, int);
static int read_mbchar (int, char *, int, int, int, int);
#endif
static void ttyrestore (struct ttsave *);
static void uw_ttyrestore (void *);
@@ -867,7 +867,7 @@ add_char:
else
# endif
if (locale_utf8locale == 0 || ((c & 0x80) != 0))
i += read_mbchar (fd, input_string, i, c, unbuffered_read);
i += read_mbchar (fd, input_string, i, c, delim, unbuffered_read);
}
#endif
@@ -1149,7 +1149,7 @@ bind_read_variable (char *name, char *value, int flags)
#if defined (HANDLE_MULTIBYTE)
static int
read_mbchar (int fd, char *string, int ind, int ch, int unbuffered)
read_mbchar (int fd, char *string, int ind, int ch, int delim, int unbuffered)
{
char mbchar[MB_LEN_MAX + 1];
int i, n, r;
@@ -1183,8 +1183,21 @@ read_mbchar (int fd, char *string, int ind, int ch, int unbuffered)
mbchar[i++] = c;
continue;
}
else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0)
break;
else if (ret == (size_t)-1)
{
/* If we read a delimiter character that makes this an invalid
multibyte character, we can't just add it to the input string
and treat it as a byte. We need to push it back so a subsequent
zread will pick it up. */
if (c == delim)
{
zungetc (c);
mbchar[--i] = '\0'; /* unget the delimiter */
}
break; /* invalid multibyte character */
}
else if (ret == (size_t)0 || ret > (size_t)0)
break; /* valid multibyte character */
}
mbchar_return:
+2506 -2497
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -5,14 +5,14 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Mon Jul 29 11:19:45 EDT 2024
.\" Last Change: Wed Aug 7 09:57:34 EDT 2024
.\"
.\" bash_builtins, strip all but Built-Ins section
.\" avoid a warning about an undefined register
.\" .if !rzY .nr zY 0
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2024 July 29" "GNU Bash 5.3"
.TH BASH 1 "2024 August 7" "GNU Bash 5.3"
.\"
.ie \n(.g \{\
.ds ' \(aq
@@ -2091,7 +2091,7 @@ the value returned upon subsequent
references is
the number of seconds since the assignment plus the value assigned.
The number of seconds at shell invocation and the current time are always
determined by querying the system clock.
determined by querying the system clock at one-second resolution.
If
.SM
.B SECONDS
+38 -38
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2024 July 2<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2024 August 7<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -860,8 +860,8 @@ Commands separated by a
<B>;</B>
are executed sequentially; the shell waits for each
command to terminate in turn. The return status is the
exit status of the last command executed.
command to terminate in turn.
The return status is the exit status of the last command executed.
<P>
AND and OR lists are sequences of one or more pipelines separated by the
@@ -2643,7 +2643,7 @@ the value returned upon subsequent
references is
the number of seconds since the assignment plus the value assigned.
The number of seconds at shell invocation and the current time are always
determined by querying the system clock.
determined by querying the system clock at one-second resolution.
If
<FONT SIZE=-1><B>SECONDS</B>
@@ -12934,7 +12934,8 @@ or
<B>||</B>
list except the command following the final <B>&amp;&amp;</B> or <B>||</B>,
any command in a pipeline but the last,
any command in a pipeline but the last
(subject to the state of the <B>pipefail</B> shell option),
or if the command's return value is
being inverted with
<B>!</B>.
@@ -14849,47 +14850,46 @@ subsequently reset. The exit status is true unless a
is readonly or may not be unset.
<DT><B>wait</B> [<B>-fn</B>] [-p <I>varname</I>] [<I>id</I> ...]<DD>
Wait for each specified child process and return its termination status.
Each
<I>id</I>
may be a process
ID or a job specification; if a job spec is given, all processes
in that job's pipeline are waited for. If
<I>id</I>
is not given,
Wait for each specified child process <I>id</I> and return the
termination status of the last <I>id</I>.
Each <I>id</I> may be a process ID or a job specification;
if a job spec is given, <B>wait</B> waits for all processes in the job.
<DT><DD>
If no options or <I>id</I>s are supplied,
<B>wait</B> waits for all running background jobs and
the last-executed process substitution, if its process id is the same as
<B>$!</B>,
the last-executed process substitution,
if its process id is the same as <B>$!</B>,
and the return status is zero.
If the <B>-n</B> option is supplied,
<B>wait</B> waits for a single job
from the list of <I>id</I>s or, if no <I>id</I>s are supplied, any job,
<DT><DD>
If the <B>-n</B> option is supplied, <B>wait</B> waits for any one of
the given <I>id</I>s or, if no <I>id</I>s are supplied, any job
or process substitution,
to complete and returns its exit status.
If none of the supplied arguments is a child of the shell, or if no arguments
are supplied and the shell has no unwaited-for children, the exit status
is 127.
If the <B>-p</B> option is supplied, the process or job identifier of the job
for which the exit status is returned is assigned to the variable
<I>varname</I> named by the option argument.
If none of the supplied <I>id</I>s is a child of the shell,
or if no <I>id</I>s are supplied and the shell has no unwaited-for children,
the exit status is 127.
<DT><DD>
If the <B>-p</B> option is supplied, the process or job identifier
of the job for which the exit status is returned is assigned to the
variable <I>varname</I> named by the option argument.
The variable will be unset initially, before any assignment.
This is useful only when the <B>-n</B> option is supplied.
<DT><DD>
Supplying the <B>-f</B> option, when job control is enabled,
forces <B>wait</B> to wait for <I>id</I> to terminate before returning
its status, instead of returning when it changes status.
If
<I>id</I>
specifies a non-existent process or job, the return status is 127.
If <B>wait</B> is interrupted by a signal, the return status will be greater
forces <B>wait</B> to wait for each <I>id</I> to terminate before
returning its status, instead of returning when it changes status.
<DT><DD>
If none of the <I>id</I>s specify one of the shell's active child
processes, the return status is 127.
If <B>wait</B> is interrupted by a signal,
any <I>varname</I> will remain unset,
and the return status will be greater
than 128, as described under
<B>SIGNALS</B>
above.
Otherwise, the return status is the exit status of the last
process or job waited for.
Otherwise, the return status is the exit status of the last <I>id</I>.
</DL>
<A NAME="lbDC">&nbsp;</A>
<H3>SHELL COMPATIBILITY MODE</H3>
@@ -15489,7 +15489,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2024 July 2<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2024 August 7<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -15595,7 +15595,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-20240724/doc/bash.1.<BR>
Time: 25 July 2024 11:43:06 EDT
This document was created by man2html from /usr/local/src/bash/bash-20240730/doc/bash.1.<BR>
Time: 07 August 2024 10:18:33 EDT
</BODY>
</HTML>
+182 -174
View File
@@ -1,9 +1,9 @@
This is bash.info, produced by makeinfo version 7.1 from bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 25 July 2024).
Bash shell (version 5.3, 7 August 2024).
This is Edition 5.3, last updated 25 July 2024, of The GNU Bash
This is Edition 5.3, last updated 7 August 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Copyright © 1988-2023 Free Software Foundation, Inc.
@@ -26,10 +26,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 25 July 2024). The Bash home page is
Bash shell (version 5.3, 7 August 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 25 July 2024, of The GNU Bash
This is Edition 5.3, last updated 7 August 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -4617,8 +4617,9 @@ parameters, or to display the names and values of shell variables.
immediately following a while or until keyword, part of
the test in an if statement, part of any command executed in
a && or || list except the command following the final
&& or ||, any command in a pipeline but the last, or if
the command's return status is being inverted with !. If a
&& or ||, any command in a pipeline but the last (subject
to the state of the pipefail shell option), or if the
command's return status is being inverted with !. If a
compound command other than a subshell returns a non-zero
status because a command failed while -e was being ignored,
the shell does not exit. A trap on ERR, if set, is executed
@@ -6044,8 +6045,9 @@ Variables::).
assigned, and the expanded value becomes the value assigned plus
the number of seconds since the assignment. The number of seconds
at shell invocation and the current time are always determined by
querying the system clock. If SECONDS is unset, it loses its
special properties, even if it is subsequently reset.
querying the system clock at one-second resolution. If SECONDS
is unset, it loses its special properties, even if it is
subsequently reset.
SHELL
This environment variable expands to the full pathname to the
@@ -7987,32 +7989,38 @@ File: bash.info, Node: Job Control Builtins, Next: Job Control Variables, Pre
option is encountered.
wait
wait [-fn] [-p VARNAME] [JOBSPEC or PID ...]
wait [-fn] [-p VARNAME] [ID ...]
Wait until the child process specified by each ID exits and return
the exit status of the last ID. Each ID may be a PID or job
specification JOBSPEC; if a job spec is given, wait waits for all
processes in the job.
If no options or IDs are supplied, wait waits for all running
background jobs and the last-executed process substitution, if its
process id is the same as $!, and the return status is zero.
If the -n option is supplied, wait waits for any one of the IDs
or, if no IDs are supplied, any job or process substitution, to
complete and returns its exit status. If none of the supplied IDs
is a child of the shell, or if no arguments are supplied and the
shell has no unwaited-for children, the exit status is 127.
If the -p option is supplied, the process or job identifier of
the job for which the exit status is returned is assigned to the
variable VARNAME named by the option argument. The variable will
be unset initially, before any assignment. This is useful only
when the -n option is supplied.
Wait until the child process specified by each process ID PID or
job specification JOBSPEC exits and return the exit status of the
last command waited for. If a job spec is given, all processes in
the job are waited for. If no arguments are given, wait waits
for all running background jobs and the last-executed process
substitution, if its process id is the same as $!, and the return
status is zero. If the -n option is supplied, wait waits for a
single job from the list of PIDs or JOBSPECs or, if no arguments
are supplied, any job, to complete and returns its exit status. If
none of the supplied arguments is a child of the shell, or if no
arguments are supplied and the shell has no unwaited-for children,
the exit status is 127. If the -p option is supplied, the
process or job identifier of the job for which the exit status is
returned is assigned to the variable VARNAME named by the option
argument. The variable will be unset initially, before any
assignment. This is useful only when the -n option is supplied.
Supplying the -f option, when job control is enabled, forces
wait to wait for each PID or JOBSPEC to terminate before
returning its status, instead of returning when it changes status.
If neither JOBSPEC nor PID specifies an active child process of the
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.
wait to wait for each ID to terminate before returning its
status, instead of returning when it changes status.
If none of the IDs specify one of the shell's an active child
processes, the return status is 127. If wait is interrupted by a
signal, any VARNAME will remain unset, and the return status will
be greater than 128, as described above (*note Signals::).
Otherwise, the return status is the exit status of the last ID.
disown
disown [-ar] [-h] [JOBSPEC ... | PID ... ]
@@ -12255,7 +12263,7 @@ D.1 Index of Shell Builtin Commands
* dirs: Directory Stack Builtins.
(line 7)
* disown: Job Control Builtins.
(line 104)
(line 110)
* echo: Bash Builtins. (line 273)
* enable: Bash Builtins. (line 322)
* eval: Bourne Shell Builtins.
@@ -12306,7 +12314,7 @@ D.1 Index of Shell Builtin Commands
* shopt: The Shopt Builtin. (line 9)
* source: Bash Builtins. (line 639)
* suspend: Job Control Builtins.
(line 116)
(line 122)
* test: Bourne Shell Builtins.
(line 289)
* times: Bourne Shell Builtins.
@@ -12587,9 +12595,9 @@ D.3 Parameter and Variable Index
* search-ignore-case: Readline Init File Syntax.
(line 332)
* SECONDS: Bash Variables. (line 691)
* SHELL: Bash Variables. (line 700)
* SHELLOPTS: Bash Variables. (line 705)
* SHLVL: Bash Variables. (line 714)
* SHELL: Bash Variables. (line 701)
* SHELLOPTS: Bash Variables. (line 706)
* SHLVL: Bash Variables. (line 715)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 337)
* show-all-if-unmodified: Readline Init File Syntax.
@@ -12598,15 +12606,15 @@ D.3 Parameter and Variable Index
(line 352)
* skip-completed-text: Readline Init File Syntax.
(line 358)
* SRANDOM: Bash Variables. (line 719)
* SRANDOM: Bash Variables. (line 720)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TEXTDOMAINDIR: Creating Internationalized Scripts.
(line 51)
* TIMEFORMAT: Bash Variables. (line 728)
* TMOUT: Bash Variables. (line 766)
* TMPDIR: Bash Variables. (line 778)
* UID: Bash Variables. (line 782)
* TIMEFORMAT: Bash Variables. (line 729)
* TMOUT: Bash Variables. (line 767)
* TMPDIR: Bash Variables. (line 779)
* UID: Bash Variables. (line 783)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 371)
* vi-ins-mode-string: Readline Init File Syntax.
@@ -12998,138 +13006,138 @@ D.5 Concept Index

Tag Table:
Node: Top893
Node: Introduction2826
Node: What is Bash?3039
Node: What is a shell?4180
Node: Definitions6759
Node: Basic Shell Features9935
Node: Shell Syntax11155
Node: Shell Operation12182
Node: Quoting13480
Node: Escape Character14793
Node: Single Quotes15291
Node: Double Quotes15640
Node: ANSI-C Quoting16983
Node: Locale Translation18368
Node: Creating Internationalized Scripts19712
Node: Comments23910
Node: Shell Commands24545
Node: Reserved Words25484
Node: Simple Commands26349
Node: Pipelines27008
Node: Lists30071
Node: Compound Commands31943
Node: Looping Constructs32952
Node: Conditional Constructs35496
Node: Command Grouping50317
Node: Coprocesses51804
Node: GNU Parallel54500
Node: Shell Functions55418
Node: Shell Parameters63524
Node: Positional Parameters68057
Node: Special Parameters68992
Node: Shell Expansions72298
Node: Brace Expansion74487
Node: Tilde Expansion77150
Node: Shell Parameter Expansion79916
Node: Command Substitution99023
Node: Arithmetic Expansion102556
Node: Process Substitution103521
Node: Word Splitting104658
Node: Filename Expansion106799
Node: Pattern Matching109895
Node: Quote Removal115128
Node: Redirections115432
Node: Executing Commands125241
Node: Simple Command Expansion125908
Node: Command Search and Execution128019
Node: Command Execution Environment130427
Node: Environment133736
Node: Exit Status135440
Node: Signals137225
Node: Shell Scripts140839
Node: Shell Builtin Commands143931
Node: Bourne Shell Builtins146042
Node: Bash Builtins170812
Node: Modifying Shell Behavior205826
Node: The Set Builtin206168
Node: The Shopt Builtin217683
Node: Special Builtins234645
Node: Shell Variables235634
Node: Bourne Shell Variables236068
Node: Bash Variables238261
Node: Bash Features275426
Node: Invoking Bash276440
Node: Bash Startup Files282839
Node: Interactive Shells288142
Node: What is an Interactive Shell?288550
Node: Is this Shell Interactive?289216
Node: Interactive Shell Behavior290040
Node: Bash Conditional Expressions293794
Node: Shell Arithmetic298968
Node: Aliases302050
Node: Arrays305005
Node: The Directory Stack311804
Node: Directory Stack Builtins312601
Node: Controlling the Prompt317050
Node: The Restricted Shell320188
Node: Bash POSIX Mode322975
Node: Shell Compatibility Mode340486
Node: Job Control349253
Node: Job Control Basics349710
Node: Job Control Builtins354884
Node: Job Control Variables360844
Node: Command Line Editing362021
Node: Introduction and Notation363725
Node: Readline Interaction365369
Node: Readline Bare Essentials366557
Node: Readline Movement Commands368375
Node: Readline Killing Commands369372
Node: Readline Arguments371350
Node: Searching372407
Node: Readline Init File374636
Node: Readline Init File Syntax375918
Node: Conditional Init Constructs400856
Node: Sample Init File405221
Node: Bindable Readline Commands408342
Node: Commands For Moving409567
Node: Commands For History411794
Node: Commands For Text416999
Node: Commands For Killing421133
Node: Numeric Arguments423934
Node: Commands For Completion425086
Node: Keyboard Macros429402
Node: Miscellaneous Commands430103
Node: Readline vi Mode436757
Node: Programmable Completion437709
Node: Programmable Completion Builtins445666
Node: A Programmable Completion Example457232
Node: Using History Interactively462577
Node: Bash History Facilities463258
Node: Bash History Builtins466370
Node: History Interaction471613
Node: Event Designators475938
Node: Word Designators477521
Node: Modifiers479507
Node: Installing Bash481416
Node: Basic Installation482550
Node: Compilers and Options486429
Node: Compiling For Multiple Architectures487179
Node: Installation Names488928
Node: Specifying the System Type491162
Node: Sharing Defaults491908
Node: Operation Controls492622
Node: Optional Features493641
Node: Reporting Bugs505443
Node: Major Differences From The Bourne Shell506792
Node: GNU Free Documentation License526527
Node: Indexes551704
Node: Builtin Index552155
Node: Reserved Word Index559253
Node: Variable Index561698
Node: Function Index578829
Node: Concept Index592685
Node: Top895
Node: Introduction2830
Node: What is Bash?3043
Node: What is a shell?4184
Node: Definitions6763
Node: Basic Shell Features9939
Node: Shell Syntax11159
Node: Shell Operation12186
Node: Quoting13484
Node: Escape Character14797
Node: Single Quotes15295
Node: Double Quotes15644
Node: ANSI-C Quoting16987
Node: Locale Translation18372
Node: Creating Internationalized Scripts19716
Node: Comments23914
Node: Shell Commands24549
Node: Reserved Words25488
Node: Simple Commands26353
Node: Pipelines27012
Node: Lists30075
Node: Compound Commands31947
Node: Looping Constructs32956
Node: Conditional Constructs35500
Node: Command Grouping50321
Node: Coprocesses51808
Node: GNU Parallel54504
Node: Shell Functions55422
Node: Shell Parameters63528
Node: Positional Parameters68061
Node: Special Parameters68996
Node: Shell Expansions72302
Node: Brace Expansion74491
Node: Tilde Expansion77154
Node: Shell Parameter Expansion79920
Node: Command Substitution99027
Node: Arithmetic Expansion102560
Node: Process Substitution103525
Node: Word Splitting104662
Node: Filename Expansion106803
Node: Pattern Matching109899
Node: Quote Removal115132
Node: Redirections115436
Node: Executing Commands125245
Node: Simple Command Expansion125912
Node: Command Search and Execution128023
Node: Command Execution Environment130431
Node: Environment133740
Node: Exit Status135444
Node: Signals137229
Node: Shell Scripts140843
Node: Shell Builtin Commands143935
Node: Bourne Shell Builtins146046
Node: Bash Builtins170816
Node: Modifying Shell Behavior205830
Node: The Set Builtin206172
Node: The Shopt Builtin217755
Node: Special Builtins234717
Node: Shell Variables235706
Node: Bourne Shell Variables236140
Node: Bash Variables238333
Node: Bash Features275528
Node: Invoking Bash276542
Node: Bash Startup Files282941
Node: Interactive Shells288244
Node: What is an Interactive Shell?288652
Node: Is this Shell Interactive?289318
Node: Interactive Shell Behavior290142
Node: Bash Conditional Expressions293896
Node: Shell Arithmetic299070
Node: Aliases302152
Node: Arrays305107
Node: The Directory Stack311906
Node: Directory Stack Builtins312703
Node: Controlling the Prompt317152
Node: The Restricted Shell320290
Node: Bash POSIX Mode323077
Node: Shell Compatibility Mode340588
Node: Job Control349355
Node: Job Control Basics349812
Node: Job Control Builtins354986
Node: Job Control Variables360930
Node: Command Line Editing362107
Node: Introduction and Notation363811
Node: Readline Interaction365455
Node: Readline Bare Essentials366643
Node: Readline Movement Commands368461
Node: Readline Killing Commands369458
Node: Readline Arguments371436
Node: Searching372493
Node: Readline Init File374722
Node: Readline Init File Syntax376004
Node: Conditional Init Constructs400942
Node: Sample Init File405307
Node: Bindable Readline Commands408428
Node: Commands For Moving409653
Node: Commands For History411880
Node: Commands For Text417085
Node: Commands For Killing421219
Node: Numeric Arguments424020
Node: Commands For Completion425172
Node: Keyboard Macros429488
Node: Miscellaneous Commands430189
Node: Readline vi Mode436843
Node: Programmable Completion437795
Node: Programmable Completion Builtins445752
Node: A Programmable Completion Example457318
Node: Using History Interactively462663
Node: Bash History Facilities463344
Node: Bash History Builtins466456
Node: History Interaction471699
Node: Event Designators476024
Node: Word Designators477607
Node: Modifiers479593
Node: Installing Bash481502
Node: Basic Installation482636
Node: Compilers and Options486515
Node: Compiling For Multiple Architectures487265
Node: Installation Names489014
Node: Specifying the System Type491248
Node: Sharing Defaults491994
Node: Operation Controls492708
Node: Optional Features493727
Node: Reporting Bugs505529
Node: Major Differences From The Bourne Shell506878
Node: GNU Free Documentation License526613
Node: Indexes551790
Node: Builtin Index552241
Node: Reserved Word Index559339
Node: Variable Index561784
Node: Function Index578915
Node: Concept Index592771

End Tag Table
BIN
View File
Binary file not shown.
+40 -34
View File
@@ -4,9 +4,9 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This text is a brief description of the features that are present in
the Bash shell (version 5.3, 25 July 2024).
the Bash shell (version 5.3, 7 August 2024).
This is Edition 5.3, last updated 25 July 2024,
This is Edition 5.3, last updated 7 August 2024,
of The GNU Bash Reference Manual,
for Bash, Version 5.3.
@@ -77,10 +77,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
<h1 class="top" id="Bash-Features-1"><span>Bash Features<a class="copiable-link" href="#Bash-Features-1"> &para;</a></span></h1>
<p>This text is a brief description of the features that are present in
the Bash shell (version 5.3, 25 July 2024).
the Bash shell (version 5.3, 7 August 2024).
The Bash home page is <a class="url" href="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</a>.
</p>
<p>This is Edition 5.3, last updated 25 July 2024,
<p>This is Edition 5.3, last updated 7 August 2024,
of <cite class="cite">The GNU Bash Reference Manual</cite>,
for <code class="code">Bash</code>, Version 5.3.
</p>
@@ -1163,8 +1163,8 @@ the standard input for asynchronous commands, in the absence of any
explicit redirections, is redirected from <code class="code">/dev/null</code>.
</p>
<p>Commands separated by a &lsquo;<samp class="samp">;</samp>&rsquo; are executed sequentially; the shell
waits for each command to terminate in turn. The return status is the
exit status of the last command executed.
waits for each command to terminate in turn.
The return status is the exit status of the last command executed.
</p>
<p><small class="sc">AND</small> and <small class="sc">OR</small> lists are sequences of one or more pipelines
separated by the control operators &lsquo;<samp class="samp">&amp;&amp;</samp>&rsquo; and &lsquo;<samp class="samp">||</samp>&rsquo;,
@@ -6098,7 +6098,8 @@ command list immediately following a <code class="code">while</code> or <code cl
part of the test in an <code class="code">if</code> statement,
part of any command executed in a <code class="code">&amp;&amp;</code> or <code class="code">||</code> list except
the command following the final <code class="code">&amp;&amp;</code> or <code class="code">||</code>,
any command in a pipeline but the last,
any command in a pipeline but the last
(subject to the state of the <code class="code">pipefail</code> shell option),
or if the command&rsquo;s return status is being inverted with <code class="code">!</code>.
If a compound command other than a subshell
returns a non-zero status because a command failed
@@ -7886,7 +7887,7 @@ Assignment to this variable resets the count to the value assigned, and the
expanded value becomes the value assigned plus the number of seconds
since the assignment.
The number of seconds at shell invocation and the current time are always
determined by querying the system clock.
determined by querying the system clock at one-second resolution.
If <code class="env">SECONDS</code>
is unset, it loses its special properties,
even if it is subsequently reset.
@@ -10297,40 +10298,45 @@ or non-zero if an error occurs or an invalid option is encountered.
</dd>
<dt><a id="index-wait"></a><span><code class="code">wait</code><a class="copiable-link" href="#index-wait"> &para;</a></span></dt>
<dd><div class="example">
<pre class="example-preformatted">wait [-fn] [-p <var class="var">varname</var>] [<var class="var">jobspec</var> or <var class="var">pid</var> ...]
<pre class="example-preformatted">wait [-fn] [-p <var class="var">varname</var>] [<var class="var">id</var> ...]
</pre></div>
<p>Wait until the child process specified by each process <small class="sc">ID</small> <var class="var">pid</var>
or job specification <var class="var">jobspec</var> exits and return the exit status of the
last command waited for.
If a job spec is given, all processes in the job are waited for.
If no arguments are given,
<p>Wait until the child process specified by each <var class="var">id</var> exits and
return the exit status of the last <var class="var">id</var>.
Each <var class="var">id</var> may be a <var class="var">pid</var> or job specification <var class="var">jobspec</var>;
if a job spec is given, <code class="code">wait</code> waits for all processes in the job.
</p>
<p>If no options or <var class="var">id</var>s are supplied,
<code class="code">wait</code> waits for all running background jobs and
the last-executed process substitution, if its process id is the same as
<var class="var">$!</var>,
the last-executed process substitution,
if its process id is the same as <var class="var">$!</var>,
and the return status is zero.
If the <samp class="option">-n</samp> option is supplied, <code class="code">wait</code> waits for a single job
from the list of <var class="var">pid</var>s or <var class="var">jobspec</var>s or, if no arguments are
supplied, any job,
</p>
<p>If the <samp class="option">-n</samp> option is supplied, <code class="code">wait</code> waits for any one of
the <var class="var">id</var>s or, if no <var class="var">id</var>s are supplied, any job
or process substitution,
to complete and returns its exit status.
If none of the supplied arguments is a child of the shell, or if no arguments
are supplied and the shell has no unwaited-for children, the exit status
is 127.
If the <samp class="option">-p</samp> option is supplied, the process or job identifier of the job
for which the exit status is returned is assigned to the variable
<var class="var">varname</var> named by the option argument.
If none of the supplied <var class="var">id</var>s is a child of the shell,
or if no arguments are supplied and the shell has no unwaited-for children,
the exit status is 127.
</p>
<p>If the <samp class="option">-p</samp> option is supplied, the process or job identifier
of the job for which the exit status is returned is assigned to the
variable <var class="var">varname</var> named by the option argument.
The variable will be unset initially, before any assignment.
This is useful only when the <samp class="option">-n</samp> option is supplied.
Supplying the <samp class="option">-f</samp> option, when job control is enabled,
forces <code class="code">wait</code> to wait for each <var class="var">pid</var> or <var class="var">jobspec</var> to
terminate before returning its status, instead of returning when it changes
status.
If neither <var class="var">jobspec</var> nor <var class="var">pid</var> specifies an active child process
of the shell, the return status is 127.
If <code class="code">wait</code> is interrupted by a signal, the return status will be greater
</p>
<p>Supplying the <samp class="option">-f</samp> option, when job control is enabled,
forces <code class="code">wait</code> to wait for each <var class="var">id</var> to terminate before
returning its status, instead of returning when it changes status.
</p>
<p>If none of the <var class="var">id</var>s specify one of the shell&rsquo;s an active child
processes, the return status is 127.
If <code class="code">wait</code> is interrupted by a signal,
any <var class="var">varname</var> will remain unset,
and the return status will be greater
than 128, as described above (see <a class="pxref" href="#Signals">Signals</a>).
Otherwise, the return status is the exit status
of the last process or job waited for.
Otherwise, the return status is the exit status of the last <var class="var">id</var>.
</p>
</dd>
<dt><a id="index-disown"></a><span><code class="code">disown</code><a class="copiable-link" href="#index-disown"> &para;</a></span></dt>
+182 -174
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 7.1 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 25 July 2024).
Bash shell (version 5.3, 7 August 2024).
This is Edition 5.3, last updated 25 July 2024, of The GNU Bash
This is Edition 5.3, last updated 7 August 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Copyright © 1988-2023 Free Software Foundation, Inc.
@@ -27,10 +27,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 25 July 2024). The Bash home page is
Bash shell (version 5.3, 7 August 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 25 July 2024, of The GNU Bash
This is Edition 5.3, last updated 7 August 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -4618,8 +4618,9 @@ parameters, or to display the names and values of shell variables.
immediately following a while or until keyword, part of
the test in an if statement, part of any command executed in
a && or || list except the command following the final
&& or ||, any command in a pipeline but the last, or if
the command's return status is being inverted with !. If a
&& or ||, any command in a pipeline but the last (subject
to the state of the pipefail shell option), or if the
command's return status is being inverted with !. If a
compound command other than a subshell returns a non-zero
status because a command failed while -e was being ignored,
the shell does not exit. A trap on ERR, if set, is executed
@@ -6045,8 +6046,9 @@ Variables::).
assigned, and the expanded value becomes the value assigned plus
the number of seconds since the assignment. The number of seconds
at shell invocation and the current time are always determined by
querying the system clock. If SECONDS is unset, it loses its
special properties, even if it is subsequently reset.
querying the system clock at one-second resolution. If SECONDS
is unset, it loses its special properties, even if it is
subsequently reset.
SHELL
This environment variable expands to the full pathname to the
@@ -7988,32 +7990,38 @@ File: bashref.info, Node: Job Control Builtins, Next: Job Control Variables,
option is encountered.
wait
wait [-fn] [-p VARNAME] [JOBSPEC or PID ...]
wait [-fn] [-p VARNAME] [ID ...]
Wait until the child process specified by each ID exits and return
the exit status of the last ID. Each ID may be a PID or job
specification JOBSPEC; if a job spec is given, wait waits for all
processes in the job.
If no options or IDs are supplied, wait waits for all running
background jobs and the last-executed process substitution, if its
process id is the same as $!, and the return status is zero.
If the -n option is supplied, wait waits for any one of the IDs
or, if no IDs are supplied, any job or process substitution, to
complete and returns its exit status. If none of the supplied IDs
is a child of the shell, or if no arguments are supplied and the
shell has no unwaited-for children, the exit status is 127.
If the -p option is supplied, the process or job identifier of
the job for which the exit status is returned is assigned to the
variable VARNAME named by the option argument. The variable will
be unset initially, before any assignment. This is useful only
when the -n option is supplied.
Wait until the child process specified by each process ID PID or
job specification JOBSPEC exits and return the exit status of the
last command waited for. If a job spec is given, all processes in
the job are waited for. If no arguments are given, wait waits
for all running background jobs and the last-executed process
substitution, if its process id is the same as $!, and the return
status is zero. If the -n option is supplied, wait waits for a
single job from the list of PIDs or JOBSPECs or, if no arguments
are supplied, any job, to complete and returns its exit status. If
none of the supplied arguments is a child of the shell, or if no
arguments are supplied and the shell has no unwaited-for children,
the exit status is 127. If the -p option is supplied, the
process or job identifier of the job for which the exit status is
returned is assigned to the variable VARNAME named by the option
argument. The variable will be unset initially, before any
assignment. This is useful only when the -n option is supplied.
Supplying the -f option, when job control is enabled, forces
wait to wait for each PID or JOBSPEC to terminate before
returning its status, instead of returning when it changes status.
If neither JOBSPEC nor PID specifies an active child process of the
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.
wait to wait for each ID to terminate before returning its
status, instead of returning when it changes status.
If none of the IDs specify one of the shell's an active child
processes, the return status is 127. If wait is interrupted by a
signal, any VARNAME will remain unset, and the return status will
be greater than 128, as described above (*note Signals::).
Otherwise, the return status is the exit status of the last ID.
disown
disown [-ar] [-h] [JOBSPEC ... | PID ... ]
@@ -12256,7 +12264,7 @@ D.1 Index of Shell Builtin Commands
* dirs: Directory Stack Builtins.
(line 7)
* disown: Job Control Builtins.
(line 104)
(line 110)
* echo: Bash Builtins. (line 273)
* enable: Bash Builtins. (line 322)
* eval: Bourne Shell Builtins.
@@ -12307,7 +12315,7 @@ D.1 Index of Shell Builtin Commands
* shopt: The Shopt Builtin. (line 9)
* source: Bash Builtins. (line 639)
* suspend: Job Control Builtins.
(line 116)
(line 122)
* test: Bourne Shell Builtins.
(line 289)
* times: Bourne Shell Builtins.
@@ -12588,9 +12596,9 @@ D.3 Parameter and Variable Index
* search-ignore-case: Readline Init File Syntax.
(line 332)
* SECONDS: Bash Variables. (line 691)
* SHELL: Bash Variables. (line 700)
* SHELLOPTS: Bash Variables. (line 705)
* SHLVL: Bash Variables. (line 714)
* SHELL: Bash Variables. (line 701)
* SHELLOPTS: Bash Variables. (line 706)
* SHLVL: Bash Variables. (line 715)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 337)
* show-all-if-unmodified: Readline Init File Syntax.
@@ -12599,15 +12607,15 @@ D.3 Parameter and Variable Index
(line 352)
* skip-completed-text: Readline Init File Syntax.
(line 358)
* SRANDOM: Bash Variables. (line 719)
* SRANDOM: Bash Variables. (line 720)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TEXTDOMAINDIR: Creating Internationalized Scripts.
(line 51)
* TIMEFORMAT: Bash Variables. (line 728)
* TMOUT: Bash Variables. (line 766)
* TMPDIR: Bash Variables. (line 778)
* UID: Bash Variables. (line 782)
* TIMEFORMAT: Bash Variables. (line 729)
* TMOUT: Bash Variables. (line 767)
* TMPDIR: Bash Variables. (line 779)
* UID: Bash Variables. (line 783)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 371)
* vi-ins-mode-string: Readline Init File Syntax.
@@ -12999,138 +13007,138 @@ D.5 Concept Index

Tag Table:
Node: Top896
Node: Introduction2832
Node: What is Bash?3048
Node: What is a shell?4192
Node: Definitions6774
Node: Basic Shell Features9953
Node: Shell Syntax11176
Node: Shell Operation12206
Node: Quoting13507
Node: Escape Character14823
Node: Single Quotes15324
Node: Double Quotes15676
Node: ANSI-C Quoting17022
Node: Locale Translation18410
Node: Creating Internationalized Scripts19757
Node: Comments23958
Node: Shell Commands24596
Node: Reserved Words25538
Node: Simple Commands26406
Node: Pipelines27068
Node: Lists30134
Node: Compound Commands32009
Node: Looping Constructs33021
Node: Conditional Constructs35568
Node: Command Grouping50392
Node: Coprocesses51882
Node: GNU Parallel54581
Node: Shell Functions55502
Node: Shell Parameters63611
Node: Positional Parameters68147
Node: Special Parameters69085
Node: Shell Expansions72394
Node: Brace Expansion74586
Node: Tilde Expansion77252
Node: Shell Parameter Expansion80021
Node: Command Substitution99131
Node: Arithmetic Expansion102667
Node: Process Substitution103635
Node: Word Splitting104775
Node: Filename Expansion106919
Node: Pattern Matching110018
Node: Quote Removal115254
Node: Redirections115561
Node: Executing Commands125373
Node: Simple Command Expansion126043
Node: Command Search and Execution128157
Node: Command Execution Environment130568
Node: Environment133880
Node: Exit Status135587
Node: Signals137375
Node: Shell Scripts140992
Node: Shell Builtin Commands144087
Node: Bourne Shell Builtins146201
Node: Bash Builtins170974
Node: Modifying Shell Behavior205991
Node: The Set Builtin206336
Node: The Shopt Builtin217854
Node: Special Builtins234819
Node: Shell Variables235811
Node: Bourne Shell Variables236248
Node: Bash Variables238444
Node: Bash Features275612
Node: Invoking Bash276629
Node: Bash Startup Files283031
Node: Interactive Shells288337
Node: What is an Interactive Shell?288748
Node: Is this Shell Interactive?289417
Node: Interactive Shell Behavior290244
Node: Bash Conditional Expressions294001
Node: Shell Arithmetic299178
Node: Aliases302263
Node: Arrays305221
Node: The Directory Stack312023
Node: Directory Stack Builtins312823
Node: Controlling the Prompt317275
Node: The Restricted Shell320416
Node: Bash POSIX Mode323206
Node: Shell Compatibility Mode340720
Node: Job Control349490
Node: Job Control Basics349950
Node: Job Control Builtins355127
Node: Job Control Variables361090
Node: Command Line Editing362270
Node: Introduction and Notation363977
Node: Readline Interaction365624
Node: Readline Bare Essentials366815
Node: Readline Movement Commands368636
Node: Readline Killing Commands369636
Node: Readline Arguments371617
Node: Searching372677
Node: Readline Init File374909
Node: Readline Init File Syntax376194
Node: Conditional Init Constructs401135
Node: Sample Init File405503
Node: Bindable Readline Commands408627
Node: Commands For Moving409855
Node: Commands For History412085
Node: Commands For Text417293
Node: Commands For Killing421430
Node: Numeric Arguments424234
Node: Commands For Completion425389
Node: Keyboard Macros429708
Node: Miscellaneous Commands430412
Node: Readline vi Mode437069
Node: Programmable Completion438024
Node: Programmable Completion Builtins445984
Node: A Programmable Completion Example457553
Node: Using History Interactively462901
Node: Bash History Facilities463585
Node: Bash History Builtins466700
Node: History Interaction471946
Node: Event Designators476274
Node: Word Designators477860
Node: Modifiers479849
Node: Installing Bash481761
Node: Basic Installation482898
Node: Compilers and Options486780
Node: Compiling For Multiple Architectures487533
Node: Installation Names489285
Node: Specifying the System Type491522
Node: Sharing Defaults492271
Node: Operation Controls492988
Node: Optional Features494010
Node: Reporting Bugs505815
Node: Major Differences From The Bourne Shell507167
Node: GNU Free Documentation License526905
Node: Indexes552085
Node: Builtin Index552539
Node: Reserved Word Index559640
Node: Variable Index562088
Node: Function Index579222
Node: Concept Index593081
Node: Top898
Node: Introduction2836
Node: What is Bash?3052
Node: What is a shell?4196
Node: Definitions6778
Node: Basic Shell Features9957
Node: Shell Syntax11180
Node: Shell Operation12210
Node: Quoting13511
Node: Escape Character14827
Node: Single Quotes15328
Node: Double Quotes15680
Node: ANSI-C Quoting17026
Node: Locale Translation18414
Node: Creating Internationalized Scripts19761
Node: Comments23962
Node: Shell Commands24600
Node: Reserved Words25542
Node: Simple Commands26410
Node: Pipelines27072
Node: Lists30138
Node: Compound Commands32013
Node: Looping Constructs33025
Node: Conditional Constructs35572
Node: Command Grouping50396
Node: Coprocesses51886
Node: GNU Parallel54585
Node: Shell Functions55506
Node: Shell Parameters63615
Node: Positional Parameters68151
Node: Special Parameters69089
Node: Shell Expansions72398
Node: Brace Expansion74590
Node: Tilde Expansion77256
Node: Shell Parameter Expansion80025
Node: Command Substitution99135
Node: Arithmetic Expansion102671
Node: Process Substitution103639
Node: Word Splitting104779
Node: Filename Expansion106923
Node: Pattern Matching110022
Node: Quote Removal115258
Node: Redirections115565
Node: Executing Commands125377
Node: Simple Command Expansion126047
Node: Command Search and Execution128161
Node: Command Execution Environment130572
Node: Environment133884
Node: Exit Status135591
Node: Signals137379
Node: Shell Scripts140996
Node: Shell Builtin Commands144091
Node: Bourne Shell Builtins146205
Node: Bash Builtins170978
Node: Modifying Shell Behavior205995
Node: The Set Builtin206340
Node: The Shopt Builtin217926
Node: Special Builtins234891
Node: Shell Variables235883
Node: Bourne Shell Variables236320
Node: Bash Variables238516
Node: Bash Features275714
Node: Invoking Bash276731
Node: Bash Startup Files283133
Node: Interactive Shells288439
Node: What is an Interactive Shell?288850
Node: Is this Shell Interactive?289519
Node: Interactive Shell Behavior290346
Node: Bash Conditional Expressions294103
Node: Shell Arithmetic299280
Node: Aliases302365
Node: Arrays305323
Node: The Directory Stack312125
Node: Directory Stack Builtins312925
Node: Controlling the Prompt317377
Node: The Restricted Shell320518
Node: Bash POSIX Mode323308
Node: Shell Compatibility Mode340822
Node: Job Control349592
Node: Job Control Basics350052
Node: Job Control Builtins355229
Node: Job Control Variables361176
Node: Command Line Editing362356
Node: Introduction and Notation364063
Node: Readline Interaction365710
Node: Readline Bare Essentials366901
Node: Readline Movement Commands368722
Node: Readline Killing Commands369722
Node: Readline Arguments371703
Node: Searching372763
Node: Readline Init File374995
Node: Readline Init File Syntax376280
Node: Conditional Init Constructs401221
Node: Sample Init File405589
Node: Bindable Readline Commands408713
Node: Commands For Moving409941
Node: Commands For History412171
Node: Commands For Text417379
Node: Commands For Killing421516
Node: Numeric Arguments424320
Node: Commands For Completion425475
Node: Keyboard Macros429794
Node: Miscellaneous Commands430498
Node: Readline vi Mode437155
Node: Programmable Completion438110
Node: Programmable Completion Builtins446070
Node: A Programmable Completion Example457639
Node: Using History Interactively462987
Node: Bash History Facilities463671
Node: Bash History Builtins466786
Node: History Interaction472032
Node: Event Designators476360
Node: Word Designators477946
Node: Modifiers479935
Node: Installing Bash481847
Node: Basic Installation482984
Node: Compilers and Options486866
Node: Compiling For Multiple Architectures487619
Node: Installation Names489371
Node: Specifying the System Type491608
Node: Sharing Defaults492357
Node: Operation Controls493074
Node: Optional Features494096
Node: Reporting Bugs505901
Node: Major Differences From The Bourne Shell507253
Node: GNU Free Documentation License526991
Node: Indexes552171
Node: Builtin Index552625
Node: Reserved Word Index559726
Node: Variable Index562174
Node: Function Index579308
Node: Concept Index593167

End Tag Table
+19 -19
View File
@@ -1,12 +1,12 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/MacPorts 2024.70613_0) (preloaded format=pdfetex 2024.4.9) 25 JUL 2024 11:43
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/MacPorts 2024.70613_0) (preloaded format=pdfetex 2024.4.9) 7 AUG 2024 10:18
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**\input /usr/local/src/bash/bash-20240724/doc/bashref.texi \input /usr/local/s
rc/bash/bash-20240724/doc/bashref.texi
(/usr/local/src/bash/bash-20240724/doc/bashref.texi
(/usr/local/src/bash/bash-20240724/doc/texinfo.tex
**\input /usr/local/src/bash/bash-20240730/doc/bashref.texi \input /usr/local/s
rc/bash/bash-20240730/doc/bashref.texi
(/usr/local/src/bash/bash-20240730/doc/bashref.texi
(/usr/local/src/bash/bash-20240730/doc/texinfo.tex
Loading texinfo [version 2015-11-22.14]:
\outerhsize=\dimen16
\outervsize=\dimen17
@@ -162,15 +162,15 @@ This is `epsf.tex' v2.7.4 <14 February 2011>
texinfo.tex: doing @include of version.texi
(/usr/local/src/bash/bash-20240724/doc/version.texi) [1{/opt/local/var/db/texmf
(/usr/local/src/bash/bash-20240730/doc/version.texi) [1{/opt/local/var/db/texmf
/fonts/map/pdftex/updmap/pdftex.map}] [2]
(/usr/local/build/bash/bash-20240724/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20240724/doc/bashref.toc)
(/usr/local/build/bash/bash-20240724/doc/bashref.toc) Chapter 1
(/usr/local/build/bash/bash-20240730/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20240730/doc/bashref.toc)
(/usr/local/build/bash/bash-20240730/doc/bashref.toc) Chapter 1
\openout0 = `bashref.toc'.
(/usr/local/build/bash/bash-20240724/doc/bashref.aux)
(/usr/local/build/bash/bash-20240730/doc/bashref.aux)
\openout1 = `bashref.aux'.
Chapter 2 [1] [2]
@@ -263,7 +263,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5447--5447
[119] [120]
texinfo.tex: doing @include of rluser.texi
(/usr/local/src/bash/bash-20240724/lib/readline/doc/rluser.texi
(/usr/local/src/bash/bash-20240730/lib/readline/doc/rluser.texi
Chapter 8 [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131]
[132]
Underfull \hbox (badness 7540) in paragraph at lines 882--888
@@ -313,10 +313,10 @@ gnored[]
texinfo.tex: doing @include of hsuser.texi
(/usr/local/src/bash/bash-20240724/lib/readline/doc/hsuser.texi Chapter 9
(/usr/local/src/bash/bash-20240730/lib/readline/doc/hsuser.texi Chapter 9
[158] [159] [160] [161] [162] [163]) Chapter 10 [164] [165] [166] [167]
[168]
Underfull \hbox (badness 10000) in paragraph at lines 9846--9855
Underfull \hbox (badness 10000) in paragraph at lines 9852--9861
[]@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
entation[]@textrm '[],
@@ -329,7 +329,7 @@ entation[]@textrm '[],
.etc.
Underfull \hbox (badness 10000) in paragraph at lines 9846--9855
Underfull \hbox (badness 10000) in paragraph at lines 9852--9861
@textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
extrm '[], `@texttt strict-posix-default[]@textrm '[], and
@@ -345,13 +345,13 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
[178] [179] Appendix C [180]
texinfo.tex: doing @include of fdl.texi
(/usr/local/src/bash/bash-20240724/doc/fdl.texi
(/usr/local/src/bash/bash-20240730/doc/fdl.texi
[181] [182] [183] [184] [185] [186] [187]) Appendix D [188] [189] [190]
[191] [192] [193] [194] [195] [196] [197] )
Here is how much of TeX's memory you used:
4105 strings out of 495840
47629 string characters out of 6171739
143269 words of memory out of 5000000
143209 words of memory out of 5000000
5048 multiletter control sequences out of 15000+600000
34315 words of font info for 116 fonts, out of 8000000 for 9000
701 hyphenation exceptions out of 8191
@@ -372,10 +372,10 @@ texmf-texlive/fonts/type1/public/amsfonts/cm/cmtt12.pfb></opt/local/share/texmf
-texlive/fonts/type1/public/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texli
ve/fonts/type1/public/cm-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fon
ts/type1/public/cm-super/sfrm1440.pfb>
Output written on bashref.pdf (203 pages, 820845 bytes).
Output written on bashref.pdf (203 pages, 820886 bytes).
PDF statistics:
2837 PDF objects out of 2984 (max. 8388607)
2587 compressed objects within 26 object streams
2835 PDF objects out of 2984 (max. 8388607)
2585 compressed objects within 26 object streams
331 named destinations out of 1000 (max. 500000)
1157 words of extra memory for PDF output out of 10000 (max. 10000000)
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -7043,7 +7043,7 @@ Assignment to this variable resets the count to the value assigned, and the
expanded value becomes the value assigned plus the number of seconds
since the assignment.
The number of seconds at shell invocation and the current time are always
determined by querying the system clock.
determined by querying the system clock at one-second resolution.
If @env{SECONDS}
is unset, it loses its special properties,
even if it is subsequently reset.
+31 -22
View File
@@ -1211,7 +1211,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
a wwhhiillee or uunnttiill keyword, part of the test following the
iiff or eelliiff reserved words, part of any command executed
in a &&&& or |||| list except the command following the fi-
nal &&&& or ||||, any command in a pipeline but the last, or
nal &&&& or ||||, any command in a pipeline but the last
(subject to the state of the ppiippeeffaaiill shell option), or
if the command's return value is being inverted with !!.
If a compound command other than a subshell returns a
non-zero status because a command failed while --ee was
@@ -2001,29 +2002,37 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
only or may not be unset.
wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d ...]
Wait for each specified child process and return its termination
status. Each _i_d may be a process ID or a job specification; if
a job spec is given, all processes in that job's pipeline are
waited for. If _i_d is not given, wwaaiitt waits for all running
Wait for each specified child process _i_d and return the termina-
tion status of the last _i_d. Each _i_d may be a process ID or a
job specification; if a job spec is given, wwaaiitt waits for all
processes in the job.
If no options or _i_ds are supplied, wwaaiitt waits for all running
background jobs and the last-executed process substitution, if
its process id is the same as $$!!, and the return status is zero.
If the --nn option is supplied, wwaaiitt waits for a single job from
the list of _i_ds or, if no _i_ds are supplied, any job, to complete
and returns its exit status. If none of the supplied arguments
is a child of the shell, or if no arguments are supplied and the
shell has no unwaited-for children, the exit status is 127. If
the --pp option is supplied, the process or job identifier of the
job for which the exit status is returned is assigned to the
variable _v_a_r_n_a_m_e named by the option argument. The variable
will be unset initially, before any assignment. This is useful
only when the --nn option is supplied. Supplying the --ff option,
when job control is enabled, forces wwaaiitt to wait for _i_d to ter-
minate before returning its status, instead of returning when it
changes status. If _i_d specifies a non-existent process or job,
the return status is 127. If wwaaiitt is interrupted by a signal,
the return status will be greater than 128, as described under
SSIIGGNNAALLSS in _b_a_s_h(1). Otherwise, the return status is the exit
status of the last process or job waited for.
If the --nn option is supplied, wwaaiitt waits for any one of the
given _i_ds or, if no _i_ds are supplied, any job or process substi-
tution, to complete and returns its exit status. If none of the
supplied _i_ds is a child of the shell, or if no _i_ds are supplied
and the shell has no unwaited-for children, the exit status is
127.
If the --pp option is supplied, the process or job identifier of
the job for which the exit status is returned is assigned to the
variable _v_a_r_n_a_m_e named by the option argument. The variable
will be unset initially, before any assignment. This is useful
only when the --nn option is supplied.
Supplying the --ff option, when job control is enabled, forces
wwaaiitt to wait for each _i_d to terminate before returning its sta-
tus, instead of returning when it changes status.
If none of the _i_ds specify one of the shell's active child
processes, the return status is 127. If wwaaiitt is interrupted by
a signal, any _v_a_r_n_a_m_e will remain unset, and the return status
will be greater than 128, as described under SSIIGGNNAALLSS in _b_a_s_h(1).
Otherwise, the return status is the exit status of the last _i_d.
SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE
Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci-
+3 -3
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2024 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Mon Jul 29 11:20:04 EDT 2024
@set LASTCHANGE Wed Aug 7 09:57:58 EDT 2024
@set EDITION 5.3
@set VERSION 5.3
@set UPDATED 29 July 2024
@set UPDATED-MONTH July 2024
@set UPDATED 7 August 2024
@set UPDATED-MONTH August 2024
+1
View File
@@ -559,6 +559,7 @@ extern ssize_t zreadintr (int, char *, size_t);
extern ssize_t zreadc (int, char *);
extern ssize_t zreadcintr (int, char *);
extern ssize_t zreadn (int, char *, size_t);
extern int zungetc (int);
extern void zreset (void);
extern void zsyncfd (int);
+3
View File
@@ -745,6 +745,9 @@ history_do_write (const char *filename, int nelements, int overwrite)
history_lines_written_to_file = 0;
if (nelements < 0)
return (0);
mode = overwrite ? O_RDWR|O_CREAT|O_TRUNC|O_BINARY : O_RDWR|O_APPEND|O_BINARY;
#else
mode = overwrite ? O_WRONLY|O_CREAT|O_TRUNC|O_BINARY : O_WRONLY|O_APPEND|O_BINARY;
+74 -1
View File
@@ -1,6 +1,6 @@
/* zread - read data from file descriptor into buffer with retries */
/* Copyright (C) 1999-2022 Free Software Foundation, Inc.
/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -41,6 +41,10 @@ extern int errno;
# define ZBUFSIZ 4096
#endif
#ifndef EOF
# define EOF -1
#endif
extern int executing_builtin, interrupt_state;
extern void check_signals_and_traps (void);
@@ -51,6 +55,11 @@ extern int read_builtin_timeout (int);
/* Forward declarations */
void zreset (void);
int zungetc (int);
/* Provide one character of pushback whether we are using read or zread. */
static int zpushedchar = -1;
/* Read LEN bytes from FD into BUF. Retry the read on EINTR. Any other
error causes the loop to break. */
ssize_t
@@ -59,6 +68,15 @@ zread (int fd, char *buf, size_t len)
ssize_t r;
check_signals (); /* check for signals before a blocking read */
/* If we pushed a char back, return it immediately */
if (zpushedchar != -1)
{
*buf = (unsigned char)zpushedchar;
zpushedchar = -1;
return 1;
}
/* should generalize into a mechanism where different parts of the shell can
`register' timeouts and have them checked here. */
while (((r = read_builtin_timeout (fd)) < 0 || (r = read (fd, buf, len)) < 0) &&
@@ -96,6 +114,14 @@ zreadretry (int fd, char *buf, size_t len)
ssize_t r;
int nintr;
/* If we pushed a char back, return it immediately */
if (zpushedchar != -1)
{
*buf = (unsigned char)zpushedchar;
zpushedchar = -1;
return 1;
}
for (nintr = 0; ; )
{
r = read (fd, buf, len);
@@ -116,6 +142,15 @@ ssize_t
zreadintr (int fd, char *buf, size_t len)
{
check_signals ();
/* If we pushed a char back, return it immediately */
if (zpushedchar != -1)
{
*buf = (unsigned char)zpushedchar;
zpushedchar = -1;
return 1;
}
return (read (fd, buf, len));
}
@@ -131,6 +166,14 @@ zreadc (int fd, char *cp)
{
ssize_t nr;
/* If we pushed a char back, return it immediately */
if (zpushedchar != -1 && cp)
{
*cp = (unsigned char)zpushedchar;
zpushedchar = -1;
return 1;
}
if (lind == lused || lused == 0)
{
nr = zread (fd, lbuf, sizeof (lbuf));
@@ -154,6 +197,14 @@ zreadcintr (int fd, char *cp)
{
ssize_t nr;
/* If we pushed a char back, return it immediately */
if (zpushedchar != -1 && cp)
{
*cp = (unsigned char)zpushedchar;
zpushedchar = -1;
return 1;
}
if (lind == lused || lused == 0)
{
nr = zreadintr (fd, lbuf, sizeof (lbuf));
@@ -177,6 +228,13 @@ zreadn (int fd, char *cp, size_t len)
{
ssize_t nr;
if (zpushedchar != -1 && cp)
{
*cp = zpushedchar;
zpushedchar = -1;
return 1;
}
if (lind == lused || lused == 0)
{
if (len > sizeof (lbuf))
@@ -195,6 +253,21 @@ zreadn (int fd, char *cp, size_t len)
return 1;
}
int
zungetc (int c)
{
if (zpushedchar == -1)
{
zpushedchar = c;
return c;
}
if (c == EOF || lind == 0)
return (EOF);
lbuf[--lind] = c; /* XXX */
return c;
}
void
zreset (void)
{
+2 -1
View File
@@ -172,9 +172,10 @@ privileged
verbose
vi
xtrace
autocd
array_expand_once
assoc_expand_once
autocd
bash_source_fullpath
cdable_vars
cdspell
checkhash
+10 -3
View File
@@ -1,9 +1,10 @@
./shopt.tests: line 15: shopt: -z: invalid option
shopt: usage: shopt [-pqsu] [-o] [optname ...]
--
shopt -u autocd
shopt -u array_expand_once
shopt -u assoc_expand_once
shopt -u autocd
shopt -u bash_source_fullpath
shopt -u cdable_vars
shopt -s cdspell
shopt -u checkhash
@@ -79,9 +80,10 @@ shopt -s progcomp
shopt -s promptvars
shopt -s sourcepath
--
shopt -u autocd
shopt -u array_expand_once
shopt -u assoc_expand_once
shopt -u autocd
shopt -u bash_source_fullpath
shopt -u cdable_vars
shopt -u checkhash
shopt -u checkjobs
@@ -124,9 +126,10 @@ shopt -u shift_verbose
shopt -u varredir_close
shopt -u xpg_echo
--
autocd off
array_expand_once off
assoc_expand_once off
autocd off
bash_source_fullpath off
cdable_vars off
checkhash off
checkjobs off
@@ -307,5 +310,9 @@ xtrace off
--
./shopt.tests: line 106: shopt: xyz1: invalid shell option name
./shopt.tests: line 107: shopt: xyz1: invalid option name
4c4
< bash_source_fullpath on
---
> bash_source_fullpath off
expand_aliases on
expand_aliases on