Can anyone see what I have done wrong here?
local VERSION=$(java -version 2>&1 | grep "java version")
if [[ ! "$VERSION" =~ *"1.8.0_33"* ]]; then
ERROR (not code, just place holder)
else
NO ERROR (not code, just place holder)
fi
Thanks for the quick help!
* UPDATE *
Here is what else I have tried:
local VERSION=$(java -version 2>&1 | grep "java version")
if [[ "$VERSION" != *"1.8.0_33"* ]]; then
Error blah blah not using 1.8.0_33
else
Good to go
fi
This is in a function all by itself. No other nested anything.
GNU bash, version 4.2.37(1)-release (arm-unknown-linux-gnueabihf)
[[ "$VERSION" != *"1.8.0_33"* ]]$VERSIONcontains?echo "[$VERSION]"show to you?javaon$PATHwhen you execute the script?