Escape single and double quote using sed. geed, find, xargs

escaping, regex, replace, sed

Solution

take a look this:

kent$  cat file
''''''
""""""

kent$  sed 's/\x27/single /g;s/\x22/double /g' file
single single single single single single 
double double double double double double 

so , change your cmd into:

find ./ -type f | xargs gsed -i -r 's/[$][A-Za-z_\x22\x27]/testing'

note I didn't check if your find/xargs part ok, just for the single/double quote part.

Problem

I have a command similiar this this one: ``` find ./ -type f | xargs gsed -i -r 's/[$][A-Za-z_\'"]/testing ``` I would like put this command to work. Unfortunally the single and double quotes breaks the command. How can I escape this strings and put this command to work? This question isnt the same as this one because I have a single quote inside the [. But if a littler modification solves the problem works I would like to know. I had tried several different ways using @, #, \, but no success yet.

Original source

Related problems