Re: feature suggestion: ability to expand a set of elements of an array
From:
Greg Wooledge
Subject:
Re: feature suggestion: ability to expand a set of elements of an array or characters of a scalar, given their indices
Date:
Wed, 26 Jun 2024 14:15:44 -0400
On Wed, Jun 26, 2024 at 14:09:13 -0400, Zachary Santer wrote:
> > > Imagine this functionality:
> > > $ array=( zero one two three four five six )
> > > $ printf '%s\n' "${array[@]( 1 5 )}"
> > > one
> > > five
> I did want to see if others would find this valuable, and no one spoke
> up, so it's whatever.
It's one of those features that you might expect in a higher-level
programming language, but don't necessarily need in a shell script.