[Techtalk] Uppercase to lowercase

Kathryn Hogg kjh at flyballdogs.com
Thu Dec 5 13:04:21 EST 2002


> Was wondering if anyone had a script they would like to share to convert
>  upercase filenames to lowercase?

in bash (and off the top of my head)

#!/bin/bash
for file in $*
do
  dir=$(dirname $file)
  fname=$(basename $file)
  new=$(echo $fname | tr '[:upper:]' '[:lower:]')
  mv $file $new
done

-- 
Kathryn





More information about the Techtalk mailing list