[Techtalk] bash and '!?'

Miriam English mim at miriam-english.org
Fri Sep 18 15:25:29 UTC 2015


Does anybody have any idea why this happens?

I illustrate using the echo command here, but the same thing happens 
with other commands, so it's something about bash, not any particular 
command. I precede my commands with "$" to distinguish them from results.


$ echo "what?"
what?
$ echo "what!"
what!
$ echo "what?!"
what?!
$ echo "what! ?"
what! ?
$ echo "what!?"
echo "whatecho "what? !"
 >

The "!?" combination seems to insert the previous command in the command 
history into the current command, deleting the rest of the current line, 
but I'm not sure of this because sometimes other weird things happen.

Can anybody explain it? Is it a bug, or is it a sensible thing?

Cheers,

	- Miriam

-- 
If you don't have any failures then you're not trying hard enough.
  - Dr. Charles Elachi, director of NASA's Jet Propulsion Laboratory
-----
Website: http://miriam-english.org
Blogs:   http://miriam-e.dreamwidth.org
          http://miriam-e.livejournal.com




More information about the Techtalk mailing list