4 ms·
And it supports regex replace as well $ echo foobar !#:1:s/foo/bar echo foobar barbar foobar barbar
by kesor 7y ago
And it supports regex replace as well
$ echo foobar !#:1:s/foo/bar
echo foobar barbar
foobar barbar
- garryq 7y agoslightly shorter !#$ and i always use ctrl-alt-e to expand and check even if i dont want to edit
- Anthony-G 7y agoI didn't know about the Ctrl-Alt-E so that's useful to know when using a new computer or a shared user account. I have `shopt -s histverify` set in my own bashrc. It's a useful sanity check when using history expansion. After typing the command, press Enter to see what it expands to, verify that it's what I intend and hit Enter a second time to confirm the comand.