fawzib
fawzib

Reputation: 842

Special characters to mass replace string using sed command

I want to replace a function with another function inside all php files. Below is how far i reached:

find ./ -type f -name "*.php" -exec sed -i s/check_perm(\'venA\')/check_perm(\'venA:venB\')/` {} \;

But gave me an error:

sed: -e expression #1, char 1: unknown command: `.'

I want to replace check_perm('venA') with check_perm('venA:venB')

Upvotes: 0

Views: 67

Answers (1)

clement
clement

Reputation: 3375

The following worked for me

find ./ -type f -name "*.php" -exec sed -i "s/check_perm('venA')/check_perm('venA:venB')/g" {} \;

tested with GNU sed version 4.2.1

Upvotes: 2

Related Questions