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

modifiers applied after e qualifier but before oe?



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