#! /bin/bash

echo -n "Give string to replace >> "
read  OLDSTRING
echo "*************************"
echo -n "Give new string >> "
read  NEWSTRING

echo "replacing " $OLDSTRING " with " $NEWSTRING
echo "_________________________________________"

echo -n "ARE YOU SURE? (Y/[N]) >>" 
read YES
if [ "$YES" = "Y" ]
# echo 's/'"$OLDSTRING"'/'"$NEWSTRING"'/'
then grep -rl "$OLDSTRING" . | xargs perl -pi~ -e 's/'"$OLDSTRING"'/'"$NEWSTRING"'/'
else
echo "ABORTED"
fi
# 

