I am trying to make this if..fi case work for the Java Version from wrapper.conf configuration file./ and from the system, If the output from wrapper.conf is java
I would have two options;
1. wrapper.java.command=/apps/jdk1.8.0_191/bin/java
2. wrapper.java.command=java
If it's long one with Java Version it should just print it.
If it's just java, which means it's using default java, and should check the java -version.
With Below script, I am failing to get it. I am getting below error.
integer expression expected
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
Script Snippet:
for file in $(echo $folder/conf/wrapper.conf)
do
JavaVersion=$(grep "command" $file | awk -F "=" '{print $NF}')
if [ "$JavaVersion" -eq "java" ]; then
java -version 2>&1 >/dev/null | grep 'java version'
else
$JavaVersion
fi
doneis missing in your snippet.