Tuesday, 1 November 2011

sed problem

sed problem

Hi,

Please could someone advise, how I can resolve the sed problem that I have.

I'm creating the following variable :

SAN_HOME_PROPERTY=`cat $BKUPDIR/environment.properties | grep SAN_HOME=`

this gives me the following value :

SAN_HOME=/san/dev6/bin/REL1_BC0876_CD2011

then, when i perform the SED command as per below :

sed "s/SAN_HOME=/\$\SAN_HOME_PROPERTY/g" $SAN_TOP/cfg/environment.properties

When I check the file - $SAN_TOP/cfg/environment.properties

the sed command enters the variable $SAN_HOME_PROPERTY, instead of entering the variable value SAN_HOME=/san/dev6/bin/REL1_BC0876_CD2011

How can I sed the value into the file from the variable ?

thank you

No comments:

Post a Comment