Replacing the ipaddress using script

Hi all ,
I have written the script but the ip address is not getting replaced correct me i ima wrong

#!/bin/bash
echo "enetr ip"
read $a
echo $a
b=`grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'  /usr/local/kalyan/mysqlup.sh`
echo "$b"
sed -i 's/'$b'/'$a'/g' /usr/local/kalyan/mysqlup.sh

in the mysqlup.sh the following line hold the ipaddres which should be replaced with new ipaddress

scp $OUTPUTLOG root@192.168.70.154:/usr/local/ 1>/dev/null 2>&1

There is an error in syntax of read statement

read $a

should be

read a

And your script will work fine.
You don't need grep also.

sed "s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/$b/g"