Page 1 of 1

vrep.sh doesn't allow launching via absolute path or symlink

Posted: 24 Mar 2015, 17:27
by fferri
Since vrep.sh doesn't allow launching it via absolute path (e.g. /opt/vrep/vrep.sh) nor via a symlink to it (e.g. /usr/local/bin/vrep pointing to /opt/vrep/vrep.sh), I modified it.

While editing it, I also added quotes where needed, so that in case the path to V-REP contains spaces, nothing breaks.

Here it is:

Code: Select all

#!/bin/sh

thisscript="$0"
while [ -L "$thisscript" ]; do
        thisscript="`readlink "$thisscript"`"
done

dirname=`dirname "$thisscript"`
if [ $dirname = "." ]; then
        dirname="$PWD"
fi

appname="`basename "$thisscript" | sed 's,\.sh$,,'`"

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$dirname"
export LD_LIBRARY_PATH
"$dirname/$appname" "$@"

Re: vrep.sh doesn't allow launching via absolute path or sym

Posted: 25 Mar 2015, 14:36
by coppelia
Hello,

thanks for the modifications, we'll include them for next release (3.2.1).

Cheers