Consider the following script to stop and start tomcat:
#!/bin/bash
# Shutdown tomcat and delete all the logs
echo --- Shutting down Tomcat...
sh /opt/tomcat/bin/shutdown.sh -force &> /dev/null
rm -f /opt/tomcat/logs/* &> /dev/null
echo OK
# Startup tomcat
sh /opt/tomcat/bin/startup.sh &> /dev/null
echo --- Starting up Tomcat...
until [ "`curl --silent --show-error --connect-timeout 1 -I http://localhost:8080 | grep 'Coyote'`" != "" ];
do
sleep 10
done
echo OK
What I'd like to be able to do is show the OK on the same line as the message stating what's going on. How can I achieve this?