diff --git a/bin/kafka-console-consumer.sh b/bin/kafka-console-consumer.sh index 07c90a9..3944ba0 100755 --- a/bin/kafka-console-consumer.sh +++ b/bin/kafka-console-consumer.sh @@ -18,4 +18,4 @@ if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then export KAFKA_HEAP_OPTS="-Xmx512M" fi -exec $(dirname $0)/kafka-run-class.sh kafka.tools.ConsoleConsumer $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.tools.ConsoleConsumer "$@" diff --git a/bin/kafka-console-producer.sh b/bin/kafka-console-producer.sh index ccca66d..a8752a9 100755 --- a/bin/kafka-console-producer.sh +++ b/bin/kafka-console-producer.sh @@ -17,4 +17,4 @@ if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then export KAFKA_HEAP_OPTS="-Xmx512M" fi -exec $(dirname $0)/kafka-run-class.sh kafka.tools.ConsoleProducer $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.tools.ConsoleProducer "$@" diff --git a/bin/kafka-consumer-groups.sh b/bin/kafka-consumer-groups.sh index f4786db..2de158f 100755 --- a/bin/kafka-consumer-groups.sh +++ b/bin/kafka-consumer-groups.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -exec $(dirname $0)/kafka-run-class.sh kafka.admin.ConsumerGroupCommand $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.admin.ConsumerGroupCommand "$@" diff --git a/bin/kafka-consumer-offset-checker.sh b/bin/kafka-consumer-offset-checker.sh index c275f7e..3adad37 100755 --- a/bin/kafka-consumer-offset-checker.sh +++ b/bin/kafka-consumer-offset-checker.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -exec $(dirname $0)/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker "$@" diff --git a/bin/kafka-consumer-perf-test.sh b/bin/kafka-consumer-perf-test.sh index ebc513a..96a0343 100755 --- a/bin/kafka-consumer-perf-test.sh +++ b/bin/kafka-consumer-perf-test.sh @@ -17,4 +17,4 @@ if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then export KAFKA_HEAP_OPTS="-Xmx512M" fi -exec $(dirname $0)/kafka-run-class.sh kafka.tools.ConsumerPerformance $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.tools.ConsumerPerformance "$@" diff --git a/bin/kafka-mirror-maker.sh b/bin/kafka-mirror-maker.sh index 56e342c..5dc18f0 100755 --- a/bin/kafka-mirror-maker.sh +++ b/bin/kafka-mirror-maker.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -exec $(dirname $0)/kafka-run-class.sh kafka.tools.MirrorMaker $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.tools.MirrorMaker "$@" diff --git a/bin/kafka-preferred-replica-election.sh b/bin/kafka-preferred-replica-election.sh index ed167c2..ac16666 100755 --- a/bin/kafka-preferred-replica-election.sh +++ b/bin/kafka-preferred-replica-election.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -exec $(dirname $0)/kafka-run-class.sh kafka.admin.PreferredReplicaLeaderElectionCommand $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.admin.PreferredReplicaLeaderElectionCommand "$@" diff --git a/bin/kafka-producer-perf-test.sh b/bin/kafka-producer-perf-test.sh index 84ac949..2ce1035 100755 --- a/bin/kafka-producer-perf-test.sh +++ b/bin/kafka-producer-perf-test.sh @@ -17,4 +17,4 @@ if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then export KAFKA_HEAP_OPTS="-Xmx512M" fi -exec $(dirname $0)/kafka-run-class.sh kafka.tools.ProducerPerformance $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.tools.ProducerPerformance "$@" diff --git a/bin/kafka-reassign-partitions.sh b/bin/kafka-reassign-partitions.sh index 95b4ae0..99092ff 100755 --- a/bin/kafka-reassign-partitions.sh +++ b/bin/kafka-reassign-partitions.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -exec $(dirname $0)/kafka-run-class.sh kafka.admin.ReassignPartitionsCommand $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.admin.ReassignPartitionsCommand "$@" diff --git a/bin/kafka-replay-log-producer.sh b/bin/kafka-replay-log-producer.sh index 8e2e713..13da7fb 100755 --- a/bin/kafka-replay-log-producer.sh +++ b/bin/kafka-replay-log-producer.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -exec $(dirname $0)/kafka-run-class.sh kafka.tools.ReplayLogProducer $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.tools.ReplayLogProducer "$@" diff --git a/bin/kafka-replica-verification.sh b/bin/kafka-replica-verification.sh index ee6d19e..fd4ab15 100755 --- a/bin/kafka-replica-verification.sh +++ b/bin/kafka-replica-verification.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -exec $(dirname $0)/kafka-run-class.sh kafka.tools.ReplicaVerificationTool $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.tools.ReplicaVerificationTool "$@" diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh index 8c3fa28..71115ca 100755 --- a/bin/kafka-run-class.sh +++ b/bin/kafka-run-class.sh @@ -20,7 +20,7 @@ then exit 1 fi -base_dir=$(dirname $0)/.. +base_dir="$(dirname "$0")"/.. # create logs directory if [ "x$LOG_DIR" = "x" ]; then diff --git a/bin/kafka-server-start.sh b/bin/kafka-server-start.sh index dc01d46..1831de9 100755 --- a/bin/kafka-server-start.sh +++ b/bin/kafka-server-start.sh @@ -19,7 +19,7 @@ then echo "USAGE: $0 [-daemon] server.properties [--override property=value]*" exit 1 fi -base_dir=$(dirname $0) +base_dir="$(dirname "$0")" if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties" @@ -41,4 +41,4 @@ case $COMMAND in ;; esac -exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka $@ +exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka "$@" diff --git a/bin/kafka-simple-consumer-shell.sh b/bin/kafka-simple-consumer-shell.sh index 9316f79..024db53 100755 --- a/bin/kafka-simple-consumer-shell.sh +++ b/bin/kafka-simple-consumer-shell.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -exec $(dirname $0)/kafka-run-class.sh kafka.tools.SimpleConsumerShell $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.tools.SimpleConsumerShell "$@" diff --git a/bin/kafka-topics.sh b/bin/kafka-topics.sh index b39b272..7765bc4 100755 --- a/bin/kafka-topics.sh +++ b/bin/kafka-topics.sh @@ -14,4 +14,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -exec $(dirname $0)/kafka-run-class.sh kafka.admin.TopicCommand $@ +exec "$(dirname "$0")"/kafka-run-class.sh kafka.admin.TopicCommand "$@" diff --git a/bin/zookeeper-server-start.sh b/bin/zookeeper-server-start.sh index d968786..478dd8e 100755 --- a/bin/zookeeper-server-start.sh +++ b/bin/zookeeper-server-start.sh @@ -19,7 +19,7 @@ then echo "USAGE: $0 zookeeper.properties" exit 1 fi -base_dir=$(dirname $0) +base_dir="$(dirname "$0")" if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties" @@ -41,5 +41,5 @@ case $COMMAND in ;; esac -exec $base_dir/kafka-run-class.sh $EXTRA_ARGS org.apache.zookeeper.server.quorum.QuorumPeerMain $@ +exec $base_dir/kafka-run-class.sh $EXTRA_ARGS org.apache.zookeeper.server.quorum.QuorumPeerMain "$@" diff --git a/bin/zookeeper-server-stop.sh b/bin/zookeeper-server-stop.sh index 975d9ae..db7720c 100755 --- a/bin/zookeeper-server-stop.sh +++ b/bin/zookeeper-server-stop.sh @@ -13,4 +13,4 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -ps ax | grep -i 'zookeeper' | grep -v grep | awk '{print $1}' | xargs kill -SIGINT +pgrep -f 'zookeeper' | xargs kill -SIGINT diff --git a/bin/zookeeper-shell.sh b/bin/zookeeper-shell.sh index 95007fa..df8086b 100755 --- a/bin/zookeeper-shell.sh +++ b/bin/zookeeper-shell.sh @@ -20,4 +20,4 @@ then exit 1 fi -exec $(dirname $0)/kafka-run-class.sh org.apache.zookeeper.ZooKeeperMain -server "$@" +exec "$(dirname "$0")"/kafka-run-class.sh org.apache.zookeeper.ZooKeeperMain -server "$@"