I am trying to write a Perl one-liner in a Bash script to change math-mode delimiters in a LaTeX file from "\[" and "\]" to dollar signs.
That is, I want to change \[a + b = c\] to $a + b = c$.
Unfortunately, I can't figure out how to escape the dollar sign in Perl correctly.
The closest I've gotten is to use perl -pi -e 's/\[/\$/gm' file.tex. However, this inserts \$ into the file instead of a single dollar sign.
$without backslash?$. Results in an error:Final $ should be \$ or $name at -e line 1, within string