#!/bin/bash dir=$(cd $(dirname $0) && pwd) find ${dir} -type f |while read file do cat ${file} | \ dos2unix | \ sed -e 's,[\t ]*$,,g' \ -e "s,"$'\x92'",'," \ > ${file}.tmp cnt=$(diff ${file}.tmp ${file} | wc -l) if [[ ${cnt} -gt 0 ]] then echo Fixed ${file} mv ${file}.tmp ${file} else rm ${file}.tmp fi done find ${dir} -name '*.gpdsc' | while read f do cat ${f} | grep -v '' > ${f}.tmp mv ${f}.tmp ${f} done find ${dir} -name '*.ioc' | while read f do cat ${f} | grep -v 'ProjectManager.CustomerFirmwarePackage' > ${f}.tmp mv ${f}.tmp ${f} done