Created
November 5, 2014 08:49
-
-
Save filviu/c1f3ecfc75b3486f67bd to your computer and use it in GitHub Desktop.
Rename characters containing umlauts, etc. to their ascii literal equivalent
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/bash | |
| type iconv >/dev/null 2>&1 || { echo >&2 "iconv has to be installed. Aborting."; exit 1; } | |
| find . -type f | while read FILE; do | |
| if [ -f "$(echo "$FILE" | iconv -f utf8 -t ascii//TRANSLIT)" ]; then | |
| echo "No rename required: $FILE" | |
| else | |
| mv -v "$FILE" "$(echo "$FILE" | iconv -f utf8 -t ascii//TRANSLIT)" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment