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/bashMIN=20BREAK=10while [[ 0 -ne $MIN ]]; do    echo $MIN    sleep 1    MIN=$[$MIN-1]doneWHILE [[ 0 -ne $BREAK ]]; do    echo $BREAK    sleep 1    BREAK=$[$BREAK-1]doneI 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?Thank you!
Countdown + break in Bash
linux;bash;terminal
As you know, to repeat a block of code you use a while do ... done loop. So to start all over again you just need to wrap the entire segment of code in another while... loop.This time the condition can be just the command true. So you'd get this:while truedo    # Put the code to be repeated forever in here    :done