Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Replace strings CONTAINING apostrophes

    I have this PHP Program I have been hobbying for years. Started in old PHP3 early PHP4. So with the newer PHP, things are starting to break!

    I have this string:


    And I need to convert to this:


    in more than 200 scripts in my directory. I have been toying with sed (in a copy of the dir of course in case I really screw things over, lol) but am not gettig too far. The new code needs to swap ( ) for [ ] and i'm just all hung up!

    Any help will be hugely appreciated!

  2. #2
    Linux User
    Join Date
    Jan 2007
    welcome to the forum

    sed 's/(/[/;s/)/]/' <filename
    the sun is new every day (heraclitus)

Posting Permissions

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