[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: anonymous pipes in recursive function calls
From: |
Zachary Santer |
Subject: |
Re: anonymous pipes in recursive function calls |
Date: |
Mon, 1 Jul 2024 20:08:28 -0400 |
On Mon, Jul 1, 2024 at 5:06 AM konsolebox <konsolebox@gmail.com> wrote:
>
> But then you're allowing multiple processes and pipes to be open at
> the same time, unnecessarily allowing more room for unexpected errors.
> Isn't that worse? It doesn't matter if bash seamlessly allows
> multiple recursion-generated pipes or not.
>
> Your use case at some point may be practical but it's the one that
> should be questioned first. Storing output is the sane choice in most
> cases.
Multiple processes and pipes open at the same time is practically
bash's raison d'être. I'd rather assume it can handle whatever I can
throw at it, until I know otherwise. I did end up going with storing
things in an array and then looping over the array elements to work
around this issue, though.
My repeat-by does elicit both behaviors in bash 4.2. The nested
anonymous pipe (line 17) was necessary to get the diagnostic message.
All this seems to be fixed by the time we get to bash 5.2. I've
attached the repeat-by script, in case it's useful. Would still like
to know roughly when these issues were resolved.
Zack
anonymous-pipe-recursion
Description: Binary data