Reputation: 385
I tried the following but not adding ''
this example
I want to replace FILENAME_LOGIN
to 'login.php'
Tried this:
grep -r "login.php" -l | tr '\n' ' ' | xargs sed -i 's/"login.php"/'login.php'/g'
However, it gives me login.php
not 'login.php'
Thanks
Upvotes: 0
Views: 63
Reputation: 203129
find ./ -type f -exec sed -i -e 's/FILENAME_LOGIN/'\''login.php'\''/g' {} \;
Upvotes: 0
Reputation: 385
I figured it out:
find ./ -type f -exec sed -i -e 's/FILENAME_LOGIN/'login.php'/g' {} \;
Upvotes: 0
Reputation: 3153
You only need sed
for this:
sed -i -e "s/FILENAME_LOGIN/'login.php'/g" /your/file
Upvotes: 1