|
@@ -3,10 +3,8 @@
|
|
|
# also should not be passed any arguments, since we need original $*
|
|
|
|
|
|
# resolve links - $0 may be a softlink
|
|
|
-bin=`dirname "$0"`
|
|
|
-script=`basename "$0"`
|
|
|
-bin=`cd "$bin"; pwd`
|
|
|
-this="$bin/$script"
|
|
|
+
|
|
|
+this="$0"
|
|
|
while [ -h "$this" ]; do
|
|
|
ls=`ls -ld "$this"`
|
|
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
@@ -17,6 +15,12 @@ while [ -h "$this" ]; do
|
|
|
fi
|
|
|
done
|
|
|
|
|
|
+# convert relative path to absolute path
|
|
|
+bin=`dirname "$this"`
|
|
|
+script=`basename "$this"`
|
|
|
+bin=`cd "$bin"; pwd`
|
|
|
+this="$bin/$script"
|
|
|
+
|
|
|
# the root of the Hadoop installation
|
|
|
export HADOOP_HOME=`dirname "$this"`/..
|
|
|
|