GHC 6.8.1 on Mac OS X 10.5 (Leopard)
Simon Marlow
simonmarhaskell at gmail.com
Mon Nov 19 05:40:33 EST 2007
Christian Maeder wrote:
> Alfonso Acosta wrote:
>> On Nov 19, 2007 10:51 AM, Alfonso Acosta <alfonso.acosta at gmail.com> wrote:
>>> Well, you can always combine the first argument of the script ($0) for
>>> absolute paths and combine it with with pwd for relative ones.
>> I meant _use_ the first argument of the script ($0) for absolute paths
>> and combine it with pwd for relative ones.
>
> #!/bin/sh
> reldir=`dirname $0`
> topdir=`(cd $reldir; pwd)`
There's no guarantee that $0 holds anything reasonable: you can set $0 to
whatever you like when calling exec*().
Cheers,
Simon
More information about the Glasgow-haskell-users
mailing list