You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/12/09 18:44:50 UTC

[GitHub] [solr] HoustonPutman commented on a diff in pull request #1225: SOLR-9509 Fix problems reported by shellcheck

HoustonPutman commented on code in PR #1225:
URL: https://github.com/apache/solr/pull/1225#discussion_r1044738129


##########
solr/bin/solr:
##########
@@ -841,25 +846,26 @@ function stop_solr() {
 
   DIR="$1"
   SOLR_PORT="$2"
-  THIS_STOP_PORT="${STOP_PORT:-$(expr $SOLR_PORT - 1000)}"
+  THIS_STOP_PORT="${STOP_PORT:-$((SOLR_PORT - 1000))}"
   STOP_KEY="$3"
   SOLR_PID="$4"
 
   if [ -n "$SOLR_PID"  ]; then
     echo -e "Sending stop command to Solr running on port $SOLR_PORT ... waiting up to $SOLR_STOP_WAIT seconds to allow Jetty process $SOLR_PID to stop gracefully."
+    # shellcheck disable=SC2086
     "$JAVA" $SOLR_SSL_OPTS $AUTHC_OPTS -jar "$DIR/start.jar" "STOP.PORT=$THIS_STOP_PORT" "STOP.KEY=$STOP_KEY" --stop || true
       (loops=0
       while true
       do
         # Check if a process is running with the specified PID.
         # -o stat will output the STAT, where Z indicates a zombie
         # stat='' removes the header (--no-headers isn't supported on all platforms)
-        STAT=`(ps -o stat='' -p $SOLR_PID || :) | tr -d ' '`
+        STAT=$( (ps -o stat='' -p "$SOLR_PID" || :) | tr -d ' ')

Review Comment:
   I would definitely include this in a comment so someone doesn't "fix" it.



-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org