bashrc/.bashrc.d/countdown.sh

9 lines
120 B
Bash

countdown() {
local secs="$1"
while [ $secs -gt 0 ]; do
echo -ne "$secs\033[0K\r"
sleep 1
: $((secs--))
done
}