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

2024-06-28 Thread Zachary Santer
On Tue, Jun 11, 2024 at 6:48 AM Zachary Santer wrote: > > The ( ) within the parameter expansion would be roughly analogous to > the right hand side of a compound assignment statement for an indexed > array. The values found therein would be taken as the indices of array > elements or characters

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

2024-06-28 Thread Greg Wooledge
On Fri, Jun 28, 2024 at 08:50:50 -0400, Zachary Santer wrote: > Is "${array[@]( "${indeces[@]}" )}" ugly? Does that matter? It seems > like a good way to write what's happening. I still have to look up > some of the less-commonly-used parameter expansions every time I use > them. I think people wou

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

2024-06-28 Thread Chet Ramey
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 if any command in the pipeline fails. This would streamline error handling and provide more predictable script execution, aligning wi

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

2024-06-28 Thread Zachary Santer
On Fri, Jun 28, 2024 at 9:11 AM Greg Wooledge wrote: > > I'm still wondering when you'd ever use this in a shell script. In my case, I've got a couple of things: (1) One script has an array of names for named pipes. It might only need two of the six for a given invocation, so why create all six

anonymous pipes in recursive function calls

2024-06-28 Thread Zachary Santer
Was "feature suggestion: ability to expand a set of elements of an array or characters of a scalar, given their indices" On Fri, Jun 28, 2024 at 5:29 PM Zachary Santer wrote: > ( 2 ) > A script that I've written more recently generates some arrays > describing everything it needs to do before it