Created
November 23, 2017 12:52
-
-
Save aslakhellesoy/cdb0c4152b211d43979df13e116b3200 to your computer and use it in GitHub Desktop.
Remove BOM from a bunch of files
This file contains hidden or 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
#!/usr/bin/env bash | |
function removeBom | |
{ | |
awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}{print}' "$1" > .nobom | |
mv .nobom "$1" | |
} | |
shopt -s globstar | |
for f in **/*.{cs,config,feature,feature.cs,csproj,sln,md}; do | |
removeBom "$f" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment