On 06/10/2012 08:34 PM, Piotr Minkina wrote:
> Hmmm, You're right... readlink may be not available in MacOS.
>
A colleague of mine found this which should work fine on most Unix systems:
---
if [ -L "$0" ]; then
# Ugly but should work on most systems.
scriptFile=`ls -l "$0" | awk '{print $(NF)}'`
else
scriptFile="$0"
fi
dist=`dirname "$scriptFile"`
---
> Regards
> Piotr Minkina
>
> W dniu 10.06.2012 18:56, Hussein Shafie pisze:
>> On 06/10/2012 11:15 AM, Piotr Minkina wrote:
>>>
>>> I think in file xxe-perso-5_2_1/bin/xxe on line 4 instead of:
>>>
>>> dist=`dirname $0`
>>>
>>> should be:
>>>
>>> dist=`readlink -f $0 | xargs dirname`.
>>>
>>> In first case symlinks to xxe-perso-5_2_1/bin/xxe are not supported ---
>>> message "xxe.jar not found" is returned. In second case all works fine.
>>>
>>
>> Thanks for the tip. However, our very simple xxe Bourne shell script is
>> not meant to be specific to Linux and and on other Unix-like system
>> (e.g. Mac OS X), I'm not sure that you'll find the readlink and xargs
>> commands.
>>
>>
>>
>> ---
>> PS: Despite the fact that I use Unix systems since 1985 (my first Unix
>> machine was a ``workstation'' called a Rigde), I never liked the Unix
>> habit to copy (or symlink) application files to /usr/bin/, /usr/lib/,
>> etc. I'm much prefer applications to be self-contained (like this is the
>> case on Mac OS X) even if this implies having a gigantic PATH
>> environment variable.
>>
>>
>>
>>
>
> --
> XMLmind XML Editor Support List
> [email protected]
> http://www.xmlmind.com/mailman/listinfo/xmleditor-support
>
>
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support