Re: anonymous pipes in recursive function calls

2024-06-29 Thread konsolebox
On Sat, Jun 29, 2024 at 6:39 AM Zachary Santer wrote: > command this-file | > while IFS='' read -r -d '' path; do > cd -- "${starting_PWD}/${path}" > if [[ -r this-file ]]; then > recursive_function "${entry_path}/${path}" > fi > # fill arrays > # there

waiting for process substitutions

2024-06-29 Thread Zachary Santer
>From the manual: wait [-fn] [-p varname] [id ...] Wait for each specified child process and return its termination status. Each id may be a process ID or a job specification; if a job spec is given, all processes in that job's pipeline are waited for. If id is not given, wait waits for all running

Re: waiting for process substitutions

2024-06-29 Thread Oğuz
On Sat, Jun 29, 2024 at 3:47 PM Zachary Santer wrote: > Why not just wait for all process substitutions? What if I substitute thousands of processes and never call wait?

Re: anonymous pipes in recursive function calls

2024-06-29 Thread Zachary Santer
On Sat, Jun 29, 2024 at 4:40 AM konsolebox wrote: > > You can avoid pipe recursions by storing the output first in an array. So is this a known issue? > There's also no need to use an error flag variable. Just make sure > return calls are chained. The intention here is to report as many error

Re: waiting for process substitutions

2024-06-29 Thread Zachary Santer
On Sat, Jun 29, 2024 at 9:02 AM Oğuz wrote: > > What if I substitute thousands of processes and never call wait? Couldn't you do the exact same thing with regular background processes forked with &? That's on you.

Re: feature suggestion: ability to expand a set of elements of an array or characters of a scalar, given their indices

2024-06-29 Thread Martin D Kealey
On Fri, 28 Jun 2024, 18:31 Oğuz, wrote: > On Friday, June 28, 2024, Martin D Kealey wrote: > >> modern Perl scripts >> > > No such thing. > For the purpose of this argument, "modern" means anything written in the last 25 years, targeting Perl 5 rather than Perl 4. Perl is a dead language, > W

Re: Proposal for a New Bash Option: failfast for Immediate Pipeline Failure

2024-06-29 Thread ama bamo
I see, thank you then. It was nice to hear from you. Regards Mateusz On Fri, Jun 28, 2024 at 7:26 PM Chet Ramey wrote: > On 6/24/24 10:21 AM, ama bamo wrote: > > > To address these issues, I propose the introduction of a new option, > > failfast, which would immediately terminate the pipeline i

Re: waiting for process substitutions

2024-06-29 Thread Oğuz
On Saturday, June 29, 2024, Zachary Santer wrote: > > Couldn't you do the exact same thing with regular background processes > forked with &? > But the shell notifies me when they terminate and reap them. -- Oğuz

Re: waiting for process substitutions

2024-06-29 Thread Zachary Santer
On Sat, Jun 29, 2024 at 11:30 AM Oğuz wrote: > > On Saturday, June 29, 2024, Zachary Santer wrote: >> >> Couldn't you do the exact same thing with regular background processes >> forked with &? > > > But the shell notifies me when they terminate and reap them. Is that relevant? $ { sleep 5; pri

waiting for process substitutions

2024-06-29 Thread Oğuz
On Sat, Jun 29, 2024 at 8:08 PM Zachary Santer wrote: > Is that relevant? I think so. There is a limit to the number of jobs Bash can remember, once it's exceeded the oldest job is overwritten. Do we really want process substitutions to count against that limit? Or did you mean something else? -

Re: anonymous pipes in recursive function calls

2024-06-29 Thread konsolebox
On Sat, Jun 29, 2024 at 10:23 PM Zachary Santer wrote: > > On Sat, Jun 29, 2024 at 4:40 AM konsolebox wrote: > > > > You can avoid pipe recursions by storing the output first in an array. > > So is this a known issue? I don't know. I haven't really checked your issues. I just think avoiding to

Re: anonymous pipes in recursive function calls

2024-06-29 Thread Zachary Santer
On Sat, Jun 29, 2024 at 2:29 PM konsolebox wrote: > > On Sat, Jun 29, 2024 at 10:23 PM Zachary Santer wrote: > > > > The intention here is to report as many error conditions as possible > > before exiting. > > You can print an error message before calling return. Are you > planning to run more c

Re: waiting for process substitutions

2024-06-29 Thread Zachary Santer
On Sat, Jun 29, 2024 at 2:07 PM Oğuz wrote: > > There is a limit to the number of jobs Bash can remember, once it's exceeded > the oldest job is overwritten. Do we really want process substitutions to > count against that limit? They might already. Now I'm wondering if the documentation just ne