Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
modifiers applied after e qualifier but before oe?
- X-seq: zsh-users 26832
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Zsh Users List <zsh-users@xxxxxxx>
- Subject: modifiers applied after e qualifier but before oe?
- Date: Mon, 2 Aug 2021 15:42:34 +0100
- Archived-at: <https://zsh.org/users/26832>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: Zsh Users List <zsh-users@xxxxxxx>
Today I realised that modifiers were applied *before* the
expression in the oe['expression'] glob qualifier was evaluated
(but after the one in e['expression']):
$ echo /etc/issue(e['echo e: $REPLY']oe['echo oe: $REPLY']:t)
e: /etc/issue
oe: issue
issue
Is it as intended? I couldn't find it mentioned in the
documentation.
Is there a way to change that (for oe to see the original path
without modification by modifiers) within a single glob? I tried:
$ echo /etc/issue(#qe['echo e: $REPLY']oe['echo oe: $REPLY'])(#q:t)
e: /etc/issue
oe: issue
issue
didn't help.
If not, I can always do:
$ () { echo $@:t; } /etc/issue(e['echo e: $REPLY']oe['echo oe: $REPLY'])
e: /etc/issue
oe: /etc/issue
issue
That is move the modifiers out of the glob and apply them to
parameter expansion.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author