Reputation: 4716
My question is simple:
$ echo "Hello!"
sh: !": event not found
What is !
in this case? I then tried echo "Match\!"
, but that resolves to Match\!
. How do I have to write the statement?
Upvotes: 8
Views: 2761
Reputation: 246807
You can turn off history expansion with set +H
and re-enable it with set -H
Upvotes: 3
Reputation: 785128
You can use single quotes:
echo 'Hello!'
Hello!
Otherwise in double quotes shell attempts to expand !
to an event from the history..
Upvotes: 13