Bash – How to echo an exclamation mark in your bash scripts

By | April 15, 2015

Im a guy who likes SOLUTIONS to issues, not neccesarily wanting or needing to know the reasons why something happens…. so heres another one…

Bash – How to echo an exclamation mark

So you would think something simple like this :

echo “abcde!abcde”

BUT

echo “abcde!abcde”
-bash: !abcde”: event not found

Damn… ok the solution !!!

set +H
echo “abcde!abcde”
abcde!abcde

Job done. Hope that saved you some time!

Check out -  Using the built-in Bash Special Variables

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.