I was once shown a shortcut that I can't recall/ find. After pinging an ip, then attempting to ssh into it - the ip was saved into to a variable automagically.
Something like:
ping 10.1.23.4
...
ssh root@$!
and the ip was replicated in the second line replacing $! without further ado.
So does this ring a bell as to what the actual syntax is? Or was this some special configuration? I believe this was running centos if that is related. tia
ssh root@!$
... See 'history expansion' inman bash
for the details. – jasonwryan Aug 13 '13 at 03:59