There is a really handy parameter/variable expansion feature in BASH that I don't see for history. I've checked man pages for history and for BASH itself. Not there ...maybe I missed it.
Example: I use ssh a lot and I can do this with variable expansion.
host=foo@bar.org
Suppose I wanted to extract just the host -- rather, remove the username.
hostonly=${host##*@}
If I
echo $hostonly
I get:
bar.org
My question: Is it possible to do this with commandline history?
eg.,
Command 1:
ssh foo@bar.org
Command 2:
ssh gary@!!:##*@
This doesn't work, of course, but can someone confirm whether or not this type of pattern matching is available?
Thanks!
Bubnoff