Filenames -- converting

Earl H. Kinmonth ked at garnet.berkeley.edu
Fri Jun 9 12:57:41 AEST 1989


In article <25879 at beta.lanl.gov> srb at beta.UUCP ( Steve Berger ) writes:
>
> I have a directory with all the filenames in Uppercase letters.
> I'd like to move them all to lowercase.
>
> Is there an easy way to do that?  I figure there must be a way using
> sed  or something, but I haven't figured it out yet, and I don't want to
> go thru and  use  mv to move each file name, that will take me forever.
>
> Any ideas will be appreciated.
>
> Steve Berger
>
> srb at lanl.gov

There are many ways you can do this.  The one given below works.  It
is not necessarily "efficient" except that it took me about 1 second
to think it through.

for i in *
do
T=`echo $i | tr '[A-Z]' '[a-z]`
mv $i $T
done

If you want to do it with sed, look at the "y" command.

Earl H. Kinmonth
History Department
University of California, Davis
Davis, California  95616
916-752-1636 (2300-0800 PDT for FAX)
916-752-0776 (secretary)
ucbvax!ucdavis!ucdked!cck (email)
cc-dnet.ucdavis.edu [128.120.2.251]
	(request ucdked, login as guest)



More information about the Comp.unix.xenix mailing list