Created
September 20, 2010 17:07
-
-
Save luisuribe/588240 to your computer and use it in GitHub Desktop.
replace spaces, lower chars and remove special chars from file name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
find . -name '*' | sort | while read i | |
do | |
NEWFILE=`echo $i | tr '[A-Z]' '[a-z]' | tr ' ' '_' | tr '(' '[' | tr ')' ']' | tr '&' 'N'` ; | |
if [ "${i}" != "${NEWFILE}" ]; then | |
mv "${i}" "${NEWFILE}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment