2 ms·
It depends on the caller not on the language of the program being called. If you execute something via $PATH then most shells will only pass the command you typ
by account42 2y ago
It depends on the caller not on the language of the program being called. If you execute something via $PATH then most shells will only pass the command you typed and not the full path. Similarly, when you use a relative path like ./command then usually your argv0 will be that relative path and not the full path to the executable. So in practice argv may or may not be a full path and if it does not contain a slash then it generally isn't even a relative path (well, not relative to the current directory anyway).
For the help case in gp I think it makes sens for programs to always strip away anything up to including the last slash from argv0.