Hi ALL,
I am trying to find the installed tomcat version and location of the server.xml file to get the tomcat port number.
Using below script to do that.
#!/usr/bin/env bash
var1=$(find / -name "version.sh" ! -size 0 2>&1 |egrep -v "tmp|docker")
for loc1 in $var1
do
abc=$(echo "$loc1" | rev | cut -c 11- | rev)
tomcat_version=$(cd "$abc";./version.sh | grep "Server number:" | awk '{print $3}')
tomcat_status=`tomcat`
if [ "$tomcat_version" != "" ];then
echo $tomcat_version
echo "$abc"
break
fi
done
but in order to get the port number i want to change from tomcat/bin to tomcat/conf location.
For that i tried to use below synatx but it's not working.
echo "$(cd "$abc";../..)"
Can someone please suggest how to change the path?