Created
January 13, 2014 10:14
-
-
Save willtonkin/8397697 to your computer and use it in GitHub Desktop.
Something quick and nasty I used to fix a strange sync collision I had in Dropbox. The strings to change should be self explanatory. Tested in a Git repo I was working on so certain this works well.
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 | |
while IFS= read -r -d $'\0' file; do | |
dirname="${file%/*}/" | |
basename="${file:${#dirname}}" | |
removeme=" (Wills-MacBook-Pro's conflicted copy 2013-12-05)" | |
newname="${basename/$removeme/}" | |
mv -f "$file" "$dirname$newname" | |
done < <(find . -name "*conflicted\ copy\ 2013-12-05*" -type f -print0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment