#! /bin/sh proc makeAbsolute { match $1 { with /* # already absolute, return it echo $1 with * # relative, prepend $2 made absolute echo $[makeAbsolute $2 $PWD]/"$1" | sed 's,/\.$,,' } } setglobal me = $[which $0] # Search $PATH if necessary if test -L $me { # Try readlink(1) setglobal readlink = $[type readlink !2 >/dev/null] || setglobal readlink = '' if test -n $readlink { # We have readlink(1), so we can use it. Assuming GNU readlink (for -f). setglobal me = $[readlink -nf $me] } else { # No readlink(1), so let's try ls -l setglobal me = $[ls -l $me | sed 's/^.*-> //] setglobal base = $[dirname $me] setglobal me = $[makeAbsolute $me $base] } } setglobal bindir = $[dirname $me] setglobal libdir = $[cd "$bindir/../lib" ; pwd] setglobal LD_LIBRARY_PATH = "$libdir:$libdir/qtcreator$(LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH)" export LD_LIBRARY_PATH exec "$bindir/qtcreator" $(1+"$@")