Running
set +H
will turn off the offending (history expansion) functionality in its entirety. Putting this in your ~/.bashrc
is a common practice.
Alternately, you can modify the histchars
variable to change the characters used to trigger history expansion (by default, !
), quick substitution (by default, ^
) and comments (by default, #
).
As yet another option, using single- rather than double-quotes avoids triggering the shell feature in question.