Display a tickertape across the screen

This commit is contained in:
Nick Chambers 2022-10-11 02:57:12 -05:00
parent 615a322641
commit 64dbd49a40
1 changed files with 16 additions and 0 deletions

16
bash/tickertape Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
cols=$(tput cols) line=""
while (( ${#line} < cols + ${#1} )); do
if (( ${#line} < ${#1} )); then
line=${1:$(( ${#1} - ${#line} - 1)):1}$line
else
line=" $line"
fi
sleep 0.2
printf "\r%s" "${line:0:$cols}"
done
printf "\n"