Hi,
Yep, that was not necessary. Here is a version, which I hope works correctly:
That's looking great, I just added a missing " " around the last $FILE.
FILE="${BASH_SOURCE[0]}" while [ -h "$FILE" ] ; do SOURCE="$(readlink "$FILE")" FILE="$( cd -P "$(dirname "$FILE")" && \ cd -P "$(dirname "$SOURCE")" && pwd )/$(basename "$SOURCE")" done BASEX_DIR="$( cd -P "$(dirname "$FILE")" && pwd )"
Of course, in the remainder of the script, $PWD has to be replaced by BASEX_DIR... or, to make things slightly more readable, BASEX_DIR could be the actual dir with the main jar, not the bin dir. While I was at it, I also fixed the "list all jars in lib/" part to work properly if the path basex lives in contains a ' ' (which would previously have been replaced by a ':'). You can find the result attached. It works here, but should be tested on some different setups :D
Kind regards, Ralf
basex-talk@mailman.uni-konstanz.de