Index: bin/hbase-daemons.sh =================================================================== --- bin/hbase-daemons.sh (revision 979877) +++ bin/hbase-daemons.sh (working copy) @@ -32,7 +32,7 @@ exit 1 fi -bin=`dirname "$0"` +bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin">/dev/null; pwd` . $bin/hbase-config.sh Index: bin/start-hbase.sh =================================================================== --- bin/start-hbase.sh (revision 979877) +++ bin/start-hbase.sh (working copy) @@ -26,7 +26,7 @@ # Run this on master node. usage="Usage: start-hbase.sh" -bin=`dirname "$0"` +bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin">/dev/null; pwd` . "$bin"/hbase-config.sh Index: bin/hbase-daemon.sh =================================================================== --- bin/hbase-daemon.sh (revision 979877) +++ bin/hbase-daemon.sh (working copy) @@ -42,7 +42,7 @@ exit 1 fi -bin=`dirname "$0"` +bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin">/dev/null; pwd` . "$bin"/hbase-config.sh Index: bin/hbase-config.sh =================================================================== --- bin/hbase-config.sh (revision 979877) +++ bin/hbase-config.sh (working copy) @@ -24,9 +24,9 @@ # also should not be passed any arguments, since we need original $* # Modelled after $HADOOP_HOME/bin/hadoop-env.sh. -# resolve links - $0 may be a softlink +# resolve links - "${BASH_SOURCE-$0}" may be a softlink -this="$0" +this="${BASH_SOURCE-$0}" while [ -h "$this" ]; do ls=`ls -ld "$this"` link=`expr "$ls" : '.*-> \(.*\)$'` Index: bin/local-regionservers.sh =================================================================== --- bin/local-regionservers.sh (revision 979877) +++ bin/local-regionservers.sh (working copy) @@ -3,11 +3,11 @@ # run it from hbase-dir/ just like 'bin/hbase' # Supports up to 100 regionservers (limitation = overlapping ports) -bin=`dirname "$0"` +bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin" >/dev/null && pwd` if [ $# -lt 2 ]; then - S=`basename $0` + S=`basename "${BASH_SOURCE-$0}"` echo "Usage: $S [start|stop] offset(s)" echo "" echo " e.g. $S start 1 2" Index: bin/local-master-backup.sh =================================================================== --- bin/local-master-backup.sh (revision 979877) +++ bin/local-master-backup.sh (working copy) @@ -3,11 +3,11 @@ # run it from hbase-dir/ just like 'bin/hbase' # Supports up to 10 masters (limitation = overlapping ports) -bin=`dirname "$0"` +bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin" >/dev/null && pwd` if [ $# -lt 2 ]; then - S=`basename $0` + S=`basename "${BASH_SOURCE-$0}"` echo "Usage: $S [start|stop] offset(s)" echo "" echo " e.g. $S start 1" Index: bin/zookeepers.sh =================================================================== --- bin/zookeepers.sh (revision 979877) +++ bin/zookeepers.sh (working copy) @@ -38,7 +38,7 @@ exit 1 fi -bin=`dirname "$0"` +bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin">/dev/null; pwd` . "$bin"/hbase-config.sh Index: bin/regionservers.sh =================================================================== --- bin/regionservers.sh (revision 979877) +++ bin/regionservers.sh (working copy) @@ -41,7 +41,7 @@ exit 1 fi -bin=`dirname "$0"` +bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin">/dev/null; pwd` . "$bin"/hbase-config.sh Index: bin/stop-hbase.sh =================================================================== --- bin/stop-hbase.sh (revision 979877) +++ bin/stop-hbase.sh (working copy) @@ -24,7 +24,7 @@ # Stop hadoop hbase daemons. Run this on master node. -bin=`dirname "$0"` +bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin">/dev/null; pwd` . "$bin"/hbase-config.sh