-
-
Save Jildor/2445a740c0ba55a62c21d66584546d9c to your computer and use it in GitHub Desktop.
replace spaces, lower chars and remove special chars from file name
This file contains hidden or 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