
dokondr> On the contrary, standard shell variable $0 - contains a full dokondr> path to the program location in the directory structure, no dokondr> matter from what directory the program was called. I don't think the comparison makes sense, as shell script invocation and executable run are very different mechanisms. Whenever you invoke a shell script, what really happens is that a program in your path (sh, bash ...) gets started with an argument that is the path to the script to load (your script actually). In this situation, you understand that it is easy to provide the path to the script (the $0) : it is just the file that the interpreter is loading. I don't know if it is possible at all to get this information in the context of binary execution. And I'm not sure it is a good practice anyway :) -- Paul