Skip to content

Instantly share code, notes, and snippets.

@dstnbrkr
Created March 18, 2015 05:19
Show Gist options
  • Save dstnbrkr/5f9a3c91d43eca89afce to your computer and use it in GitHub Desktop.
Save dstnbrkr/5f9a3c91d43eca89afce to your computer and use it in GitHub Desktop.
Loop through filenames with spaces
# 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