#!/bin/sh
binpath=$(dirname "$(readlink -f $0)")
appname=$(basename $0 .sh)
export LD_LIBRARY_PATH="$binpath/bin":"$binpath/bin/plugins":$LD_LIBRARY_PATH
cd "$binpath/bin"
./$appname $*

#!/bin/sh
binpath=$(dirname "$(readlink -f "$0")")
appname=$(basename "$0" .sh)
export LD_LIBRARY_PATH="$binpath/bin":"$binpath/bin/plugins":$LD_LIBRARY_PATH
cd "$binpath/bin"
./$appname $*

Fix handling paths with white-spaces
Fix handling paths with white-spaces

* when starting the script by double-clicking it, the variables $appname
* and $binpath were empty. The $0 argument needs extra quote signs.
