Fix bin/inc to work with any shell
@@ -214,8 +214,9 @@ checkJvmVersion() {
| awk '{print substr($1, 3, 3)}' \
| sed -e 's;\.;;g')
MAJOR_VERSION=$("${JAVA}" -version 2>&1 \
- |awk -F '"' '/version/ {print $2}')
- if [ "${MAJOR_VERSION:0:1}" -ge "9" ]; then
+ |awk -F '"' '/version/ {print $2}' \
+ |cut -b 1)
+ if [ "${MAJOR_VERSION}" -ge "9" ]; then
VERSION=90
fi
if [ "${VERSION}" -lt "80" ]; then
@@ -265,8 +266,8 @@ setupDefaults() {
# permgen was removed in Java 8
VERSION=$("${JAVA}" -version 2>&1 | egrep '"([0-9].[0-9]\..*[0-9]).*"' | awk '{print substr($3,2,length($3)-2)}' | awk '{print substr($1, 3, 3)}' | sed -e 's;\.;;g')
MAJOR_VERSION=$("${JAVA}" -version 2>&1 \
- |awk -F '"' '/version/ {print $2}')
- if [ "${MAJOR_VERSION:0:1}" -ge "9" ]; then
+ |awk -F '"' '/version/ {print $2}'|cut -b 1)
+ if [ "${MAJOR_VERSION}" -ge "9" ]; then
VERSION=90
fi
if [ "${VERSION}" -lt "80" ]; then
