[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The 'source x' command doesn't keep variables set by x when source o
From: |
Chet Ramey |
Subject: |
Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command |
Date: |
Thu, 14 Nov 2024 09:02:34 -0500 |
User-agent: |
Mozilla Thunderbird |
On 11/13/24 5:12 PM, Yuri wrote:
On 11/13/24 14:02, Greg Wooledge wrote:
The commands within a pipeline are executed in subshells (child
processes), so all variable changes are discarded when the subshell exits.
This sounds like an implementation detail that should be invisible that
affects how the 'source' feature works.
You might consider it an implementation detail, but it's how shells work.
This makes it a very confusing from the user's perspective.
I think people are pretty much used to it.
--
``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
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, (continued)
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Robert Elz, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, #!microsuxx, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Yuri, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, #!microsuxx, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, #!microsuxx, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Robert Elz, 2024/11/13
- Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command,
Chet Ramey <=
Re: The 'source x' command doesn't keep variables set by x when source output is piped into other command, Chet Ramey, 2024/11/14