davidradl commented on code in PR #25739: URL: https://github.com/apache/flink/pull/25739#discussion_r1869672924
########## flink-dist/src/main/flink-bin/bin/bash-java-utils.sh: ########## @@ -25,11 +34,41 @@ readFromConfigFile() { # first extract the value with the given key (1st sed), then trim the result (2nd sed) # if a key exists multiple times, take the "last" one (tail) local value=`sed -n "s/^[ ]*${key}[ ]*: \([^#]*\).*$/\1/p" "${configFile}" | sed "s/^ *//;s/ *$//" | tail -n 1` - + if [ -z "$value" ]; then + # for env.java.home value = `sed -n "/^env:/,/^[^ ]/p" "${configFile}" | sed -n "/^ java:/,/^[^ ]/p" | sed -n "/home:/s/.*: //p" | tail -n 1` + IFS='.' + read -ra nodes <<< "$1" + + local sed_cmd_left="sed -n \"/^" + local sed_cmd_right=" | " + for index in ${!nodes[@]}; do + node=${nodes[index]} + + if [ $index -eq 0 ]; then Review Comment: I suggest adding more comments explaining the intent of the code; it would be easier to parse for the reader -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org