Find the answer to your Linux question:
Results 1 to 3 of 3
i want to replace Code: <trus.analytics.platform.model.version>2.0.0-SNAPSHOT</trus.analytics.platform.model.version> with Code: <trus.analytics.platform.model.version>2.0.0-b-20</trus.analytics.platform.model.version> using sed command. Code: sed -i 's/<gsi.trus.analytics.model.version>2.0.0-SNAPSHOT</gsi.trus.analytics.model.version>/<gsi.trus.analytics.model.version>2.0.0-b-20</gsi.trus.analytics.model.version>/g' pom.xml but it gives me error: Code: sed: -e expression #1, char 99: unknown ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    5

    [SOLVED] Escaping forward slash in sed command


    i want to replace

    Code:
    <trus.analytics.platform.model.version>2.0.0-SNAPSHOT</trus.analytics.platform.model.version>
    with

    Code:
    <trus.analytics.platform.model.version>2.0.0-b-20</trus.analytics.platform.model.version>
    using sed command.
    Code:
    sed -i 's/<gsi.trus.analytics.model.version>2.0.0-SNAPSHOT</gsi.trus.analytics.model.version>/<gsi.trus.analytics.model.version>2.0.0-b-20</gsi.trus.analytics.model.version>/g' pom.xml
    but it gives me error:
    Code:
    sed: -e expression #1, char 99: unknown option to `s'
    I think there is a problem with front-slash but not sure how to resolve it.

    Please guide.

  2. #2
    Just Joined! barriehie's Avatar
    Join Date
    Apr 2008
    Location
    The Desert!
    Posts
    85
    Try escaping the '/' by preceeding it with a '\', i.e. \/

  3. #3
    Just Joined!
    Join Date
    Oct 2010
    Posts
    5
    That worked Thanks for the quick reply.

Posting Permissions

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