Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    115

    Unanswered: cant replace values by unix env variables in sed

    pls advise

    A=1
    B=2
    C=3
    echo ABC | sed '
    s/A/$A/
    s/B/$B/
    s/C/$C/
    '
    ==> result
    $A$B$C
    ==> expected result
    123

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Replace the single quotes with double quotes. The shell doesn't do variable substitution within single quotes.

  3. #3
    Join Date
    Jul 2006
    Posts
    115

    Talking

    thanks a lot

Posting Permissions

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