At least in bash, just run
^help^^
Which will rerun the previous command but substitute "help" with "" (nothing). ^help^^
Which will rerun the previous command but substitute "help" with "" (nothing).So thank you. That changes everything!
^help^
does the same thing. The bash manual says ^string1^string2^ is equivalent to !!:s/string1/string2/
where / can be any delimiter, and the "final delimiter is optional if it is the last character of the event line." So, not so surprising that the third ^ is optional too.TIL: In either of these forms, if string1 is empty, it is set to the last string1, or, "if no previous history substitutions took place, the last string in a !?string[?] search." E.g.
$ echo foofoo
foofoo
$ ^foo^
echo foo
foo
$ ^^bar
echo bar
bar> !!:s/string1/string2/
I didn't know about this syntax either.
I thought I knew a bit of bash and it turns out I'm a novice after all this time. How fun.