How to Escape '$ in indented string

I have a single quote directly followed by a dollar sign and I wish to escape both.

typeset -g SOME_VALUE='${bash-variable}'

If I try to escape the dollar sign with two single quotes it thinks I’m trying to escape the two single quotes.
Underscores added for clarification

typeset -g SOME_VALUE='''_${bash-variable}'

instead of

typeset -g SOME_VALUE='_''${bash-variable}'
1 Like

''\ escapes the character following it, so to get '$ you can write ''\'''\$. or, as other folks have done, slightly misuse antiquotation and write ${"'$"} instead