busbey commented on a change in pull request #1527: HBASE-24143 [JDK11] Switch
default garbage collector from CMS
URL: https://github.com/apache/hbase/pull/1527#discussion_r410390560
##########
File path: bin/hbase-config.sh
##########
@@ -168,3 +168,27 @@ if [ -z "$JAVA_HOME" ]; then
EOF
exit 1
fi
+
+function read_java_version() {
+ properties="$("${JAVA_HOME}/bin/java" -XshowSettings:properties -version
2>&1)"
+ #shellcheck disable=SC2016 # shellcheck cannot see through "${AWK}"
Review comment:
Oh I should read closer. SC2016 isn't about being able to turn "${AWK}" into
the contents of that variable. it's about the expression being passed to awk.
Specifically the "print $NF" that we want AWK to handle and not the shell.
If we want to stick with AWK I think it's fine to disable the check. I'd
find the comment easier to understand if it was phrased like "we mean to have
AWK handle the variable resolution inside the passed awk script"
Otherwise you could get the same output using sed without anything that
could be mistaken for a bash variable
```
echo "${properties}" | "${GREP}" java.runtime.version | head -1 |
"${SED}" -E -e 's/.* = ([^ ]*)/\1/'
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services