svn: r10112

original commit: 465440822932dcd6326f821c4048aa03d3b09d70
This commit is contained in:
Eli Barzilay 2008-06-03 18:47:14 +00:00
parent d9cc957624
commit 2f36758ca3

View File

@ -1,5 +1,37 @@
#!/bin/bash
here="$(dirname "$(readlink -f "$0")")"
# {{{ here
# Make this PATH-independent
saveP="$PATH"
PATH="/usr/bin:/bin"
# imitate possibly-missing readlink
readlink() {
ls -l -- "$1" | sed -e "s/^.* -> //"
}
# Remember current directory
saveD=`pwd`
# Find absolute path to this script,
# resolving symbolic references to the end
# (changes the current directory):
D=`dirname "$0"`
F=`basename "$0"`
cd "$D"
while test -h "$F"; do
P=`readlink "$F"`
D=`dirname "$P"`
F=`basename "$P"`
cd "$D"
done
D=`pwd`
# Restore current directory
cd "$saveD"
here="$D"
PATH="$saveP"
# }}} here
exec "$here/../../../bin/mzscheme" "$here/main.ss" "$@"