Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: :r modifier
- X-seq: zsh-workers 13254
- From: Alexandre Duret-Lutz <duret_g@xxxxxxxxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: :r modifier
- Date: 13 Dec 2000 14:03:59 +0100
- Cc: zsh-workers@xxxxxxxxxxxxxx
- In-reply-to: "Bart Schaefer"'s message of "Wed, 13 Dec 2000 04:15:01 +0000"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- Organization: LRDE/EPITA http://www.lrde.epita.fr/
- References: <mvbzoi1shkr.fsf@xxxxxxxxxxxxxxxxxxxx> <1001213041501.ZM11124@xxxxxxxxxxxxxxxxxxxxxxx>
- Sender: Alexandre Duret-Lutz <adl@xxxxxxxx>
>>> "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
/home/adl/.procmail/spool/Inbox
> echo $MAIL:r $MAIL:e
/home/adl/.procmail/spool/Inbox
> 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