[plug] Perl script ?

Russell Steicke r.steicke at bom.gov.au
Mon Oct 31 12:09:12 WST 2005


On Mon, Oct 31, 2005 at 11:47:04AM +0800, garry wrote:
> I wondering if Perl can do this....
> 
> With a music folder full of upper and lower case directory names, the 
> "alphabeticalness" get mucked up..
> 
> I'd like to be able to change all directory names to lower case..

Perl can certainly do this, and a few lines of shell would be capable,
too (using tr, mv and not much else), however...

Sorting like this happens in the C locale.  If you use the en_AU
locale, names will be sorted case-folded, and with certain characters
ignored for sorting purposes (eg "abc" will sort after "ab-d" in C
locale, but before in en_AU locale, and '.' is ignored.)

Try
  LANG=C ls -al
and
  LANG=en_AU ls -al

to see the difference.  Changing locales may be a better solution if
you want your directory listings sorted like that everywhere, and is
probably the right thing anyway.




-- 
Russell Steicke

-- Fortune says:
Westheimer's Discovery:
	A couple of months in the laboratory can frequently save a
	couple of hours in the library.



More information about the plug mailing list