Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "${*:offset:length}" and ksh93/bash compatibility



On Sun, Mar 13, 2022 at 12:23 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> The way it works in bash is it does become a scalar, but the subscript
> works on the array elements before joining (just like [1,3] does in
> zsh in the same context).

Ah, OK. You're thinking of "${a[*][1,3]}" and I'm thinking of
"${${a[*]}[1,3]}".  Empirically, :off:len is (currently) implemented
as the latter rather than as the former.

> I also just took a look
> at getindex() and don't want to replicate the appropriate parts of
> that logic (which would require understanding what any of the parts
> do).

Indeed.




Messages sorted by: Reverse Date, Date, Thread, Author