Created
March 7, 2009 21:58
-
-
Save fj/75464 to your computer and use it in GitHub Desktop.
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
# Removes all Unicode BOMs from files and converts Windows CRLF to Unix LF. | |
find . -type f | \ | |
while read line; \ | |
do \ | |
hd "$line" | grep -q 'ef bb bf' && echo "$line"; \ | |
done | \ | |
while read line; \ | |
do \ | |
echo [[[ $line; \ | |
dd if=$line of=$line.result ibs=3 skip=1; \ | |
diff $line $line.result; \ | |
dos2unix -v $line.result; \ | |
mv -v $line.result $line; \ | |
echo ]]]; \ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment