Creating brash one liners that work as expected take trial and error. Once I get it working, that command is the last in my history, and I can recall it !!:p
.
This does not work:
!!:p >> mycommands.txt
What is the correct version of the command I'm trying to execute above? Without leaving the command line, and especially without having to hit the up arrow to then copy and paste that into a new file, how do I redirect !!:p
to a file?
!!:p
could do that but you can usefc
: unix.stackexchange.com/a/38075/414186