http://www.perlmonks.org?node_id=998970


in reply to One-liner to fix LaTeX quotation marks

cat file.txt | perl -pe 's/\"[^[\'\`]/"`/g'
but something is wrong, the shell wants more input.
This is because you can't really escape anything in single quotes in UNIX shell. You have to write the command like this:
$ perl -pe "s/\"([^'\`])/'\$1/g" This is "an example", but "`this not"'. This is 'an example', but "`this not"'.
Sorry if my advice was wrong.