I have a file and am reading it line by line. Some lines have dollar signs in them, and I would like to remove them using sed. So for instance,
echo $line
returns
{On the image of {$p$}-adic regulators},
On the other hand,
echo $line | sed 's/\$//g'
correctly returns
{On the image of {p}-adic regulators},
but
title=`echo $line | sed 's/\$//g'`; echo $title
returns
{On the image of {$p$}-adic regulators},
You need to escape the backslash in your sed command when using it within backticks: