bash - Check wordcount in until loop -
i want continue bash script when docker container has 2 mentions of string in logs..i tried following code can't seem re-count variable (using eval), stays stuck:
number=`docker logs mysql 2>&1 | grep 'mysqld: ready connections' | wc -l` until [ "$number" -eq 2 ]; sleep 2 echo $number eval "$number" done echo mysql started , rebooted, continue..
i fixed this:
number=0 until [ "$number" -eq 2 ]; sleep 2 number=`docker logs mysql 2>&1 | grep 'mysqld: ready connections' | wc -l` done
Comments
Post a Comment