Skip to content

Instantly share code, notes, and snippets.

@uplime
Created June 12, 2026 17:28
Show Gist options
  • Select an option

  • Save uplime/239136fee021c9903ff8c3491d0c9ea7 to your computer and use it in GitHub Desktop.

Select an option

Save uplime/239136fee021c9903ff8c3491d0c9ea7 to your computer and use it in GitHub Desktop.
Display a tickertape for a line of text across the terminal.
#!/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