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

Re: :r modifier



On Dec 13,  2:03pm, Alexandre Duret-Lutz wrote:
} Subject: Re: :r modifier
}
} >>> "Bart" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:
} 
}  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)).

Actually, it's likely straight 4.[23] BSD csh heritage, not via tcsh, but
I don't have a copy of 4.x BSD sitting around to confirm that.

} I believe this weakness makes :r error-prone (who *needs* to
} ignore slashes?).

You're assuming that :r is used exclusively on unix file-paths and should
employ unix file-path semantics, but parameter values are just strings.

Suppose we change it to pay attention to slashes.  Does that mean that on
cygwin it should also pay attention to backslashes?  Do we need to teach
:h/:t about the leading-double-slash convention for some networked file
systems?

} [To get] $MAIL:r, I have to write something like:
} 
} echo $MAIL:h/$MAIL:t:r
} (this assumes that the dirname is non-empty).

There's always ${MAIL%.[^/]#} ...

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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