How to escape the bang (!) character in Linux bash shell?

bash, linux, shell

Solution

Try this:

 echo 'Text text text!'

or

 echo "Text text text"'!'

or

 echo -e "Text text text\x21"

Problem

I cannot for the life of me figure out how to escape the `!` character in Bash. For example, I want to print this: `Text text text!` I've tried this: ``` echo "Text text text\!" ``` but that prints this instead: `Text text text\!` (with an extra backslash). How can I do this?

Original source

Related problems