grimoire/bash/tickertape

17 lines
260 B
Plaintext
Raw Permalink Normal View History

2022-10-11 07:57:12 +00:00
#!/usr/bin/env bash
cols=$(tput cols) line=""
while (( ${#line} < cols + ${#1} )); do
if (( ${#line} < ${#1} )); then
2022-10-11 07:58:49 +00:00
line=${1:$((${#1}-${#line}-1)):1}$line
2022-10-11 07:57:12 +00:00
else
line=" $line"
fi
sleep 0.2
printf "\r%s" "${line:0:$cols}"
done
printf "\n"