I have a replace function like
function replace()
{
sed -i "s#$1#$2#g" $3
}
I am calling the function with these parameters
replace MY_IP $MY_IP /usr/xxx.sh
where $MY_IP is a empty value
so sed is giving as sed -i s#MY_IP#/usr/xxx.sh#g
sed no input files
It is not taking the empty value. How to solve this?