I'm struggling with syntax of do while loop with 2 conditions inside the while statement:
while [[ supervisorctl status | grep $1 | awk '{print $2}' != 'RUNNING' ]] && [[ $count -gt 0 ]]; do
supervisorctl start $1
sleep 3
$count=$count -1
done
when i run bash -n on my script to check for syntax error i get the following output:
line 31: conditional binary operator expected
line 31: syntax error near `status'
line 31: ` while [[ supervisorctl status | grep $1 | awk '{print $2}' != 'RUNNING' ]] && [[ $count -gt 0 ]]; do'
can someone please help me figure the correct syntax?