Using Ubuntu 18, with the bash shell
The "$" character is not behaving as it should for end of line match in sed.
When I try:
sed '/^>/ s/$/_new/g' <file>
this should result in
>sometext_new
but I am getting
_newetext
This may be related to this question: Error while matching End of line with $ in Sed command but that was using csh and had variable assignments which I do not have.
I have tried turning off shell expansion set -f ; but this did not help
I have tried sed '/^>/ s/"$"/_new/g' <file>
this turned $ into a literal character, resulting in no substitution
I would appreciate any help in restoring the previous behaviour of $ as end of line character in sed