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

Re: nesting issue



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