Created
August 30, 2012 18:19
-
-
Save DavidS/3536412 to your computer and use it in GitHub Desktop.
hofi's rename script from http://hofbauer.bplaced.net/cms/2012/08/automatically-rename-files-and-folders/; adapted for style
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/bash | |
DIR="$1" | |
# only start rename when $DIR is not root or empty | |
if [ "$DIR" == "" ] || [ "$DIR" == "/" ]; then | |
echo "No directory given" >&2 | |
exit 1 | |
fi | |
echo "Working on $DIR" | |
find "$DIR" -depth -print0 | xargs -0 -i rename 'y/A-ZÄÖÜ /a-zäöü_/;s/ä/ae/g;s/ö/oe/g;s/ü/ue/g;s/ß/ss/g;s/,//g' {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment