#!/bin/bash

if [ $# -eq 0 ]; then
  echo "usage: $0 list_of_file_extensions"
  exit
fi
if [ $1 == "help" ]; then
  echo "usage: $0 list_of_file_extensions"
  exit
fi
for j in $@;
do
  for i in `find . -name "*.$j" `;
  do
    CMD=`sed -n '/\xef\xbb\xbf/ p' $i`
    if [ "$CMD" != "" ]; then
      echo $i
      sed -i\.bck 's/\xef\xbb\xbf//' $i
    fi
  done #i
done; #j%
