Created
July 10, 2021 15:40
-
-
Save htaketani/a69613e42fa941c8e7f4dca2478a0f55 to your computer and use it in GitHub Desktop.
Remove UTF-8 BOM from a file (or stdin)
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 | |
# remove-utf8-bom | |
# Remove UTF-8 BOM from a file (or stdin) | |
# Usage: remove-utf8-bom [file] | |
# License: CC0 (https://creativecommons.org/publicdomain/zero/1.0/) | |
LC_ALL=C sed -e $'1s/^\xef\xbb\xbf//' -- "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment