Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dstnbrkr
Created March 18, 2015 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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