Created
September 11, 2021 10:14
-
-
Save robvanderleek/92b29c347b2b98563bfd38a39bd70f1e to your computer and use it in GitHub Desktop.
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
#!/bin/tcsh | |
IFS=: | |
set tempfile=`mktemp` | |
cat /dev/stdin | figlet -w 999 > $tempfile | |
set columns=`tput cols` | |
set spacer_cmd="cat /dev/zero | head -c $columns | tr '\0' ' '" | |
sed -i.bak "s/^/`$spacer_cmd`/" $tempfile | |
set banner_length=`cat $tempfile | awk '{print length}' | head -n 1` | |
set start_index=1 | |
while (1) | |
clear | |
@ end_index=($columns - 1) + $start_index | |
cat $tempfile | cut -c $start_index-$end_index | |
@ start_index=$start_index + 1 | |
if ($start_index == $banner_length) then | |
set start_index=1 | |
endif | |
sleep 0.05 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment