Created
March 21, 2014 10:51
-
-
Save hfs/9683692 to your computer and use it in GitHub Desktop.
Replace \r\r\n with \r\n in text files. \r\r\n happens typically, when an inferior VCS messes up the line endings on Windows
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/sh | |
find . -type f | while read each; do | |
if xxd -p "$each" | tr -d '\n' | grep -q 0d0d0a; then | |
echo "$each" | |
sed -i.bak -e 's/\r//' "$each" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment