Find the answer to your Linux question:
Results 1 to 2 of 2
Hi there, bi=8&kw=finanzen&ci=hamburg&ciid=8816& amp; I need to replace & with & . sed -i s/"&"/"&"/ test2.txt The above command does not. cat test2.txt bi=8&kw=finanzen&ci=hamburg&ciid=8816& amp Anyone knows why ?...
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    9

    sed not working

    Hi there,

    bi=8&kw=finanzen&ci=hamburg&ciid=8816& amp;

    I need to replace & with & .

    sed -i s/"&"/"&"/ test2.txt

    The above command does not.

    cat test2.txt
    bi=8&kw=finanzen&ci=hamburg&ciid=8816& amp

    Anyone knows why ?

  2. #2
    Just Joined! pieman's Avatar
    Join Date
    Jan 2012
    Location
    Sunny Yorkshire
    Posts
    11
    The & is a special character, so you need to use \& instead. For example:

    sed 's/&/\&/g' test.txt

Posting Permissions

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