Skip to content

Instantly share code, notes, and snippets.

@smuuf
Last active June 2, 2022 14:16
Show Gist options
  • Save smuuf/bf2762e5c431b960d84b659a25af685f to your computer and use it in GitHub Desktop.
Save smuuf/bf2762e5c431b960d84b659a25af685f to your computer and use it in GitHub Desktop.
Bash sleep with countdown
#!/bin/bash
function psleep {
S="$1"
O="$S"
while [ $S -gt 0 ]; do
echo -ne "\r$S s (from $O) "
sleep 1
((S--))
done
echo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment