I wanted to test something in shell and I've typed echo !! instead of typical echo foo. I didn't get the !! for output. Instead, (and very unexpectedly!) it produced the output of my previous command issued for Bash.I tried to google the phrases bash !! (and permutations like bash +!!), but I couldn't find any reference for this feature. Can someone tell me something about the exclamation marks' stuff and Bash? At least how to find extra info?I use Bash 4.2.45 on Linux Mint 16 64 bit.
Bizzarre behaviour of echo !! under interactive Bash. Is this a feature?
bash
From man bash, section HISTORY EXPANSION:Event DesignatorsAn event designator is a reference to a command line entry in the history list.  Unless the reference is absolute, events are relative to the current         position in the history list.[...]!! - Refer to the previous command.  This is a synonym for `!-1'You can turn history expansion off with set +H if you don't like it. I generally prefer to use readline to do history lookups instead.