[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Scope change in loops with "read" built-in
From: |
Linde, Evan |
Subject: |
RE: Scope change in loops with "read" built-in |
Date: |
Tue, 2 Apr 2024 20:52:30 +0000 |
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 <greg@wooledge.org>
Sent: Tuesday, April 2, 2024 3:35 PM
To: Linde, Evan <elinde@okstate.edu>
Cc: bug-bash@gnu.org
Subject: Re: Scope change in loops with "read" built-in
[You don't often get email from greg@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