Created
January 9, 2014 15:36
-
-
Save Arkham/8336035 to your computer and use it in GitHub Desktop.
Rename files removing extra characters
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 | |
set -e | |
DIR=${1:-.} | |
PRUNED_CHARS=":?" | |
find $DIR -type f -print | while read filename | |
do | |
cleaned=${filename//[$PRUNED_CHARS]/} | |
echo mv "$filename" "$cleaned" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment