[mdlug-newbie] question about scripting

Mathew May mathewmay1 at wowway.com
Thu Jan 5 16:23:40 EST 2012


I am trying to write a script that will go through my current mp3 directory and change any space in a file name to an under score as well as change all upper case characters to lower case. I am new to scripting and I have done pretty good so far, but now I am trying to make my script recursive. 

Here is what I have so far: 

#!/bin/bash 

#ls -R | while read -r FILE 
for FILE in `find /home/mmay3/Music/tori_amos *.mp3 -type f` 
do 
mv -v $FILE `echo $FILE | tr ' ' '_' | tr '[A-Z]' '[a-z]'` 
done 

Any help would be greatly appreciated 
Mat 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mdlug.org/pipermail/mdlug-newbie/attachments/20120105/af4fe5f3/attachment-0001.html>


More information about the mdlug-newbie mailing list