wolfboys commented on code in PR #10918: URL: https://github.com/apache/doris/pull/10918#discussion_r922996895
########## bin/start_be.sh: ########## @@ -16,11 +16,31 @@ # 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" + +while [ -h "$PRG" ] ; do Review Comment: yes. this method has been used in my project for a long time, you can see: https://github.com/apache/tomcat/blob/main/bin/startup.sh ########## bin/start_be.sh: ########## @@ -16,11 +16,31 @@ # 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" + +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 "$PRG_DIR/.." >/dev/null; pwd` +export PID_DIR=`cd "$PRGDIR" >/dev/null; pwd` Review Comment: oh, sorry. it's my fault -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org