Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    14

    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

  2. #2
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    try:
    Code:
    sed s/SAN_HOME=/"$SAN_HOME_PROPERTY"/g $SAN_TOP/cfg/environment.properties
    linux user # 503963

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •