Re: Which FAT mount options to change the case of filenames?



On Apr 27, 3:54 am, Jef Driesen <jefdrie...@xxxxxxxxxxxxxxxxxxx>
wrote:
Duinen wrote:
Jef Driesen wrote:
Lew Pitcher wrote:
On Apr 26, 4:40 am, Jef Driesen <jefdrie...@xxxxxxxxxxxxxxxxxxx>
wrote:
When I try to change the case of a file on a fat32 partition, I get an
error:

$ touch ABC
$ mv ABC abc
mv: 'ABC' and 'abc' are the same file

Just my curiosity here, WHY do you need to change the case? (I have
never understood why *nix allows names that differ in case only for some
names and not for others.)

The files in my image collection do not have a consistent case now. I
have variations like "IMG_xxxx.JPG", "IMG_xxxx.jpg" and "img_xxxx.jpg"
(the numbers are unique) and I want to have only one naming scheme.

for file in *.[Jj][Pp][Gg] ;
do
UC=`echo $file | tr a-z A-Z`
[ "$file" = "$UC" ] || mv "$file" "$UC"
done


HTH
--
Lew

.



Relevant Pages