Take the 2-minute tour ×  I hope the title of this question
isn't too confusing.  What I want to do is send myself an e-mail
when a specified command has finished running in the shell. For
this purpose, I wrote a simple script that takes an argument and
sends me an e-mail with the argument as the messages text. The
idea is to be able to execute a command that I know will take a
long time in the following manner:  ./commandThatTakesALongTime;
./emailingScript <some argument>  The obvious answer here is to
just write the name of the command again, and pass it in as a
string but often I'll have commands with lots of arguments, and
so I'd prefer it to automatically grab what was executed.  I've
tried using various combinations of !!:p, but that doesn't
appear to be working. Any tips?  ETA: I'm looking for something
that I can pass as which will basically just print
"./commandThatTakesALongTime"--does such a thing exist? The
reason I'm doing it this way is because I need my environment to
be preserved as it is aft