Linux bash Timer

好的,这里是愚蠢的新手问题。 我以为我正在倒数计时器。 这应该从5倒计数,一旦在0,然后执行回声“时间到了小丑”,然后结束。 我在这里做错了什么?

seconds=5 date1=$((`date +%s` + $seconds)); while [ "$date1" -ne `date +%s` ]; do if (!$date1 -lt ((`date +%s` + $seconds)+1)); then echo "time is up clown"; break; fi; echo -ne "$(date -u --date @$(($date1 - `date +%s` )) +%H:%M:%S)\r"; done 

Solutions Collecting From Web of "Linux bash Timer"

 #!/bin/bash SECS=5 while [[ 0 -ne $SECS ]]; do echo "$SECS.." sleep 1 SECS=$[$SECS-1] done echo "Time is up, clown."