In my terminal (bash 3), I sometimes use the quick substitution
Quick substitution. Repeat the last command, replacing string1 with string2. Equivalent to `!!:s/string1/string2/` (see Modifiers below).
$ echo aa aa aa aa $ ^aa^bb^ echo bb aa bb aa
Which is really handy in some cases.
However, I found out that omitting the last
^ also works, i.e.
$ echo aa aa aa aa $ ^aa^bb echo bb aa bb aa
My question is: what is the consequence of omitting the closing
^? Can I safely leave it out or are there any caveats?