[cs631apue] Get path to currently running executable

Keyur Ved kved at stevens.edu
Tue Dec 11 11:45:46 EST 2018


Hi all,

I had one question about how to set the SHELL environment variable
correctly. I found a thread that says to use /proc/self/exe to get the path
of the currently running executable since it's a link to the currently
running executable. Is that a portable way to get the path?

The only other way I can think of is to resolve argv[0], but that isn't
always the correct executable name (as we saw in class).

Thanks,
Keyur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20181211/80a707c5/attachment.html>


More information about the cs631apue mailing list