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

Report crashes, strange behaviour, or apparent bugs
Post Reply
fferri
Posts: 1217
Joined: 09 Sep 2013, 19:28

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

Post 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" "$@"

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

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

Post by coppelia »

Hello,

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

Cheers

Post Reply