Created
June 12, 2026 17:28
-
-
Save uplime/239136fee021c9903ff8c3491d0c9ea7 to your computer and use it in GitHub Desktop.
Display a tickertape for a line of text across the terminal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment