Created
March 18, 2015 05:19
-
-
Save dstnbrkr/5f9a3c91d43eca89afce to your computer and use it in GitHub Desktop.
Loop through filenames with spaces
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
# example: renaming files named {0, 0, 0, 0} to 0-0-0-0 | |
find $DIR -type f | while read f | |
do | |
NEW=`echo $f | sed 's/[{}]*//g' | sed 's/, /-/g'` | |
git mv "$f" $NEW | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment