adonis0147 commented on code in PR #11325:
URL: https://github.com/apache/doris/pull/11325#discussion_r934592172


##########
bin/stop_be.sh:
##########
@@ -16,23 +16,26 @@
 # specific language governing permissions and limitations
 # under the License.
 
-curdir=$(dirname "$0")
-curdir=$(
-    cd "$curdir"
-    pwd
-)
+# resolve links - $0 may be a softlink
+PRG="$0"
 
-export DORIS_HOME=$(
-    cd "$curdir/.."
-    pwd
-)
-export PID_DIR=$(
-    cd "$curdir"
-    pwd
-)
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "$PRG"`/"$link"
+  fi
+done
+
+PRGDIR=`dirname "$PRG"`
+
+export DORIS_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
+export PID_DIR=`cd "$PRGDIR" >/dev/null; pwd`
 
 signum=9
-if [ "x"$1 = "x--grace" ]; then
+if [ x"$1" = x"--grace" ]; then

Review Comment:
   ```suggestion
   if [[ "$1" == "--grace" ]]; then
   ```
   
   If you use `[[]]` to test it, the prefix `x` can be omitted.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to