Created
December 2, 2009 16:25
-
-
Save glennr/247325 to your computer and use it in GitHub Desktop.
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 | |
### | |
# Bash shell script to convert filenames with | |
# uppercase + spaces to lowercase + underscores | |
# E.g. | |
# Moving "Goudy Old Style BT.ttf" to "goudy_old_style_bt.ttf" | |
# | |
# Author: Glenn Roberts | |
# | |
# Released under the MIT license | |
# | |
### | |
for i in * | |
do | |
j=`echo $i | tr '[A-Z]' '[a-z]'` | |
k=`echo $j | tr ' ' '_'` | |
echo "Moving \"" $i "\" to \"" $k "\"" | |
mv "$i" $k | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment