[mdlug-newbie] question about scripting

Mathew May mathewmay1 at wowway.com
Thu Jan 5 16:37:19 EST 2012


Sorry, 

The script I attached was a variant of the original one. This is the original script: 

#!/bin/bash 

ls | while read -r FILE 
do 
mv -v $FILE `echo $FILE | tr ' ' '_' | tr '[A-Z]' '[a-z]'` 
done 


Thanks, 
Mat 


----- Original Message -----
From: "Mathew May" <mathewmay1 at wowway.com> 
To: mdlug-newbie at mdlug.org 
Sent: Thursday, January 5, 2012 4:23:40 PM 
Subject: [mdlug-newbie] question about scripting 


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 

_______________________________________________ 
mdlug-newbie mailing list 
mdlug-newbie at mdlug.org 
http://mdlug.org/mailman/listinfo/mdlug-newbie 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mdlug.org/pipermail/mdlug-newbie/attachments/20120105/7ad93a42/attachment-0001.html>


More information about the mdlug-newbie mailing list