[Haskell-cafe] How to get a file path to the program invoked?

Brandon Allbery allbery.b at gmail.com
Thu Dec 15 23:55:54 CET 2011


On Thu, Dec 15, 2011 at 09:48, Peter Wortmann <scpmw at leeds.ac.uk> wrote:

> path portably from C [1]. Using argv[0] just gave me the path of the GHC
> wrapper script, for example - as it uses exec without "-a".
>

Note that "exec -a" is a bash-ism and not portable to POSIX shells (ash on
*BSD, dash on Debian/Ubuntu, etc.) or traditional /bin/sh as still shipped
with some commercial Unixes.

-- 
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111215/03a2b664/attachment.htm>


More information about the Haskell-Cafe mailing list