If you are running using the PATH environment variable, you could try:
$ which abc
or
$ whereis abc
If there is a symbolic link for the command and you want to know the *"real"* target, you can use something like:
$ readlink /opt/corp/xyz/abc
I do not have access to an HPUX system in front of me right now, but this should work:
$ ls -l /opt/local/bin/wish
lrwxr-xr-x 1 root admin 22 Feb 3 21:56 /opt/local/bin/wish@ -> /opt/local/bin/wish8.5
$ readlink /opt/local/bin/wish
/opt/local/bin/wish8.5
If the command is based on an alias, the following will reveal the alias definition.
$ alias abc
depending on how your system is configured, the above commands should provide answers to multiple variations of your question.
in Perl:
$running_script = $0;
from Python, see SO http://stackoverflow.com/questions/606561/how-to-get-filename-of-the-main-module-in-python