Greg, thank you -- this was exactly what I've been failing to find.
And there's even a solution that looks good for my *actual* problem.


-----Original Message-----
From: Greg Wooledge <g...@wooledge.org>
Sent: Tuesday, April 2, 2024 3:35 PM
To: Linde, Evan <eli...@okstate.edu>
Cc: bug-bash@gnu.org
Subject: Re: Scope change in loops with "read" built-in

[You don't often get email from g...@wooledge.org. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

On Tue, Apr 02, 2024 at 08:08:57PM +0000, Linde, Evan wrote:
> In a loop constructed like `... | while read ...`, changes to
> variables declared outside the loop only have a loop local scope,
> unlike other "while" or "for" loops.

https://mywiki.wooledge.org/BashFAQ/024

Reply via email to