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