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`, their 
grammar is different.
   |  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)
   
   
   ## The scripts somehow do not have execute again.
   
   I checked the assemble file, we alreadly set the fileMode `0755`, and my 
local evn is ok. 
   Can you ask someone else check these files again?
   
   ```
   $ls -l bin/
   total 8
   -rw-r--r--  1 szetszwo  staff  2152 Jan 22  2020 ratis
   $ls -l examples/bin/
   total 40
   -rw-r--r--  1 szetszwo  staff  1138 Jan 22  2020 client.sh
   -rw-r--r--  1 szetszwo  staff  1859 Jan 22  2020 common.sh
   -rw-r--r--  1 szetszwo  staff   921 Jan 22  2020 server.sh
   -rw-r--r--  1 szetszwo  staff  1598 Jan 22  2020 start-all.sh
   -rw-r--r--  1 szetszwo  staff   922 Jan 22  2020 stop-all.sh
   ```
   



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