Has rename syntax changed?

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Fri Feb 28 19:52:00 GMT 2020


On 2020-02-28 11:09, Lee wrote:
> On 2/28/20, Fergus Daly wrote:
>> I am almost certain that the command
>> $ rename "anything" "AnyThing" *.ext
>> would alter the string from lc to uc as shown, anywhere it occurred in any
>> filename in *.ext in the current directory.
>> What I remember as past behaviour now fails, leaving he filename unaltered.
>> (Failure in much the same way as mv would fail if the similar attempt was
>> made.)
>> (Good old DOS command rename (or the abbreviation ren) used to achieve
>> multiple-rename in an easy manner that just eludes bash.)
>> Anyway: has something altered (and quite recently, i think), or am I just
>> mis-remembering the versatility of the command rename?
> 
> Try it with the '-v' option
> 
> $ rename -v anything AnyThing *.ext
> `anything.ext' -> `AnyThing.ext'
> `xxanythingxx.ext' -> `xxAnyThingxx.ext'
> 
> $ rename -v AnyThing anything *.exe
> rename: *.exe: not accessible: No such file or directory
> 
> $ rename -v AnyThing anything *.ext
> `AnyThing.ext' -> `anything.ext'
> `xxAnyThingxx.ext' -> `xxanythingxx.ext'

This will always depend on the file system interface: DOS ignores case changes
as case is not supported, ExFAT/VFAT and everything else preserves case changes,
as do most remote file systems, unless the remote is set up case insensitively
to check the old and new names and ignore case changes (I've been annoyed by
that in the past, normally on proprietary file servers).

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list