Having trouble getting this to exit the loop and perhaps I don't understand the while loop well enough to get it to stop. This is what I'm typing in my command line. I expect it to stop at 10.
c=1; while : [[$c -le 10]]; do df -Th; echo "$c"; date; c=`expr $((c+=1))`; sleep 6; done
I've already read article but it didn't seem to help: bash while loop won't stop itself
Final code:
c=1; while [[ $c -le 10 ]]; do df -Th; echo "$c"; date; c=$((c+=1)); sleep 6; done
The final code required removing the :
and adding between the
[[$c
and 10]]