zsh-users
 help / color / mirror / code / Atom feed
* modifiers applied after e qualifier but before oe?
@ 2021-08-02 14:42 Stephane Chazelas
  2021-08-02 16:27 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Stephane Chazelas @ 2021-08-02 14:42 UTC (permalink / raw)
  To: Zsh Users List

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-02 21:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 14:42 modifiers applied after e qualifier but before oe? Stephane Chazelas
2021-08-02 16:27 ` Bart Schaefer
2021-08-02 21:19   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).