Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
(j.|.)
- X-seq: zsh-users 28872
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: (j.|.)
- Date: Tue, 31 Jan 2023 08:38:26 -0800
- Archived-at: <https://zsh.org/users/28872>
- List-id: <zsh-users.zsh.org>
Bart:
Your clipped comments and code:
# ${(j.|.)var} means to join an array with vertical bars; here the var
is @ for the positional parameters.
# ${~something} means the value of something can be treated as a
pattern, so the |-joined positional parameters form a pattern.
# "set --" replaces the original positional parameters with this array
of parameter names.
set -- ${(ok)parameters[(I)${_v_case}${~${(j.|.)@}}]}
... I understand everything but the '(j.|.)' -- it seems ok like this:
set -- ${(ok)parameters[(I)${_v_case}${~${@}}]}
... I see no vertical bars either before or after. The PP's print as a
spaced array either way. But you didn't but that in for no reason.
Besides, the idea of joining the array seems backwards.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author