Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: nesting issue
- X-seq: zsh-users 29890
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Ray Andrews <rayandrews@xxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: nesting issue
- Date: Sun, 5 May 2024 07:40:00 +0200
- Archived-at: <https://zsh.org/users/29890>
- 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 Sun, May 5, 2024 at 5:21 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> local sorted=( "${(f)$(print -l "${(n)in[@]}")}" )
>
> I'm not going into whether that produces the result that you intend.
My guess is that it almost certainly does not produce the result Ray
intended. This might though:
local sorted=( $1,*(nN) )
The difference can be observed in the following cases:
- Nothing matches $1,*.
- $1 starts with a dash.
- At least one element of $1,* contains a newline.
- At least one element of $1,* contains a C style escape sequence.
I think it unlikely that in any of these cases the results produced by
the variant with the print are desired.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author