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

Re: string match simplification?





On 2024-09-03 12:21, Roman Perepelitsa wrote:

If the input is "foo.", this script will print "filename is: foo." (note the trailing dot). Probably not what you want. If you use :r instead, you'll get the expected "foo" without the trailing dot.

It's a bit subjective but I think I do want the trailing dot.  It's there, so a legitimate part of the filename.  I'm not throwing it away.  But by itself we can hardly call it an extension.  If I used :r and :t:r and then cobbled them back together again the dot would disappear.  So I'm thinking a trailing dot is a null event and if there is an extension the dot goes with the extension -- but that's ... hmmm .... that's not very tight logic, is it? Anyway :r and :t:r loose the dot, so I hafta store it somewhere.


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