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

Re: :r modifier

>>> "Bart" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:


 Bart> Hrm.  Well, it's correct in so far as it goes; the :r and
 Bart> :e modifiers appear to assume that they're already
 Bart> working on the result of :t, and pay no attention at all
 Bart> to slash characters; they just find the rightmost '.' and
 Bart> split on it.  They've worked this way for as long as zsh
 Bart> has existed, AFAICT.

I believe this weakness makes :r error-prone (who *needs* to
ignore slashes?).  Now, if I want the slash-aware equivalant for
$MAIL:r, I have to write something like:

echo $MAIL:h/$MAIL:t:r
(this assumes that the dirname is non-empty).

 Bart> Tcsh behaves the same, so I don't expect we'll be
 Bart> changing it any time soon.

Oh, I didn't know this was a tcsh heritage (this can explain
lots of things :o)).  Anyway, my copy of tcsh does behave as *I*
expect on these modifiers (i.e. unlike Zsh). See:

% tcsh -f
> echo $MAIL
> echo $MAIL:r $MAIL:e
> echo $version
tcsh 6.09.03 (Astron) 2000-07-15 (i386-intel-linux) options 8b,nls,bye,al,ng,rh,nd,color

Alexandre Duret-Lutz

Messages sorted by: Reverse Date, Date, Thread, Author