Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I need to replace JAVA_OPTS= with JAVA_OPTS=<some_value>\. I need to give "\" value at the end of the replacement. I have tried with the following but it is not ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Defining Variable with sed

    Hi,

    I need to replace JAVA_OPTS= with JAVA_OPTS=<some_value>\.

    I need to give "\" value at the end of the replacement. I have tried with the following but it is not working:

    sed -e "s|JAVA_OPTS= |JAVA_OPTS=<some_value>\"

    Can any one suggest me a solution for this!

    Regards,
    Ganesh Kumar

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    Quote Originally Posted by parajaganesh@gmail.com View Post
    Hi,

    I need to replace JAVA_OPTS= with JAVA_OPTS=<some_value>\.

    I need to give "\" value at the end of the replacement. I have tried with the following but it is not working:

    sed -e "s|JAVA_OPTS= |JAVA_OPTS=<some_value>\"

    Can any one suggest me a solution for this!

    Regards,
    Ganesh Kumar
    Try:
    Code:
    sed -e "s|JAVA_OPTS=|JAVA_OPTS=<some_value>\\|"

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3
    Hi,

    I have tried the following but it is not working.

    sed -e "s|JAVA=|JAVA=/usr/ganesh\\|" mytest > result

    It gives "sed: -e expression #1, char 26: Unterminated `s' command" error.

    -Ganesh

Posting Permissions

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