Teddybugs
Teddybugs

Reputation: 1244

linux : sed -e expression error

Im trying to use sed to recursively replace mysql string, like this

find /var/www/html -type f -exec \
sed -i 'mysql_real_escape_string(/$conn->qStr(/g' {} +

the objective

find: mysql_real_escape_string(
replace to: $conn->qStr(

but it gives me error:

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

any help would be great. thanks

Upvotes: 2

Views: 149

Answers (1)

zhenguoli
zhenguoli

Reputation: 2308

You should supply the s command:

find /var/www/html -type f -exec \
sed -i 's/mysql_real_escape_string(/$conn->qStr(/g' {} +

Upvotes: 3

Related Questions