From 6b2a067bde440c749d1dae3499f31b162adde0e9 Mon Sep 17 00:00:00 2001 From: "hancheol.cho" Date: Wed, 12 Apr 2017 13:09:11 +0900 Subject: [PATCH] Can run hdfs-shell.sh and hdfs-shell-daemon.sh scripts from anywhere. --- deploy/bin/hdfs-shell-daemon.sh | 4 +++- deploy/bin/hdfs-shell.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy/bin/hdfs-shell-daemon.sh b/deploy/bin/hdfs-shell-daemon.sh index 83254cc..7b172d5 100644 --- a/deploy/bin/hdfs-shell-daemon.sh +++ b/deploy/bin/hdfs-shell-daemon.sh @@ -1,2 +1,4 @@ #!/bin/bash -java -Ddaemon=true -Xms200m -Xmx400m -cp ./lib/*:/etc/hadoop/conf com.avast.server.hdfsshell.MainApp "$@" \ No newline at end of file +CWD=$(cd $(dirname $0); pwd) + +java -Ddaemon=true -Xms200m -Xmx400m -cp ${CWD}/lib/*:/etc/hadoop/conf com.avast.server.hdfsshell.MainApp "$@" diff --git a/deploy/bin/hdfs-shell.sh b/deploy/bin/hdfs-shell.sh index f776bf8..15303fe 100644 --- a/deploy/bin/hdfs-shell.sh +++ b/deploy/bin/hdfs-shell.sh @@ -1,2 +1,4 @@ #!/bin/bash -java -Xms200m -Xmx400m -cp ./lib/*:/etc/hadoop/conf com.avast.server.hdfsshell.MainApp "$@" \ No newline at end of file +CWD=$(cd $(dirname $0); pwd) + +java -Xms200m -Xmx400m -cp ${CWD}/lib/*:/etc/hadoop/conf com.avast.server.hdfsshell.MainApp "$@"