tisonkun commented on code in PR #2224:
URL: https://github.com/apache/zookeeper/pull/2224#discussion_r1969479182


##########
bin/zkCli.sh:
##########
@@ -27,17 +30,23 @@
 
 # use POSIX interface, symlink is followed automatically
 ZOOBIN="${BASH_SOURCE-$0}"
-ZOOBIN="$(dirname "${ZOOBIN}")"
-ZOOBINDIR="$(cd "${ZOOBIN}"; pwd)"
+ZOOBIN="$(dirname "$ZOOBIN")"
+ZOOBINDIR="$(cd "$ZOOBIN" && pwd)"
 
-if [ -e "$ZOOBIN/../libexec/zkEnv.sh" ]; then
+if [[ -e "$ZOOBIN/../libexec/zkEnv.sh" ]]; then
+  # shellcheck source=bin/zkEnv.sh
   . "$ZOOBINDIR"/../libexec/zkEnv.sh
 else
+  # shellcheck source=bin/zkEnv.sh
   . "$ZOOBINDIR"/zkEnv.sh
 fi
 
 ZOO_LOG_FILE=zookeeper-$USER-cli-$HOSTNAME.log
 
-"$JAVA" "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" 
"-Dzookeeper.log.file=${ZOO_LOG_FILE}" \
-     -cp "$CLASSPATH" $CLIENT_JVMFLAGS $JVMFLAGS \
-     org.apache.zookeeper.ZooKeeperMain "$@"
+# shellcheck disable=SC2206
+clientflags=($CLIENT_JVMFLAGS)
+# shellcheck disable=SC2206
+flags=($JVMFLAGS)
+"$JAVA" "-Dzookeeper.log.dir=$ZOO_LOG_DIR" 
"-Dzookeeper.log.file=$ZOO_LOG_FILE" \
+  "${clientflags[@]}" "${flags[@]}" \
+  org.apache.zookeeper.ZooKeeperMain "$@"

Review Comment:
   May I ask how this change makes a difference?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to