Results 1 to 2 of 2
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 ...
- 11-01-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 12
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
- 11-01-2011 #2
try:
Code:sed s/SAN_HOME=/"$SAN_HOME_PROPERTY"/g $SAN_TOP/cfg/environment.properties
linux user # 503963


Reply With Quote