I'm trying to change a line of syntax in a config file where the line looks like the following:
host="192.0.2.100"
I'm writing a script that would require input the user to change the ip and keep the same format as above. What I wrote:
#/bin/bash
echo "enter IP"
read inputIP
sed -i /host=/c\host="$inputIP" /path/file.xml
What I get when i run this in file is:
host=192.0.2.100
So the question is how do I run this and not lose the quotes?