- while
Bash while-loop
while true; do (date; sleep 1); done
examples/bash/while.sh
#!/usr/bin/env bash while [[ -f /tmp/run ]] do echo "Running" sleep 2 done echo done
while true; do (date; sleep 1); done
#!/usr/bin/env bash while [[ -f /tmp/run ]] do echo "Running" sleep 2 done echo done