|
From: | Chet Ramey |
Subject: | Re: [sr #111047] Value of BASHPID changes when inside a here-document |
Date: | Fri, 5 Apr 2024 10:35:28 -0400 |
User-agent: | Mozilla Thunderbird |
On 4/4/24 9:05 PM, Lawrence Velázquez wrote:
Reproducing my comment [1] for the list:On Apr 4, 2024, at 5:57 PM, Richard Waite <INVALID.NOREPLY@gnu.org> wrote: Does variable expansion for here-documents occur in a subshell?Sometimes. When a command requires forking (roughly speaking), its redirections (not just here-documents) are processed after the fork as an optimization.
Not just as an optimization: that's how the Bourne shell did it, so bash has always done it that way for compatibility. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature
[Prev in Thread] | Current Thread | [Next in Thread] |