I am trying to write a while loop in bash as below:
while [!(netstat -pnlt | grep ":9393" | wc -l)];
do
echo "server not ready... waiting..."
sleep 2
done
I get
syntax error near unexpected token `netstat'
from console
what I want to do is:
to grep the service that using port 9393, count its lines. If lines number is 0, it means the service is not running, so I will keep it wait.
OS: debian:jessie
please help me correct it... I looked up a lot of documents