[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: bash script

At 11:40 AM 2/19/2001 +0530, you wrote:
I have around 120 files in a directory whose names are in uppercase
letters. I want to change all these filenames to lowercase letters. I
can't change it manually. I want to write a script to do the same. How
do i do that? I have .c and .h files in the directory.
Eg: TEST.C has to be converted to test.c

for X in *; do mv "$X" "`echo $X | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`"; done

This is ugly, but I can't think up a regexp that expands to the full set of characters.


Kiran Jonnalagadda