Skip to content

Instantly share code, notes, and snippets.

View avenwu's full-sized avatar

Wu avenwu

View GitHub Profile
@krohne
krohne / countdown.sh
Last active March 1, 2024 20:17
Countdown timer in bash shell script
#!/bin/bash
# $1 = # of seconds
# $@ = What to print after "Waiting n seconds"
countdown() {
secs=$1
shift
msg=$@
while [ $secs -gt 0 ]
do
printf "\r\033[KWaiting %.d seconds $msg" $((secs--))