From 64dbd49a40618a13753df9c8594ec96d9c614844 Mon Sep 17 00:00:00 2001 From: Nick Chambers Date: Tue, 11 Oct 2022 02:57:12 -0500 Subject: [PATCH] Display a tickertape across the screen --- bash/tickertape | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bash/tickertape diff --git a/bash/tickertape b/bash/tickertape new file mode 100755 index 0000000..737cb62 --- /dev/null +++ b/bash/tickertape @@ -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"