I'm trying to append to the end of a file, using the style from this answer but I get the error:
sed: -e expression #1, char 16: unterminated address regex
sed -i -e '\$ahaha_value=26' example.txt
With single quotes you don't need to escape
$ sign since it's not going to be evaluated by shell.
sed -e '$a...'
sed -e "\$a..."