NihalJain commented on code in PR #8703:
URL: https://github.com/apache/hbase/pull/8703#discussion_r4107902109


##########
bin/hbase:
##########
@@ -174,6 +187,50 @@ add_size_suffix() {
     fi
 }
 
+# Resolve a script under bin/: keep paths that already contain a slash, 
otherwise
+# look in HBASE_HOME/bin. Sets RESOLVED_BIN_SCRIPT or exits.
+resolve_bin_script() {
+  local name="$1"
+  local kind="$2"
+  if [[ "$name" == */* ]]; then
+    RESOLVED_BIN_SCRIPT="$name"
+  else
+    RESOLVED_BIN_SCRIPT="${HBASE_HOME}/bin/${name}"
+  fi
+  if [ ! -f "$RESOLVED_BIN_SCRIPT" ]; then
+    echo "${kind} not found: $RESOLVED_BIN_SCRIPT"
+    exit 1
+  fi
+}
+
+# Populate JSHELL_ARGS for both interactive `jshell` and `*.jsh` script 
dispatch.
+# Shared so the two paths cannot drift. Honors HBASE_JSHELL_ARGS when set; 
otherwise
+# DEFAULT + PRINTING + optional hbase_startup.jsh. Defaults to --execution 
local
+# unless the user already passed --execution / --execution=<spec>.
+init_jshell_args() {
+  if [ -n "${HBASE_JSHELL_ARGS}" ]; then
+    read -r -a JSHELL_ARGS <<< "${HBASE_JSHELL_ARGS}"

Review Comment:
   Please either:
   - explicitly document that HBASE_JSHELL_ARGS cannot contain 
whitespace-bearing arguments, or
   - add a parsing approach that supports values such as a startup file path 
containing spaces.



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