Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcso!hpldola!hp-lsd!jimr From: jimr@hp-lsd.COS.HP.COM (Jim Rogers) Newsgroups: comp.unix.questions Subject: Re: Changing upper-case filenames to lower-case Message-ID: <7370007@hp-lsd.COS.HP.COM> Date: 4 Jan 90 21:43:23 GMT References: <3116@jarthur.Claremont.EDU> Organization: HP Logic Systems Division - ColoSpgs, CO Lines: 43 I was surprised that no one came up with the simple and efficient ksh answer to this: #!/bin/ksh typeset -i flag (( flag = 0 )) set -- `getopt du $*` for i in $* do case $i in -d) typeset -l nf; (( flag = 1 )); shift;; -u) typeset -u nf; (( flag = 1 )); shift;; --) shift; break; esac done if (( flag == 0 )) then typeset -l nf fi while [ $# -gt 0 ] do nf=${1} if [ "$nf" != "$1" ] then print "Do you want to convert ${1} to ${nf} (Y/N)?" read if [ "$REPLY" = "Y" -o "$REPLY" = "y" ] then print "Moving ${1} to ${nf}" mv ${1} ${nf} fi fi shift done This version will shift up or down as you please. To shift up use the "-u" option. To shift down either use the "-d" option or no option. Jim Rogers