参考链接 http://stackoverflow.com/questions/1068650/using-awk-to-remove-the-byte-order-mark
Try this:
awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}{print}' INFILE > OUTFILE
On the first record (line), remove the BOM characters. Print every record.
Or slightly shorter, using the knowledge that the default action in awk is to print the record:
awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}1' INFILE > OUTFILE
1 is the shortest condition that always evaluates to true, so each record is printed.
Enjoy!
还有一个中文的参考链接 http://www.cnblogs.com/lidp/archive/2009/06/17/1697886.html