0

I am using find /path -type f -exec sed -i 's/oldstr/newstr/g' {} \; (Source: Stackoverflow). This is working fine. But, I want to replace string with spaces and special characters.

Old string -> where acc_id = ".$_SESSION['acc_id']);

New string -> ");

I don't want to use regex. I have exact string. Is there any way to do it with above find and sed command or anything else?

  • Thanks. But i am new to this and confused. i have used it like `find /path -type f -exec sed -i 's/where acc_id = ".$_SESSION['acc_id']);/");/g' {} \;`. It is not working. Can you please tell a proper way to do this? – Arun Purohit Nov 25 '15 at 12:21
  • Does `[\'acc_id\']` work? – Walter A Nov 25 '15 at 22:25

0 Answers0