In reply to Resa Drijsen.

Hello,
I got around this by using an if...then...else statement around the echo statements that would count the characters in the variable and then echo differently if the variable had 13 characters. The code I used is below - it doesn't keep the spaces and formatting when I reply here, but you can figure it out I think

# Server is already running
if [ ${#SASWEBAPPINSTANCE} = 13 ]; then #added line
echo -e "SAS Web App Server $SASWEBAPPINSTANCE [ ${GREEN}UP${NC} ]" #added line with one less space in the echo
else # added line
echo -e "SAS Web App Server $SASWEBAPPINSTANCE [ ${GREEN}UP${NC} ]"
fi # added line
else
if [ ${#SASWEBAPPINSTANCE} = 13 ]; then #added line
echo -e "SAS Web App Server $SASWEBAPPINSTANCE [ ${RED}DOWN${NC} ]" #added line with one less space in the echo
else # added line
echo -e "SAS Web App Server $SASWEBAPPINSTANCE [${RED}DOWN${NC}]"
fi # added line
fi
} # if PID
else
if [ ${#SASWEBAPPINSTANCE} = 13 ]; then #added line
echo -e "SAS Web App Server $SASWEBAPPINSTANCE [ ${RED}DOWN${NC} ]" #added line with one less space in the echo
else # added line
echo -e "SAS Web App Server $SASWEBAPPINSTANCE [${RED}DOWN${NC}]"
fi # added line