I am currently trying to write a script and I am not that great at wording it with taking in user input, it will do the following:
ask " Have you stopped instances? "
if instances are stopped, then I want it to change to the default java to 64 bits, and print the current version of java.
Afterwards I want it to return the default back to 32 bits.
Basically I want it to remove the existing symlink and recreate a new link to point to the other java version and display the info.
#!/bin/ksh
# -*- Mode: Bash; tab-width: 2; indent-tabs-mode: nil -*- vim:sta:et:sw=2:ts=2:syntax=sh
read -p " Have you stop the instances? [yn]" answer
if [ $answer = y ]
then
read -p " Do you want to set Java default to 64 bits? [yn]" answer
if [ $answer = y ]
then (setServerJava -b 64)
elif
read -p " Do you want to set Java default to 32 bits? [yn]" answer
if [ $answer = y ]
then (setServerJava -b 32)
else
echo "You have not stopped instances yet, cannot set Java default."
fi
if [ setServerjava -b 64 ]
then
JAVA_VERSION=`java -version 2>&1 |awk 'NR==1{ gsub(/"/,""); print $3 }'`
# export JAVA_VERSION
echo $JAVA_VERSION
fi
fi
any and all help is GREATLY appreciated, thanx