From: Chet Ramey
Bash is -Copyright (C) 1989-2025 by the Free Software Foundation, +Copyright (C) 1989-2026 by the Free Software Foundation, Inc.
If a command is terminated by the control operator &, the shell -executes the command in the background in a subshell. -The shell does not wait for the command to finish, and the -return status is 0. These are referred to as -asynchronous commands. Commands separated or -terminated by ; (or an equivalent +executes the command asynchronously in a subshell. This is +known as executing a command in the background, and +these are referred to as asynchronous commands. The +shell does not wait for the command to finish, and the +return status is 0. When job control is not active, the +standard input for asynchronous commands, in the absence of +any explicit redirections involving the standard input, is +redirected from /dev/null.
+ +Commands +separated or terminated by ; (or an equivalent <newline>) are executed sequentially; the shell waits for each command to terminate in turn.
@@ -4607,12 +4613,13 @@ removed.The character c following the open brace must be a space, tab, -newline, or |, and the close brace must be in a -position where a reserved word may appear (i.e., preceded by -a command terminator such as semicolon). Bash allows -the close brace to be joined to the remaining characters in -the word without being followed by a shell metacharacter as -a reserved word would usually require.
+newline, “|”, or “;”; and the close +brace must be in a position where a reserved word may appear +(i.e., preceded by a command terminator such as semicolon). +Bash allows the close brace to be joined to the +remaining characters in the word without being followed by a +shell metacharacter as a reserved word would usually +require.Any side effects of command take effect immediately in the current @@ -4629,7 +4636,15 @@ execution environment, including the positional parameters, is shared with the caller.
If the first -character following the open brace is a |, the +character following the open brace is a “;”, the +construct behaves like the form above but preserves any +trailing newlines in the output of command instead of +removing them. This form is useful when the trailing +newlines are significant and should not be stripped from the +command’s output.
+ +If the first +character following the open brace is a “|”, the construct expands to the value of the REPLY shell variable after command executes, without removing any trailing newlines, and the standard output of command @@ -6593,9 +6608,10 @@ in posix mode.
If a command is followed by a & and job control is not active, the default standard input for the command is the empty file -/dev/null. Otherwise, the invoked command inherits -the file descriptors of the calling shell as modified by -redirections.
+/dev/null, unless the command has an explicit +redirection involving the standard input. Otherwise, the +invoked command inherits the file descriptors of the calling +shell as modified by redirections.Expand the line by performing -shell word expansions. This performs alias and history -expansion, $'string' and +shell word expansions, treating the line as a single shell +word. This performs alias and history expansion, +$'string' and $"string" quoting, tilde expansion, parameter and variable expansion, arithmetic expansion, command and process substitution, word splitting, and quote @@ -8882,6 +8899,27 @@ substitution. See HISTORY EXPANSION below for a description of history expansion.
+shell−expand−and−requote−line +()
+ +Expand the line by performing +shell word expansions, splitting the line into shell words +in the same way as for programmable completion. This +performs alias and history expansion, +$'string' and +$"string" quoting, tilde expansion, +parameter and variable expansion, arithmetic expansion, +command and process substitution, word splitting, and quote +removal on each word, then quotes the resulting words if +necessary to prevent further expansion. An explicit argument +suppresses command and process substitution and quotes each +resultant word. As usual, double-quoting a word will +suppress word splitting. This can be useful when combined +with suppressing command substitution, for instance, so the +words in the command substitution aren’t quoted +individually.
+ +history−expand−line (M−^)
diff --git a/doc/bash.info b/doc/bash.info index 762bd0a12..df5767c5d 100644 --- a/doc/bash.info +++ b/doc/bash.info @@ -7662,7 +7662,10 @@ that allow shell escapes are particularly vulnerable), changing the current directory to a non-writable directory other than â$HOMEâ after login, not allowing the restricted shell to execute shell scripts, and cleaning the environment of variables that cause some commands to modify -their behavior (e.g., âVISUALâ or âPAGERâ). +their behavior (e.g., âVISUALâ or âPAGERâ). When setting up a +restricted environment like this, it's important not to install or allow +symbolic links in the new current directory, since those could be used +to circumvent restrictions on writing to files. Modern systems provide more secure ways to implement a restricted environment, such as âjailsâ, âzonesâ, or âcontainersâ. @@ -13801,62 +13804,62 @@ Node: The Directory Stack330317 Node: Directory Stack Builtins331114 Node: Controlling the Prompt335559 Node: The Restricted Shell338443 -Node: Bash POSIX Mode341325 -Node: Shell Compatibility Mode360741 -Node: Job Control369748 -Node: Job Control Basics370205 -Node: Job Control Builtins376573 -Node: Job Control Variables383361 -Node: Command Line Editing384592 -Node: Introduction and Notation386295 -Node: Readline Interaction388647 -Node: Readline Bare Essentials389835 -Node: Readline Movement Commands391643 -Node: Readline Killing Commands392639 -Node: Readline Arguments394662 -Node: Searching395752 -Node: Readline Init File397995 -Node: Readline Init File Syntax399298 -Node: Conditional Init Constructs426249 -Node: Sample Init File430634 -Node: Bindable Readline Commands433754 -Node: Commands For Moving435292 -Node: Commands For History437756 -Node: Commands For Text443147 -Node: Commands For Killing447272 -Node: Numeric Arguments450060 -Node: Commands For Completion451212 -Node: Keyboard Macros456908 -Node: Miscellaneous Commands457609 -Node: Readline vi Mode465152 -Node: Programmable Completion466129 -Node: Programmable Completion Builtins475865 -Node: A Programmable Completion Example487602 -Node: Using History Interactively492947 -Node: Bash History Facilities493628 -Node: Bash History Builtins497363 -Node: History Interaction504958 -Node: Event Designators509908 -Node: Word Designators511486 -Node: Modifiers513878 -Node: Installing Bash515815 -Node: Basic Installation516931 -Node: Compilers and Options520807 -Node: Compiling For Multiple Architectures521557 -Node: Installation Names523310 -Node: Specifying the System Type525544 -Node: Sharing Defaults526290 -Node: Operation Controls527004 -Node: Optional Features528023 -Node: Reporting Bugs540746 -Node: Major Differences From The Bourne Shell542103 -Node: GNU Free Documentation License563530 -Node: Indexes588707 -Node: Builtin Index589158 -Node: Reserved Word Index596256 -Node: Variable Index598701 -Node: Function Index616114 -Node: Concept Index630247 +Node: Bash POSIX Mode341536 +Node: Shell Compatibility Mode360952 +Node: Job Control369959 +Node: Job Control Basics370416 +Node: Job Control Builtins376784 +Node: Job Control Variables383572 +Node: Command Line Editing384803 +Node: Introduction and Notation386506 +Node: Readline Interaction388858 +Node: Readline Bare Essentials390046 +Node: Readline Movement Commands391854 +Node: Readline Killing Commands392850 +Node: Readline Arguments394873 +Node: Searching395963 +Node: Readline Init File398206 +Node: Readline Init File Syntax399509 +Node: Conditional Init Constructs426460 +Node: Sample Init File430845 +Node: Bindable Readline Commands433965 +Node: Commands For Moving435503 +Node: Commands For History437967 +Node: Commands For Text443358 +Node: Commands For Killing447483 +Node: Numeric Arguments450271 +Node: Commands For Completion451423 +Node: Keyboard Macros457119 +Node: Miscellaneous Commands457820 +Node: Readline vi Mode465363 +Node: Programmable Completion466340 +Node: Programmable Completion Builtins476076 +Node: A Programmable Completion Example487813 +Node: Using History Interactively493158 +Node: Bash History Facilities493839 +Node: Bash History Builtins497574 +Node: History Interaction505169 +Node: Event Designators510119 +Node: Word Designators511697 +Node: Modifiers514089 +Node: Installing Bash516026 +Node: Basic Installation517142 +Node: Compilers and Options521018 +Node: Compiling For Multiple Architectures521768 +Node: Installation Names523521 +Node: Specifying the System Type525755 +Node: Sharing Defaults526501 +Node: Operation Controls527215 +Node: Optional Features528234 +Node: Reporting Bugs540957 +Node: Major Differences From The Bourne Shell542314 +Node: GNU Free Documentation License563741 +Node: Indexes588918 +Node: Builtin Index589369 +Node: Reserved Word Index596467 +Node: Variable Index598912 +Node: Function Index616325 +Node: Concept Index630458 End Tag Table diff --git a/doc/bash.pdf b/doc/bash.pdf index c861b55f4..bfbb05a91 100644 Binary files a/doc/bash.pdf and b/doc/bash.pdf differ diff --git a/doc/bashref.aux b/doc/bashref.aux index dc5bd7d7f..9e025c4bd 100644 --- a/doc/bashref.aux +++ b/doc/bashref.aux @@ -60,9 +60,9 @@ @xrdef{Compound Commands-pg}{11} @xrdef{Looping Constructs-title}{Looping Constructs} @xrdef{Looping Constructs-snt}{Section@tie 3.2.5.1} +@xrdef{Looping Constructs-pg}{12} @xrdef{Conditional Constructs-title}{Conditional Constructs} @xrdef{Conditional Constructs-snt}{Section@tie 3.2.5.2} -@xrdef{Looping Constructs-pg}{12} @xrdef{Conditional Constructs-pg}{13} @xrdef{Command Grouping-title}{Grouping Commands} @xrdef{Command Grouping-snt}{Section@tie 3.2.5.3} @@ -102,9 +102,9 @@ @xrdef{Command Substitution-pg}{36} @xrdef{Arithmetic Expansion-title}{Arithmetic Expansion} @xrdef{Arithmetic Expansion-snt}{Section@tie 3.5.5} +@xrdef{Arithmetic Expansion-pg}{37} @xrdef{Process Substitution-title}{Process Substitution} @xrdef{Process Substitution-snt}{Section@tie 3.5.6} -@xrdef{Arithmetic Expansion-pg}{37} @xrdef{Word Splitting-title}{Word Splitting} @xrdef{Word Splitting-snt}{Section@tie 3.5.7} @xrdef{Process Substitution-pg}{38} @@ -132,7 +132,7 @@ @xrdef{Command Execution Environment-title}{Command Execution Environment} @xrdef{Command Execution Environment-snt}{Section@tie 3.7.3} @xrdef{Command Search and Execution-pg}{46} -@xrdef{Command Execution Environment-pg}{46} +@xrdef{Command Execution Environment-pg}{47} @xrdef{Environment-title}{Environment} @xrdef{Environment-snt}{Section@tie 3.7.4} @xrdef{Exit Status-title}{Exit Status} @@ -225,7 +225,7 @@ @xrdef{Bash POSIX Mode-pg}{116} @xrdef{Shell Compatibility Mode-title}{Shell Compatibility Mode} @xrdef{Shell Compatibility Mode-snt}{Section@tie 6.12} -@xrdef{Shell Compatibility Mode-pg}{121} +@xrdef{Shell Compatibility Mode-pg}{122} @xrdef{Job Control-title}{Job Control} @xrdef{Job Control-snt}{Chapter@tie 7} @xrdef{Job Control Basics-title}{Job Control Basics} diff --git a/doc/bashref.bt b/doc/bashref.bt index 27c0dcf01..c7a7f16e3 100644 --- a/doc/bashref.bt +++ b/doc/bashref.bt @@ -55,7 +55,7 @@ \entry{disown}{128}{\code {disown}} \entry{suspend}{128}{\code {suspend}} \entry{compgen}{161}{\code {compgen}} -\entry{complete}{161}{\code {complete}} +\entry{complete}{162}{\code {complete}} \entry{compopt}{165}{\code {compopt}} \entry{fc}{169}{\code {fc}} \entry{history}{170}{\code {history}} diff --git a/doc/bashref.bts b/doc/bashref.bts index e7b501c51..0296157d5 100644 --- a/doc/bashref.bts +++ b/doc/bashref.bts @@ -16,7 +16,7 @@ \entry{\code {cd}}{53} \entry{\code {command}}{63} \entry{\code {compgen}}{161} -\entry{\code {complete}}{161} +\entry{\code {complete}}{162} \entry{\code {compopt}}{165} \entry{\code {continue}}{54} \initial {D} diff --git a/doc/bashref.cp b/doc/bashref.cp index 80005c3b0..431e3ba78 100644 --- a/doc/bashref.cp +++ b/doc/bashref.cp @@ -70,7 +70,7 @@ \entry{command expansion}{45}{command expansion} \entry{command execution}{46}{command execution} \entry{command search}{46}{command search} -\entry{execution environment}{46}{execution environment} +\entry{execution environment}{47}{execution environment} \entry{environment}{48}{environment} \entry{exit status}{48}{exit status} \entry{signal handling}{49}{signal handling} @@ -99,8 +99,8 @@ \entry{restricted shell}{115}{restricted shell} \entry{POSIX description}{116}{POSIX description} \entry{POSIX Mode}{117}{POSIX Mode} -\entry{Compatibility Level}{121}{Compatibility Level} -\entry{Compatibility Mode}{121}{Compatibility Mode} +\entry{Compatibility Level}{122}{Compatibility Level} +\entry{Compatibility Mode}{122}{Compatibility Mode} \entry{job control}{125}{job control} \entry{foreground}{125}{foreground} \entry{background}{125}{background} diff --git a/doc/bashref.cps b/doc/bashref.cps index 5be074b0c..ae331a6e7 100644 --- a/doc/bashref.cps +++ b/doc/bashref.cps @@ -31,8 +31,8 @@ \entry{commands, shell}{9} \entry{commands, simple}{10} \entry{comments, shell}{9} -\entry{Compatibility Level}{121} -\entry{Compatibility Mode}{121} +\entry{Compatibility Level}{122} +\entry{Compatibility Mode}{122} \entry{completion builtins}{161} \entry{conditional arithmetic operator}{108} \entry{configuration}{175} @@ -46,7 +46,7 @@ \entry{environment}{48} \entry{evaluation, arithmetic}{107} \entry{event designators}{172} -\entry{execution environment}{46} +\entry{execution environment}{47} \entry{exit status}{3, 48} \entry{expansion}{25} \entry{expansion, arithmetic}{37} diff --git a/doc/bashref.fn b/doc/bashref.fn index 085b67902..fd2e5855d 100644 --- a/doc/bashref.fn +++ b/doc/bashref.fn @@ -107,7 +107,8 @@ \entry{glob-expand-word (C-x *)}{157}{\code {glob-expand-word (C-x *)}} \entry{glob-list-expansions (C-x g)}{157}{\code {glob-list-expansions (C-x g)}} \entry{shell-expand-line (M-C-e)}{157}{\code {shell-expand-line (M-C-e)}} -\entry{history-expand-line (M-^)}{157}{\code {history-expand-line (M-^)}} +\entry{shell-expand-and-requote-line ()}{157}{\code {shell-expand-and-requote-line ()}} +\entry{history-expand-line (M-^)}{158}{\code {history-expand-line (M-^)}} \entry{magic-space ()}{158}{\code {magic-space ()}} \entry{alias-expand-line ()}{158}{\code {alias-expand-line ()}} \entry{history-and-alias-expand-line ()}{158}{\code {history-and-alias-expand-line ()}} diff --git a/doc/bashref.fns b/doc/bashref.fns index 8a3822804..ed1685caa 100644 --- a/doc/bashref.fns +++ b/doc/bashref.fns @@ -62,7 +62,7 @@ \entry{\code {glob-list-expansions (C-x g)}}{157} \initial {H} \entry{\code {history-and-alias-expand-line ()}}{158} -\entry{\code {history-expand-line (M-^)}}{157} +\entry{\code {history-expand-line (M-^)}}{158} \entry{\code {history-search-backward ()}}{149} \entry{\code {history-search-forward ()}}{149} \entry{\code {history-substring-search-backward ()}}{149} @@ -111,6 +111,7 @@ \entry{\code {set-mark (C-@)}}{156} \entry{\code {shell-backward-kill-word ()}}{152} \entry{\code {shell-backward-word (M-C-b)}}{147} +\entry{\code {shell-expand-and-requote-line ()}}{157} \entry{\code {shell-expand-line (M-C-e)}}{157} \entry{\code {shell-forward-word (M-C-f)}}{147} \entry{\code {shell-kill-word (M-C-d)}}{152} diff --git a/doc/bashref.html b/doc/bashref.html index 9f1985339..883dac9f2 100644 --- a/doc/bashref.html +++ b/doc/bashref.html @@ -4,13 +4,13 @@