leo65535 commented on code in PR #711:
URL: https://github.com/apache/ratis/pull/711#discussion_r944209026


##########
ratis-shell/src/main/libexec/ratis-shell-config.sh:
##########
@@ -58,6 +59,16 @@ if [[ ${JAVA_MAJORMINOR} != 001008 && ${JAVA_MAJOR} != 011 
]]; then
   exit 1
 fi
 
+local RATIS_SHELL_CLASSPATH
+
+while read -d '' -r jarfile ; do
+    if [[ "$RATIS_SHELL_CLASSPATH" == "" ]]; then
+        RATIS_SHELL_CLASSPATH="$jarfile";
+    else
+        RATIS_SHELL_CLASSPATH="$RATIS_SHELL_CLASSPATH":"$jarfile"
+    fi
+done < <(find "$RATIS_SHELL_LIB_DIR" ! -type d -name '*.jar' -print0 | sort -z)

Review Comment:
   hi @szetszwo, I test several commands, `bash` is different from `sh`.
   |  command   | result  |
   |  ----  | ----  |
   | /bin/bash ./bin/ratis  | ok |
   | /bin/bash ./bin/ratis -e | ok |
   | /bin/bash ./bin/ratis sh | ok |
   | /bin/sh ./bin/ratis sh | error |
   | /bin/sh ./bin/ratis -e | error |
   
   We should use `bash` as the same as the head in script files.
   
   
![image](https://user-images.githubusercontent.com/95013770/184310774-67b00f61-0528-4d88-bc9b-4fb24ae4d4db.png)
   



-- 
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