4 # @(#) lowercase.ksh 1.0 92/10/08
5 # 92/10/08 john h. dubois iii (john@armory.com)
7 # conversion to bash v2 syntax done by Chet Ramey
9 Usage
="Usage: $name file ..."
12 echo "$name: change filenames to lower case.
14 Each file is moved to a name with the same directory component, if any,
15 and with a filename component that is the same as the original but with
16 any upper case letters changed to lower case."
21 while getopts "h" opt
; do
24 *) echo "$Usage" 1>&2; exit 2;;
33 */*) dirname=${file%/*} ;;
36 nf
=$
(echo $filename |
tr A-Z a-z
)
37 newname
="${dirname}/${nf}"
38 if [ "$nf" != "$filename" ]; then
40 echo "$0: $file -> $newname"
42 echo "$0: $file not changed."