#!/bin/bash
grep -rl 'pdhcentral.com' . > recordsa_pdhcentral.txt
for i in `cat recordsa_pdhcentral.txt`; do
FileName=$i;
FileBack=$FileName"_bk";
if [ -f $FileName ]; then
sed 's/.*pdhcentral.*//g' $FileName > $FileBack; mv -f $FileBack $FileName
else
echo $FileName " Doesnt Exists...................!!!!! ";
fi
done
Comments
# find . -type f -exec sed -i.bak 's/.*pdhcentral.*//g' {} \;
Eventhough I am not going to delete the post, because it is my history. :-)