Hi ,
I have some data in my file(properties.txt) like this.
# agent.properties
agent.dmp.Location=
agent.name=
I need to relpace the
agent.dmp.location with agent.dmp.Location = /opt/VRTS/vxvm
I am using the follwing to replace the string
AGENT_NAME=snmp
AGENT_DMP_LOCATION=/var/opt
sed "s/agent.name=.*/agent.name= $AGENT_NAME/g" properties.txt > properties.txt.tmp;
mv properties.txt.tmp properties.txt > /dev/null 2>&1
the above command is successfully executing and the value in the file is
# agent.properties
agent.dmp.Location=snmp
agent.name=
but for agent.dmp.Location
sed "s/agent.dmp.Location=.*/agent.dmp.Location= $AGENT_DMP_LOCATION/g" properties.txt > properties.txt.tmp;
mv properties.txt.tmp properties.txt > /dev/null 2>&1
is showing error like this
sed: command garbled: s/agent.dmp.Location =.*/agent.dmp.Location= /var/opt/g
i think the problem is due the variable AGENT_DMP_LOCATION=/var/opt..since it has '/' .
could anyone please solve this issue.
thanks in advance.