I am trying to make a timer in Bash which countdowns 20 minutes and then starts a 10 minute break immediately after the previous. Then the loop continues and returns again to 20 minutes.
#!/bin/bash MIN=20 BREAK=10 while [[ 0 -ne $MIN ]]; do echo "$MIN" sleep 1 MIN=$[$MIN-1] done WHILE [[ 0 -ne $BREAK ]]; do echo "$BREAK" sleep 1 BREAK=$[$BREAK-1] done
I made it with seconds here. So 20 seconds pass by and then the 10 seconds start immediately. But when the 10 seconds expire the script stops. Is there a way to start again with 20 minutes?