On Thu, 18 Feb 1999 02:00:19 EST, Justin Vallon said:
You can execl("/bin/ls", "ha-ha", "-l",
0), though it might give ls a
headache if it doesn't know its name. Mostly, $0 will be either a
relative or absolute path to yourself, but it depends on the shell/execer.
And the shell itself is often on the receiving end of argv[0] games.
By convention, /bin/login sets argv[0] to be '-' followed by the shell name,
and this is how your login shell knows that it's a login shell.
Don't forget that argv[0] may be the name of a symlink in some
directory other than the one we're in - I've seen more than one Unixoid
where /usr/ucb/newaliases is a symlink to /usr/lib/sendmail.
/Valdis