Hacker News new | past | comments | ask | show | jobs | submit login

And it supports regex replace as well

    $ echo foobar !#:1:s/foo/bar
    echo foobar barbar
    foobar barbar



slightly shorter !#$

and i always use ctrl-alt-e to expand and check even if i dont want to edit


I 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: