How do I escape the single qoutes in my bash expression find . | xargs perl -pi -e 's/'conflicts' => '',//g'
? I want to replace the string 'conflicts' => '', in my files?
FatalError and gpojd have both given good solutions. I'll round this out with one other option:
find . | xargs perl -pi -e 's/\x27conflicts\x27 => \x27\x27,//g'
This works because in Perl, the s/.../.../
notation supports backslash-escapes. \x27
is a hexadecimal escape ('
being U+0027).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With