diff --git a/bin/beeline b/bin/beeline index 3fcb6df34339..cfa88b362c73 100755 --- a/bin/beeline +++ b/bin/beeline @@ -24,7 +24,7 @@ set -o posix # Figure out where Spark is installed -FWDIR="$(cd "`dirname "$0"`"/..; pwd)" +FWDIR="$(cd $(dirname $(readlink -f "$0"))/..; pwd)" CLASS="org.apache.hive.beeline.BeeLine" exec "$FWDIR/bin/spark-class" $CLASS "$@" diff --git a/bin/pyspark b/bin/pyspark index 5142411e3697..d650b8d502a3 100755 --- a/bin/pyspark +++ b/bin/pyspark @@ -18,7 +18,7 @@ # # Figure out where Spark is installed -FWDIR="$(cd "`dirname "$0"`"/..; pwd)" +FWDIR="$(cd $(dirname $(readlink -f "$0"))/..; pwd)" # Export this as SPARK_HOME export SPARK_HOME="$FWDIR" diff --git a/bin/run-example b/bin/run-example index 34dd71c71880..130c439e8c7d 100755 --- a/bin/run-example +++ b/bin/run-example @@ -19,7 +19,7 @@ SCALA_VERSION=2.10 -FWDIR="$(cd "`dirname "$0"`"/..; pwd)" +FWDIR="$(cd $(dirname $(readlink -f "$0"))/..; pwd)" export SPARK_HOME="$FWDIR" EXAMPLES_DIR="$FWDIR"/examples diff --git a/bin/spark-class b/bin/spark-class index 5f5f9ea74888..bc1dd4e72f57 100755 --- a/bin/spark-class +++ b/bin/spark-class @@ -27,7 +27,7 @@ esac SCALA_VERSION=2.10 # Figure out where Spark is installed -FWDIR="$(cd "`dirname "$0"`"/..; pwd)" +FWDIR="$(cd $(dirname $(readlink -f "$0"))/..; pwd)" # Export this as SPARK_HOME export SPARK_HOME="$FWDIR" diff --git a/bin/spark-shell b/bin/spark-shell index 4a0670fc6c8a..ad7e12915462 100755 --- a/bin/spark-shell +++ b/bin/spark-shell @@ -29,7 +29,7 @@ esac set -o posix ## Global script variables -FWDIR="$(cd "`dirname "$0"`"/..; pwd)" +FWDIR="$(cd $(dirname $(readlink -f "$0"))/..; pwd)" function usage() { echo "Usage: ./bin/spark-shell [options]" diff --git a/bin/spark-sql b/bin/spark-sql index ae096530cad0..1158e8caa348 100755 --- a/bin/spark-sql +++ b/bin/spark-sql @@ -27,7 +27,7 @@ CLASS="org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver" CLASS_NOT_FOUND_EXIT_STATUS=1 # Figure out where Spark is installed -FWDIR="$(cd "`dirname "$0"`"/..; pwd)" +FWDIR="$(cd $(dirname $(readlink -f "$0"))/..; pwd)" function usage { echo "Usage: ./bin/spark-sql [options] [cli option]" diff --git a/bin/spark-submit b/bin/spark-submit index c557311b4b20..06c5e23f8edc 100755 --- a/bin/spark-submit +++ b/bin/spark-submit @@ -19,7 +19,7 @@ # NOTE: Any changes in this file must be reflected in SparkSubmitDriverBootstrapper.scala! -export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)" +export SPARK_HOME="$(cd $(dirname $(readlink -f "$0"))/..; pwd)" ORIG_ARGS=("$@") while (($#)); do