rant: filenames (2023 Update)

What about .jpeg and .JPEG as well? The three-character versions only came into use because of the old broken DOS filesystem that only supported three-character extensions.

I have a little script called "mved" that makes it trivial to mass-rename files, e.g. "mved \*.jpeg \*.jpg" shortens the extensions. It supports multiple wildcards also, and can create directories where needed. For for example if I have a bunch of magazine PDFs called for example "Your Hobby - Sep 2019.pdf", I can say:

$ mved '* - * *.pdf' 'Your Hobby/\3/\3-\2 Your Hobby.pdf'

to create the year subdirectory and rename the files to put the year and month first in those directories. I need to create a special substitution to match month names and convert to 2-digit month numbers.

mved used to be a Bash script, but as it grew more difficult to handle all the possible magic characters I rewrote it in Ruby (a standard or easy install on all systems I use). I have this sym-linked as ~/bin/mved:

formatting link

Regardless of all this, I want my filesystem to store what I tell it to store, not to munge or reject a filename I choose to use. Unix filesystems reject only two codepoints: ASCII nul, and forward-slash. Everything else is preserved.

It is the job of a shell's wildcard expansion to do case-insensitive matching, if necessary.

Reply to
Clifford Heath
Loading thread data ...

Well how is this relevant? We are only talking about case data.

The rename under dps can do much of that even without scripting, you can say chg abc*zz.xxx .zzz etc. But this is not what we are talking about.

So do I. I just want it also to detect name duplications where yours would not.

Well it is a way of doing it. It adds some overhead to the user, to which apparently unix users - the programmer kind - are used to and do not mind. The general user would though.

Consider dictating over the phone a unix name like ThIs_Is_mE.jPg . Text has evolved to what we have today over the millennia for a reason.

Reply to
Dimiter_Popoff

so you want to ignore case, you also want assume _ means space?

and in text case also matters

Reply to
Lasse Langwadt Christensen

Well someone wrote it for me, though it was not "someone else" :-). In fact chg (like anything else) just uses the system call for directory search, which someone (not else :) wrote so it can do a lot of pretty sophisticated things.

While I lived in Germany I had learned a key combination turning a German keyboard (qwertz) into a normal qwerty one so I could use it on occasions I needed to. Now my German is pretty decent, but can you believe I thought the "sz" symbol printed on the key where it was (IIRC it was on shift-2 or something) stood for a Greek beta... I thought that for years until someone mentioned it.

Reply to
Dimiter_Popoff

On a sunny day (Mon, 15 Nov 2021 17:22:03 -0500) it happened Phil Hobbs snipped-for-privacy@electrooptical.net wrote in <smumie$g4d$ snipped-for-privacy@gioia.aioe.org>:

At least get the quoting right, I did not write that.

Reply to
Jan Panteltje

Anyone naming a file like that is a prime Darwin Award candidate anyway. ;)

Cheers

Phil Hobbs

Reply to
Phil Hobbs

I love pdf.pdf as a response.

Reply to
Robert Baer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.