new bash_source_fullpath shell option; documentation updates for wait builtin

This commit is contained in:
Chet Ramey
2024-07-30 11:18:17 -04:00
parent d5ef283cbd
commit e45ec6f76b
23 changed files with 509 additions and 387 deletions
+36
View File
@@ -9872,3 +9872,39 @@ lib/malloc/malloc.c
otherwise
- internal_realloc: don't check bucket at nunits-1 unless nunits >= 1
Report and fix from Collin Funk <collin.funk1@gmail.com>
7/25
----
variables.c
- push_source: new function, pushes a filename to BASH_SOURCE; changed
callers (shell.c, execute_cmd.c, builtins/evalfile.c)
- bash_source_fullpath: new variable, if non-zero, push_source runs
the filename through sh_realpath before pushing it to BASH_SOURCE
Feature requested by several, including konsolebox <konsolebox@gmail.com>
builtins/shopt.def
- bash_source_fullpath: new option, controls bash_source_fullpath and
whether or not BASH_SOURCE contains full pathnames
doc/bash.1,doc/bashref.texi
- bash_source_fullpath: document new shell option
7/26
----
jobs.c,jobs.h,subst.c
- last_procsub_pid: new variable, set to the pid of last_procsub_child,
so it will survive the PROCESS * being deleted if we need it. Not
used yet
7/29
----
doc/bash.1,doc/bashref.texi
- wait: update description to clarify wait -n and unify language
Inspired by report from Zachary Santer <zsanter@gmail.com>
- set: note that the -e behavior for pipelines is affected by the
state of the pipefail option
From a report by Martin D Kealey <martin@kurahaupo.gen.nz>
variables.c,hashcmd.c,builtins/hash.def,builtins/history.def,builtins/source.def
- use ABSPATH/RELPATH/absolute_program instead of testing for slash
explicitly
+1 -1
View File
@@ -156,7 +156,7 @@ hash_builtin (WORD_LIST *list)
#if defined (RESTRICTED_SHELL)
if (restricted && pathname)
{
if (strchr (pathname, '/'))
if (absolute_program (pathname))
{
sh_restricted (pathname);
return (EXECUTION_FAILURE);
+1 -1
View File
@@ -282,7 +282,7 @@ history_builtin (WORD_LIST *list)
}
#if defined (RESTRICTED_SHELL)
if (restricted && strchr (filename, '/'))
if (restricted && absolute_program (filename))
{
sh_restricted (filename);
return (EXECUTION_FAILURE);
+5 -1
View File
@@ -97,6 +97,7 @@ extern int localvar_unset;
extern int varassign_redir_autoclose;
extern int singlequote_translations;
extern int patsub_replacement;
extern int bash_source_fullpath;
#if defined (EXTENDED_GLOB)
extern int extended_glob;
@@ -177,10 +178,13 @@ static struct {
int *value;
shopt_set_func_t *set_func;
} shopt_vars[] = {
{ "autocd", &autocd, (shopt_set_func_t *)NULL },
#if defined (ARRAY_VARS)
{ "array_expand_once", &expand_once_flag, set_array_expand },
{ "assoc_expand_once", &expand_once_flag, set_array_expand },
#endif
{ "autocd", &autocd, (shopt_set_func_t *)NULL },
#if defined (ARRAY_VARS)
{ "bash_source_fullpath", &bash_source_fullpath, (shopt_set_func_t *)NULL },
#endif
{ "cdable_vars", &cdable_vars, (shopt_set_func_t *)NULL },
{ "cdspell", &cdspelling, (shopt_set_func_t *)NULL },
+2 -2
View File
@@ -146,7 +146,7 @@ source_builtin (WORD_LIST *list)
}
#if defined (RESTRICTED_SHELL)
if (restricted && (pathstring || strchr (list->word->word, '/')))
if (restricted && (pathstring || absolute_program (list->word->word)))
{
sh_restricted (list->word->word);
return (EXECUTION_FAILURE);
@@ -162,7 +162,7 @@ source_builtin (WORD_LIST *list)
filename = (char *)NULL;
/* XXX -- should this be absolute_pathname? */
if (posixly_correct && strchr (list->word->word, '/'))
if (posixly_correct && absolute_program (list->word->word))
filename = savestring (list->word->word);
else if (absolute_pathname (list->word->word))
filename = savestring (list->word->word);
+4
View File
@@ -6027,6 +6027,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
aauuttooccdd If set, a command name that is the name of a directory
is executed as if it were the argument to the ccdd com-
mand. This option is only used by interactive shells.
bbaasshh__ssoouurrccee__ffuullllppaatthh
If set, filenames added to the BBAASSHH__SSOOUURRCCEE array vari-
able are converted to full pathnames (see SShheellll VVaarrii--
aabblleess above).
ccddaabbllee__vvaarrss
If set, an argument to the ccdd builtin command that is
not a directory is assumed to be the name of a variable
+39 -32
View File
@@ -5,14 +5,14 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Tue Jul 2 14:28:46 EDT 2024
.\" Last Change: Mon Jul 29 11:19:45 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 2" "GNU Bash 5.3"
.TH BASH 1 "2024 July 29" "GNU Bash 5.3"
.\"
.ie \n(.g \{\
.ds ' \(aq
@@ -657,8 +657,8 @@ These are referred to as \fIasynchronous\fP commands.
Commands separated by a
.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.
.PP
AND and OR lists are sequences of one or more pipelines separated by the
\fB&&\fP and \fB||\fP control operators, respectively.
@@ -10327,7 +10327,8 @@ reserved words, part of any command executed in a
or
.B ||
list except the command following the final \fB&&\fP or \fB||\fP,
any command in a pipeline but the last,
any command in a pipeline but the last
(subject to the state of the \fBpipefail\fP shell option),
or if the command's return value is
being inverted with
.BR ! .
@@ -10764,6 +10765,10 @@ If set, a command name that is the name of a directory is executed as if
it were the argument to the \fBcd\fP command.
This option is only used by interactive shells.
.TP 8
.B bash_source_fullpath
If set, filenames added to the \fBBASH_SOURCE\fP array variable are
converted to full pathnames (see \fBShell Variables\fP above).
.TP 8
.B cdable_vars
If set, an argument to the
.B cd
@@ -11831,43 +11836,45 @@ subsequently reset. The exit status is true unless a
is readonly or may not be unset.
.TP
\fBwait\fP [\fB\-fn\fP] [\fP\-p\fP \fIvarname\fP] [\fIid\fP .\|.\|.]
Wait for each specified child process and return its termination status.
Each
.I id
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
is not given,
Wait for each specified child process \fIid\fP and return the
termination status of the last \fIid\fP.
Each \fIid\fP may be a process ID or a job specification;
if a job spec is given, \fBwait\fP waits for all processes in the job.
.IP
If no options or \fIid\fPs are supplied,
\fBwait\fP waits for all running background jobs and
the last-executed process substitution, if its process id is the same as
\fB$!\fP,
the last-executed process substitution,
if its process id is the same as \fB$!\fP,
and the return status is zero.
If the \fB\-n\fP option is supplied,
\fBwait\fP waits for a single job
from the list of \fIid\fPs or, if no \fIid\fPs are supplied, any job,
.IP
If the \fB\-n\fP option is supplied, \fBwait\fP waits for any one of
the given \fIid\fPs or, if no \fIid\fPs 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 \fB\-p\fP option is supplied, the process or job identifier of the job
for which the exit status is returned is assigned to the variable
\fIvarname\fP named by the option argument.
If none of the supplied \fIid\fPs is a child of the shell,
or if no \fIid\fPs are supplied and the shell has no unwaited-for children,
the exit status is 127.
.IP
If the \fB\-p\fP option is supplied, the process or job identifier
of the job for which the exit status is returned is assigned to the
variable \fIvarname\fP named by the option argument.
The variable will be unset initially, before any assignment.
This is useful only when the \fB\-n\fP option is supplied.
.IP
Supplying the \fB\-f\fP option, when job control is enabled,
forces \fBwait\fP to wait for \fIid\fP to terminate before returning
its status, instead of returning when it changes status.
If
.I id
specifies a non-existent process or job, the return status is 127.
If \fBwait\fP is interrupted by a signal, the return status will be greater
forces \fBwait\fP to wait for each \fIid\fP to terminate before
returning its status, instead of returning when it changes status.
.IP
If none of the \fIid\fPs specify one of the shell's active child
processes, the return status is 127.
If \fBwait\fP is interrupted by a signal,
any \fIvarname\fP will remain unset,
and the return status will be greater
than 128, as described under
.B SIGNALS
.ie \n(zZ=1 in \fIbash\fP(1).
.el 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 \fIid\fP.
.SH "SHELL COMPATIBILITY MODE"
Bash-4.0 introduced the concept of a \fIshell compatibility level\fP,
specified as a set of options to the shopt builtin (\c
+7 -2
View File
@@ -13512,6 +13512,11 @@ Deprecated; a synonym for <B>array_expand_once</B>.
If set, a command name that is the name of a directory is executed as if
it were the argument to the <B>cd</B> command.
This option is only used by interactive shells.
<DT><B>bash_source_fullpath</B>
<DD>
If set, filenames added to the <B>BASH_SOURCE</B> array variable are
converted to full pathnames (see <B>Shell Variables</B> above).
<DT><B>cdable_vars</B>
<DD>
@@ -15590,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-20240701/doc/bash.1.<BR>
Time: 03 July 2024 10:54:15 EDT
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
</BODY>
</HTML>
+140 -136
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, 2 July 2024).
Bash shell (version 5.3, 25 July 2024).
This is Edition 5.3, last updated 2 July 2024, of The GNU Bash
This is Edition 5.3, last updated 25 July 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, 2 July 2024). The Bash home page is
Bash shell (version 5.3, 25 July 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 2 July 2024, of The GNU Bash
This is Edition 5.3, last updated 25 July 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -4930,6 +4930,10 @@ This builtin allows you to change additional shell optional behavior.
executed as if it were the argument to the cd command. This
option is only used by interactive shells.
bash_source_fullpath
If set, filenames added to the BASH_SOURCE array variable
are converted to full pathnames (*note Bash Variables::).
cdable_vars
If this is set, an argument to the cd builtin command that
is not a directory is assumed to be the name of a variable
@@ -12994,138 +12998,138 @@ D.5 Concept Index

Tag Table:
Node: Top891
Node: Introduction2822
Node: What is Bash?3035
Node: What is a shell?4176
Node: Definitions6755
Node: Basic Shell Features9931
Node: Shell Syntax11151
Node: Shell Operation12178
Node: Quoting13476
Node: Escape Character14789
Node: Single Quotes15287
Node: Double Quotes15636
Node: ANSI-C Quoting16979
Node: Locale Translation18364
Node: Creating Internationalized Scripts19708
Node: Comments23906
Node: Shell Commands24541
Node: Reserved Words25480
Node: Simple Commands26345
Node: Pipelines27004
Node: Lists30067
Node: Compound Commands31939
Node: Looping Constructs32948
Node: Conditional Constructs35492
Node: Command Grouping50313
Node: Coprocesses51800
Node: GNU Parallel54496
Node: Shell Functions55414
Node: Shell Parameters63520
Node: Positional Parameters68053
Node: Special Parameters68988
Node: Shell Expansions72294
Node: Brace Expansion74483
Node: Tilde Expansion77146
Node: Shell Parameter Expansion79912
Node: Command Substitution99019
Node: Arithmetic Expansion102552
Node: Process Substitution103517
Node: Word Splitting104654
Node: Filename Expansion106795
Node: Pattern Matching109891
Node: Quote Removal115124
Node: Redirections115428
Node: Executing Commands125237
Node: Simple Command Expansion125904
Node: Command Search and Execution128015
Node: Command Execution Environment130423
Node: Environment133732
Node: Exit Status135436
Node: Signals137221
Node: Shell Scripts140835
Node: Shell Builtin Commands143927
Node: Bourne Shell Builtins146038
Node: Bash Builtins170808
Node: Modifying Shell Behavior205822
Node: The Set Builtin206164
Node: The Shopt Builtin217679
Node: Special Builtins234466
Node: Shell Variables235455
Node: Bourne Shell Variables235889
Node: Bash Variables238082
Node: Bash Features275247
Node: Invoking Bash276261
Node: Bash Startup Files282660
Node: Interactive Shells287963
Node: What is an Interactive Shell?288371
Node: Is this Shell Interactive?289037
Node: Interactive Shell Behavior289861
Node: Bash Conditional Expressions293615
Node: Shell Arithmetic298789
Node: Aliases301871
Node: Arrays304826
Node: The Directory Stack311625
Node: Directory Stack Builtins312422
Node: Controlling the Prompt316871
Node: The Restricted Shell320009
Node: Bash POSIX Mode322796
Node: Shell Compatibility Mode340307
Node: Job Control349074
Node: Job Control Basics349531
Node: Job Control Builtins354705
Node: Job Control Variables360665
Node: Command Line Editing361842
Node: Introduction and Notation363546
Node: Readline Interaction365190
Node: Readline Bare Essentials366378
Node: Readline Movement Commands368196
Node: Readline Killing Commands369193
Node: Readline Arguments371171
Node: Searching372228
Node: Readline Init File374457
Node: Readline Init File Syntax375739
Node: Conditional Init Constructs400677
Node: Sample Init File405042
Node: Bindable Readline Commands408163
Node: Commands For Moving409388
Node: Commands For History411615
Node: Commands For Text416820
Node: Commands For Killing420954
Node: Numeric Arguments423755
Node: Commands For Completion424907
Node: Keyboard Macros429223
Node: Miscellaneous Commands429924
Node: Readline vi Mode436578
Node: Programmable Completion437530
Node: Programmable Completion Builtins445487
Node: A Programmable Completion Example457053
Node: Using History Interactively462398
Node: Bash History Facilities463079
Node: Bash History Builtins466191
Node: History Interaction471434
Node: Event Designators475759
Node: Word Designators477342
Node: Modifiers479328
Node: Installing Bash481237
Node: Basic Installation482371
Node: Compilers and Options486250
Node: Compiling For Multiple Architectures487000
Node: Installation Names488749
Node: Specifying the System Type490983
Node: Sharing Defaults491729
Node: Operation Controls492443
Node: Optional Features493462
Node: Reporting Bugs505264
Node: Major Differences From The Bourne Shell506613
Node: GNU Free Documentation License526348
Node: Indexes551525
Node: Builtin Index551976
Node: Reserved Word Index559074
Node: Variable Index561519
Node: Function Index578650
Node: Concept Index592506
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

End Tag Table
BIN
View File
Binary file not shown.
+9 -4
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, 2 July 2024).
the Bash shell (version 5.3, 25 July 2024).
This is Edition 5.3, last updated 2 July 2024,
This is Edition 5.3, last updated 25 July 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, 2 July 2024).
the Bash shell (version 5.3, 25 July 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 2 July 2024,
<p>This is Edition 5.3, last updated 25 July 2024,
of <cite class="cite">The GNU Bash Reference Manual</cite>,
for <code class="code">Bash</code>, Version 5.3.
</p>
@@ -6487,6 +6487,11 @@ it were the argument to the <code class="code">cd</code> command.
This option is only used by interactive shells.
</p>
</dd>
<dt><code class="code">bash_source_fullpath</code></dt>
<dd><p>If set, filenames added to the <code class="code">BASH_SOURCE</code> array variable are
converted to full pathnames (see <a class="pxref" href="#Bash-Variables">Bash Variables</a>).
</p>
</dd>
<dt><code class="code">cdable_vars</code></dt>
<dd><p>If this is set, an argument to the <code class="code">cd</code> builtin command that
is not a directory is assumed to be the name of a variable whose
+140 -136
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, 2 July 2024).
Bash shell (version 5.3, 25 July 2024).
This is Edition 5.3, last updated 2 July 2024, of The GNU Bash
This is Edition 5.3, last updated 25 July 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, 2 July 2024). The Bash home page is
Bash shell (version 5.3, 25 July 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 2 July 2024, of The GNU Bash
This is Edition 5.3, last updated 25 July 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -4931,6 +4931,10 @@ This builtin allows you to change additional shell optional behavior.
executed as if it were the argument to the cd command. This
option is only used by interactive shells.
bash_source_fullpath
If set, filenames added to the BASH_SOURCE array variable
are converted to full pathnames (*note Bash Variables::).
cdable_vars
If this is set, an argument to the cd builtin command that
is not a directory is assumed to be the name of a variable
@@ -12995,138 +12999,138 @@ D.5 Concept Index

Tag Table:
Node: Top894
Node: Introduction2828
Node: What is Bash?3044
Node: What is a shell?4188
Node: Definitions6770
Node: Basic Shell Features9949
Node: Shell Syntax11172
Node: Shell Operation12202
Node: Quoting13503
Node: Escape Character14819
Node: Single Quotes15320
Node: Double Quotes15672
Node: ANSI-C Quoting17018
Node: Locale Translation18406
Node: Creating Internationalized Scripts19753
Node: Comments23954
Node: Shell Commands24592
Node: Reserved Words25534
Node: Simple Commands26402
Node: Pipelines27064
Node: Lists30130
Node: Compound Commands32005
Node: Looping Constructs33017
Node: Conditional Constructs35564
Node: Command Grouping50388
Node: Coprocesses51878
Node: GNU Parallel54577
Node: Shell Functions55498
Node: Shell Parameters63607
Node: Positional Parameters68143
Node: Special Parameters69081
Node: Shell Expansions72390
Node: Brace Expansion74582
Node: Tilde Expansion77248
Node: Shell Parameter Expansion80017
Node: Command Substitution99127
Node: Arithmetic Expansion102663
Node: Process Substitution103631
Node: Word Splitting104771
Node: Filename Expansion106915
Node: Pattern Matching110014
Node: Quote Removal115250
Node: Redirections115557
Node: Executing Commands125369
Node: Simple Command Expansion126039
Node: Command Search and Execution128153
Node: Command Execution Environment130564
Node: Environment133876
Node: Exit Status135583
Node: Signals137371
Node: Shell Scripts140988
Node: Shell Builtin Commands144083
Node: Bourne Shell Builtins146197
Node: Bash Builtins170970
Node: Modifying Shell Behavior205987
Node: The Set Builtin206332
Node: The Shopt Builtin217850
Node: Special Builtins234640
Node: Shell Variables235632
Node: Bourne Shell Variables236069
Node: Bash Variables238265
Node: Bash Features275433
Node: Invoking Bash276450
Node: Bash Startup Files282852
Node: Interactive Shells288158
Node: What is an Interactive Shell?288569
Node: Is this Shell Interactive?289238
Node: Interactive Shell Behavior290065
Node: Bash Conditional Expressions293822
Node: Shell Arithmetic298999
Node: Aliases302084
Node: Arrays305042
Node: The Directory Stack311844
Node: Directory Stack Builtins312644
Node: Controlling the Prompt317096
Node: The Restricted Shell320237
Node: Bash POSIX Mode323027
Node: Shell Compatibility Mode340541
Node: Job Control349311
Node: Job Control Basics349771
Node: Job Control Builtins354948
Node: Job Control Variables360911
Node: Command Line Editing362091
Node: Introduction and Notation363798
Node: Readline Interaction365445
Node: Readline Bare Essentials366636
Node: Readline Movement Commands368457
Node: Readline Killing Commands369457
Node: Readline Arguments371438
Node: Searching372498
Node: Readline Init File374730
Node: Readline Init File Syntax376015
Node: Conditional Init Constructs400956
Node: Sample Init File405324
Node: Bindable Readline Commands408448
Node: Commands For Moving409676
Node: Commands For History411906
Node: Commands For Text417114
Node: Commands For Killing421251
Node: Numeric Arguments424055
Node: Commands For Completion425210
Node: Keyboard Macros429529
Node: Miscellaneous Commands430233
Node: Readline vi Mode436890
Node: Programmable Completion437845
Node: Programmable Completion Builtins445805
Node: A Programmable Completion Example457374
Node: Using History Interactively462722
Node: Bash History Facilities463406
Node: Bash History Builtins466521
Node: History Interaction471767
Node: Event Designators476095
Node: Word Designators477681
Node: Modifiers479670
Node: Installing Bash481582
Node: Basic Installation482719
Node: Compilers and Options486601
Node: Compiling For Multiple Architectures487354
Node: Installation Names489106
Node: Specifying the System Type491343
Node: Sharing Defaults492092
Node: Operation Controls492809
Node: Optional Features493831
Node: Reporting Bugs505636
Node: Major Differences From The Bourne Shell506988
Node: GNU Free Documentation License526726
Node: Indexes551906
Node: Builtin Index552360
Node: Reserved Word Index559461
Node: Variable Index561909
Node: Function Index579043
Node: Concept Index592902
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

End Tag Table
+54 -29
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=etex 2024.4.9) 9 JUL 2024 10:37
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
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**\nonstopmode \input /usr/local/src/bash/bash-20240709/doc/bashref.texi \input
/usr/local/src/bash/bash-20240709/doc/bashref.texi
(/usr/local/src/bash/bash-20240709/doc/bashref.texi
(/usr/local/src/bash/bash-20240709/doc/texinfo.tex
**\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
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-20240709/doc/version.texi) [1] [2]
(/usr/local/build/bash/bash-20240709/doc/bashref.toc [-1] [-2] [-3]) [-4]
Chapter 1
(/usr/local/src/bash/bash-20240724/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
\openout0 = `bashref.toc'.
(/usr/local/build/bash/bash-20240709/doc/bashref.aux)
(/usr/local/build/bash/bash-20240724/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'.
@@ -218,15 +221,16 @@ Overfull \hbox (5.95723pt too wide) in paragraph at lines 724--725
@rwindfile=@write4
\openout4 = `bashref.rw'.
[9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23]
[24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38]
[39] [40] [41] [42] [43] [44] [45] [46] [47] Chapter 4 [48]
[9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19{/opt/local/share/texmf-tex
live/fonts/enc/dvips/cm-super/cm-super-t1.enc}] [20] [21] [22] [23] [24]
[25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39]
[40] [41] [42] [43] [44] [45] [46] [47] Chapter 4 [48]
@btindfile=@write5
\openout5 = `bashref.bt'.
[49] [50] [51]
[52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66]
[67] [68]
[49] [50] [51] [52]
[53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67]
[68]
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5446--5446
[]@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -259,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-20240709/lib/readline/doc/rluser.texi
(/usr/local/src/bash/bash-20240724/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
@@ -309,10 +313,10 @@ gnored[]
texinfo.tex: doing @include of hsuser.texi
(/usr/local/src/bash/bash-20240709/lib/readline/doc/hsuser.texi Chapter 9
(/usr/local/src/bash/bash-20240724/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 9842--9851
Underfull \hbox (badness 10000) in paragraph at lines 9846--9855
[]@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
entation[]@textrm '[],
@@ -325,7 +329,7 @@ entation[]@textrm '[],
.etc.
Underfull \hbox (badness 10000) in paragraph at lines 9842--9851
Underfull \hbox (badness 10000) in paragraph at lines 9846--9855
@textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
extrm '[], `@texttt strict-posix-default[]@textrm '[], and
@@ -341,16 +345,37 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
[178] [179] Appendix C [180]
texinfo.tex: doing @include of fdl.texi
(/usr/local/src/bash/bash-20240709/doc/fdl.texi
(/usr/local/src/bash/bash-20240724/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:
3531 strings out of 495850
40273 string characters out of 6172145
89061 words of memory out of 5000000
4879 multiletter control sequences out of 15000+600000
4105 strings out of 495840
47629 string characters out of 6171739
143269 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
16i,6n,16p,402b,942s stack positions out of 10000i,1000n,20000p,200000b,200000s
16i,6n,16p,389b,983s stack positions out of 10000i,1000n,20000p,200000b,200000s
</opt/local/share/texmf-texlive/font
s/type1/public/amsfonts/cm/cmbx12.pfb></opt/local/share/texmf-texlive/fonts/typ
e1/public/amsfonts/cm/cmcsc10.pfb></opt/local/share/texmf-texlive/fonts/type1/p
ublic/amsfonts/cm/cmmi10.pfb></opt/local/share/texmf-texlive/fonts/type1/public
/amsfonts/cm/cmmi12.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsf
onts/cm/cmmi9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/c
m/cmr10.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></o
pt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsy10.pfb></opt/lo
cal/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/local/s
hare/texmf-texlive/fonts/type1/public/amsfonts/cm/cmtt10.pfb></opt/local/share/
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).
PDF statistics:
2837 PDF objects out of 2984 (max. 8388607)
2587 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)
Output written on bashref.dvi (203 pages, 855852 bytes).
BIN
View File
Binary file not shown.
+38 -28
View File
@@ -849,8 +849,8 @@ the standard input for asynchronous commands, in the absence of any
explicit redirections, is redirected from @code{/dev/null}.
Commands separated by a @samp{;} 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.
@sc{and} and @sc{or} lists are sequences of one or more pipelines
separated by the control operators @samp{&&} and @samp{||},
@@ -5481,7 +5481,8 @@ command list immediately following a @code{while} or @code{until} keyword,
part of the test in an @code{if} statement,
part of any command executed in a @code{&&} or @code{||} list except
the command following the final @code{&&} or @code{||},
any command in a pipeline but the last,
any command in a pipeline but the last
(subject to the state of the @code{pipefail} shell option),
or if the command's return status is being inverted with @code{!}.
If a compound command other than a subshell
returns a non-zero status because a command failed
@@ -5813,6 +5814,10 @@ If set, a command name that is the name of a directory is executed as if
it were the argument to the @code{cd} command.
This option is only used by interactive shells.
@item bash_source_fullpath
If set, filenames added to the @code{BASH_SOURCE} array variable are
converted to full pathnames (@pxref{Bash Variables}).
@item cdable_vars
If this is set, an argument to the @code{cd} builtin command that
is not a directory is assumed to be the name of a variable whose
@@ -9337,40 +9342,45 @@ or non-zero if an error occurs or an invalid option is encountered.
@item wait
@btindex wait
@example
wait [-fn] [-p @var{varname}] [@var{jobspec} or @var{pid} @dots{}]
wait [-fn] [-p @var{varname}] [@var{id} @dots{}]
@end example
Wait until the child process specified by each process @sc{id} @var{pid}
or job specification @var{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 until the child process specified by each @var{id} exits and
return the exit status of the last @var{id}.
Each @var{id} may be a @var{pid} or job specification @var{jobspec};
if a job spec is given, @code{wait} waits for all processes in the job.
If no options or @var{id}s are supplied,
@code{wait} waits for all running background jobs and
the last-executed process substitution, if its process id is the same as
@var{$!},
the last-executed process substitution,
if its process id is the same as @var{$!},
and the return status is zero.
If the @option{-n} option is supplied, @code{wait} waits for a single job
from the list of @var{pid}s or @var{jobspec}s or, if no arguments are
supplied, any job,
If the @option{-n} option is supplied, @code{wait} waits for any one of
the @var{id}s or, if no @var{id}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 @option{-p} option is supplied, the process or job identifier of the job
for which the exit status is returned is assigned to the variable
@var{varname} named by the option argument.
If none of the supplied @var{id}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.
If the @option{-p} option is supplied, the process or job identifier
of the job for which the exit status is returned is assigned to the
variable @var{varname} named by the option argument.
The variable will be unset initially, before any assignment.
This is useful only when the @option{-n} option is supplied.
Supplying the @option{-f} option, when job control is enabled,
forces @code{wait} to wait for each @var{pid} or @var{jobspec} to
terminate before returning its status, instead of returning when it changes
status.
If neither @var{jobspec} nor @var{pid} specifies an active child process
of the shell, the return status is 127.
If @code{wait} is interrupted by a signal, the return status will be greater
forces @code{wait} to wait for each @var{id} to terminate before
returning its status, instead of returning when it changes status.
If none of the @var{id}s specify one of the shell's an active child
processes, the return status is 127.
If @code{wait} is interrupted by a signal,
any @var{varname} will remain unset,
and the return status will be greater
than 128, as described above (@pxref{Signals}).
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{id}.
@item disown
@btindex disown
+4
View File
@@ -1423,6 +1423,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
aauuttooccdd If set, a command name that is the name of a directory
is executed as if it were the argument to the ccdd com-
mand. This option is only used by interactive shells.
bbaasshh__ssoouurrccee__ffuullllppaatthh
If set, filenames added to the BBAASSHH__SSOOUURRCCEE array vari-
able are converted to full pathnames (see SShheellll VVaarrii--
aabblleess above).
ccddaabbllee__vvaarrss
If set, an argument to the ccdd builtin command that is
not a directory is assumed to be the name of a variable
+2 -2
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2024 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Tue Jul 2 14:29:06 EDT 2024
@set LASTCHANGE Mon Jul 29 11:20:04 EDT 2024
@set EDITION 5.3
@set VERSION 5.3
@set UPDATED 2 July 2024
@set UPDATED 29 July 2024
@set UPDATED-MONTH July 2024
+2 -6
View File
@@ -1693,7 +1693,6 @@ execute_in_subshell (COMMAND *command, int asynchronous, int pipe_in, int pipe_o
#if defined (PROCESS_SUBSTITUTION)
# if defined (JOB_CONTROL)
procsub_clear ();
last_procsub_child = 0;
# endif
clear_fifo_list (); /* XXX- we haven't created any FIFOs */
#endif
@@ -1743,10 +1742,7 @@ execute_in_subshell (COMMAND *command, int asynchronous, int pipe_in, int pipe_o
#if 1
#if defined (PROCESS_SUBSTITUTION) && defined (JOB_CONTROL)
if (user_subshell && command->type == cm_subshell)
{
procsub_clear ();
last_procsub_child = 0;
}
procsub_clear ();
#endif
#endif
}
@@ -5277,7 +5273,7 @@ execute_function (SHELL_VAR *var, WORD_LIST *words, int flags, struct fd_bitmap
sfile = shell_fn ? shell_fn->source_file : "";
array_push ((ARRAY *)funcname_a, this_shell_function->name);
array_push ((ARRAY *)bash_source_a, sfile);
push_source ((ARRAY *)bash_source_a, sfile);
lineno = GET_LINE_NUMBER ();
t = itos (lineno);
array_push ((ARRAY *)bash_lineno_a, t);
+1 -1
View File
@@ -112,7 +112,7 @@ phash_insert (char *filename, char *full_path, int check_dot, int found)
pathdata(item)->flags = 0;
if (check_dot)
pathdata(item)->flags |= HASH_CHKDOT;
if (*full_path != '/')
if (RELPATH (full_path))
pathdata(item)->flags |= HASH_RELPATH;
item->times_found = found;
}
+5 -1
View File
@@ -2826,8 +2826,12 @@ wait_for_background_pids (struct procstat *ps)
}
#if defined (PROCESS_SUBSTITUTION)
# if defined (WAIT_WAITS_FOR_ALL_PROCSUBS)
procsub_waitall ();
# else
if (last_procsub_child && last_procsub_child->pid != NO_PID && last_procsub_child->pid == last_asynchronous_pid)
procsub_waitpid (last_procsub_child->pid);
# endif
delete_procsubs (); /* closes fds or unlinks fifos */
#endif
@@ -3474,7 +3478,7 @@ return_job:
/* If we're waiting for specific pids, skip over ones we're not interested in. */
if ((flags & JWAIT_WAITING) && (p->flags & PROC_WAITING) == 0)
continue;
#if 0
#if defined (WAIT_N_WAITS_FOR_LAST_PROCSUB)
/* If we want to restrict wait -n without pid arguments to only wait
for last_procsub_child->pid, uncomment this. */
if ((flags & JWAIT_WAITING) == 0 && p != last_procsub_child)
+1 -2
View File
@@ -90,8 +90,7 @@ char history_subst_char = '^';
/* During tokenization, if this character is seen as the first character
of a word, then it, and all subsequent characters up to a newline are
ignored. For a Bourne shell, this should be '#'. Bash special cases
the interactive comment character to not be a comment delimiter. */
ignored. For a Bourne shell, this should be '#'. */
char history_comment_char = '\0';
/* The list of characters which inhibit the expansion of text if found
+1
View File
@@ -6471,6 +6471,7 @@ process_substitute (char *string, int open_for_read_in_child)
/* We assume that last_procsub_child->next == last_procsub_child because
of how jobs.c:add_process() works. */
last_procsub_child->next = 0;
last_procsub_pid = last_procsub_child->pid;
procsub_add (last_procsub_child);
#endif
+17 -3
View File
@@ -170,6 +170,9 @@ int array_needs_making = 1;
by initialize_variables (). */
int shell_level = 0;
/* If non-zero, each element of BASH_SOURCE contains a full pathnames */
int bash_source_fullpath = 0;
/* An array which is passed to commands as their environment. It is
manufactured from the union of the initial environment and the
shell variables that are marked for export. */
@@ -915,7 +918,7 @@ set_pwd (void)
/* Follow posix rules for importing PWD */
if (temp_var && imported_p (temp_var) &&
(temp_string = value_cell (temp_var)) &&
temp_string[0] == '/' &&
ABSPATH (temp_string) &&
same_file (temp_string, ".", (struct stat *)NULL, (struct stat *)NULL))
{
current_dir = sh_canonpath (temp_string, PATH_CHECKDOTDOT|PATH_CHECKEXISTS);
@@ -1718,7 +1721,7 @@ assign_hashcmd (SHELL_VAR *self, char *value, arrayind_t ind, char *key)
if (restricted)
{
if (strchr (value, '/'))
if (absolute_program (value))
{
sh_restricted (value);
return (SHELL_VAR *)NULL;
@@ -5694,7 +5697,18 @@ uw_pop_args (void *ignore)
void
push_source (ARRAY *a, char *filename)
{
array_push (a, filename);
char *fn;
char pathname[PATH_MAX];
if (bash_source_fullpath)
{
if ((fn = sh_realpath (filename, pathname)) == 0)
fn = filename;
}
else
fn = filename;
array_push (a, fn);
}
#endif