I am trying to replace all dollar signs in a string with sed. However, not only the dollar sign is replaced, but the entire subsequent line.
$ echo "abc $def ghi" | sed 's/$//g'
$ abc ghi
If at least one number matches the dollar sign, then only the part to the first non-number is replaced:
$ echo "abc $123def ghi" | sed 's/$//g'
$ abc def ghi
What's happening?
source
share