Skip to content

Instantly share code, notes, and snippets.

View xtianbetz's full-sized avatar

Christian Betz xtianbetz

View GitHub Profile
@xtianbetz
xtianbetz / gist:4f6d306342c90a133970d6b9edc78a09
Created November 12, 2020 00:34
bash countdown in-place with ascii escape codes
#!/bin/bash
# The following excellent guide was used to find the right ascii escape codes:
# https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797
let count=10
echo "Count: $count"
while [ $count -gt 0 ] ; do
echo -en "\x1b[1A\x1b[7C"
printf "%2d\n" $count
sleep 1