Sed, shell and hexadecimal character codes

Karel Miklav karel at inetis.com
Wed May 21 07:36:06 UTC 2008


There's a tip in the FreeBSD fortunes database that says:

 > Want to strip UTF-8 BOM(Bye Order Mark) from given files?
 >
 > sed -e '1s/^\xef\xbb\xbf//' < bomfile > newfile

I can't make it work, and I can't find any other method to
work with hexa codes in scripts or on the command line so
I'm kind-a depressed :) I help myself with xxd now, but if
it is possible to avoid it, I'd like to hear about it.

-- 

Regards,
Karel Miklav




More information about the freebsd-questions mailing list