Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2015
    Posts
    1

    Unanswered: Replacement of value in unix shell script

    hi friends,

    Need help for replacement of text "IP" present in n line number
    '<SERVER ID="XXXX12341234" IP="$XXXX_SERVER_IP" JAPORT="1234" NPORT="1234" />' i would like to replace only IP value with some value
    Example -- above IP value need to be replaced
    Original '<SERVER ID="XXXX12341234" IP="$XXXX_SERVER_IP" JAPORT="1234" NPORT="1234" />' at line number 10
    Expected '<SERVER ID="XXXX12341234" IP="$YYYY_SERVER_IP" JAPORT="1234" NPORT="1234" />' at line number 10

    Need command to replace IP value from the above line

    Please help
    Regards,
    Prasad

  2. #2
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    Code:
    s/IP=\"\$..../IP=\"\$ABCD/
    You can use vi sed or ed to change the file.
    Both " and $ are meta characters and need to be escaped.

Tags for this Thread

Posting Permissions

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