[m-users.] Path independence?
Julien Fischer
jfischer at opturion.com
Mon Jul 29 12:09:24 AEST 2013
Hi Peter,
On Mon, 29 Jul 2013, Peter Wang wrote:
> On Mon, 29 Jul 2013 11:35:42 +1000 (EST), Julien Fischer <jfischer at opturion.com> wrote:
>>
>> On Sat, 27 Jul 2013, Peter Wang wrote:
>>>
>>> We can prepend $PWD if necessary (falling back to `pwd`).
>>> Would that do it?
>>
>> That would just give you the directory in which invoke mmc, not the
>> directory in which mmc resides.
>
> Er, I meant something like this:
>
> dir=${0%/*}
> case "$dir" in
> /*) ;;
> *) dir="$PWD/$dir" ;;
> esac
Ah, that's what you meant by "if necessary" ;-) The above should
certainly be ok on Linux and Mac OS X. I'm not sure the various
Windows variants. (I don't have a Windows machine about to check
just at the moment.)
Cheers,
Julien
More information about the users
mailing list