Thats not quite right, this is FPC specific behavior and has nothing to do with Linux.
On Linux usually the first argument (argv[0] in c, or $0 in bash) is the first argument given to the exec* call. In Bash this is exactly the path used in the command. The FPC however always compiles the code in a way that it will always return the absolute path (don't ask me why and how, I only observed this behavior from the outside). Example:
test.c:
#include<stdio.h>
int main(int argc, char const * const *argv) {
return 0;
}
test.sh:
test.pas:
program Test;
{$Mode ObjFPC}{$H+}
begin
WriteLn(ParamStr(0));
end.
Outputs:
user@ubuntu:~$ test/ctest
test/ctest
user@ubuntu:~$ test/pastest
/home/user/test/pastest
user@ubuntu:~$ bash test/test.sh
test/test.sh
user@ubuntu:~$ cd test
user@ubuntu:~/test$ ./ctest
./ctest
user@ubuntu:~/test$ ./pastest
/home/user/test/pastest
user@ubuntu:~/test$ bash ./test.sh
./test.sh
For C cli applications it is common pratice for help pages to simply print argv[0] [options] as first line, something the FPC also does with ParamStr(0). The thing is that ParamStr behaves differently then most other languages.
It should be noted that this means that information is actually lost, as you can see here:
test@ubuntu:~$ test/../test/../test/ctest
test/../test/../test/ctest
The complete path information of the call is stored, even the redundant one. I don't know of any possibility to access this information from fpc programs