Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: nesting issue
- X-seq: zsh-users 29889
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: nesting issue
- Date: Sun, 05 May 2024 01:39:07 -0400
- Archived-at: <https://zsh.org/users/29889>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <CAH+w=7aqkafqXHReUU2iOhAoOFbwBbdoFyuBWTOTnRM6xiEM3g@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <b26aef45-320d-4bf5-80e9-7ce0000afa3d@eastlink.ca> <CAH+w=7aqkafqXHReUU2iOhAoOFbwBbdoFyuBWTOTnRM6xiEM3g@mail.gmail.com>
On Sat, May 4, 2024, at 11:20 PM, Bart Schaefer wrote:
> On Sat, May 4, 2024 at 12:36 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>>
>> local sorted=( "${(f)$(print -l "${(n)in[@]}") }" )
>> local sorted=( "${(f)$(print -l \"${(n)in[@]}\") }" )
>> local sorted=( "${(f)$(print -l ${(n)in[@]}) }" )
>> local sorted=( ${(f)$(print -l ${(n)in[@]}) } )
>>
>> .... none of those work.
>
> They give "bad substitution" because you can't have a space before the
> closing "}" / after the closing ")" in the parameter expansion.
>
> local sorted=( "${(f)$(print -l "${(n)in[@]}")}" )
>
> I'm not going into whether that produces the result that you intend.
He should probably throw out the "print -l" and splitting fluff.
local sorted=($1,*(Nn))
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author