Skip to content

Instantly share code, notes, and snippets.

@DavidS
Created August 30, 2012 18:19
Show Gist options
  • Save DavidS/3536412 to your computer and use it in GitHub Desktop.
Save DavidS/3536412 to your computer and use it in GitHub Desktop.
#!/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