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 -  How to extract emails from a PST file using Bash on Centos

Leave a Reply