-
Notifications
You must be signed in to change notification settings - Fork 1
/
cleanup-visual-studio.sh
executable file
·16 lines (15 loc) · 1.09 KB
/
cleanup-visual-studio.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Removes all Unicode BOMs from files and converts Windows CRLF to Unix LF.
find . -path '*/.git/*' -prune -o -type f -print | \
while read line; \
do \
dd if="$line" 2>/dev/null | od -x | grep -q 'efbbbf' && 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