You are not logged in.

#1 2025-04-20 11:53:31

tethys
Member
Registered: 2019-08-13
Posts: 168

[SOLVED] Strange behaviour of perl-rename

The following command for converting uppercase to lowercase in file names

perl-rename 'y/A-Z/a-z/' *.txt

does not work when run in a directory on a FAT32 USB-stick but it works when run in the home directory on an Ext4 partition.

When run with option -n (dry run), it works in both directories!

(The above command works only on text files, for example "NEW FILE.txt".)

Can somebody please check this? I am using the last version 1.16-1 of perl-rename.

Any ideas?

Last edited by tethys (2025-04-20 12:15:54)

Offline

#2 2025-04-20 12:05:52

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,366
Website

Re: [SOLVED] Strange behaviour of perl-rename

This is a filesystem limitation -- FAT is case-insensitive, so 'aaa' and 'AAA' are the same file.

# touch aaa
# mv aaa AAA
mv: 'aaa' and 'AAA' are the same file

You will need to introduce a staging step. i.e. rename 'aaa' to 'AAA1', then rename 'AAA1' to 'AAA'.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2025-04-20 12:15:29

tethys
Member
Registered: 2019-08-13
Posts: 168

Re: [SOLVED] Strange behaviour of perl-rename

Oh, thank you WorMzy, that explains the strange behavior!

Offline

Board footer

Powered by FluxBB