Last active
September 11, 2021 09:24
-
-
Save robvanderleek/3d7dad8d14c5eb98d7b9f3443e2ea15f to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
IFS= | |
banner=`cat /dev/stdin | figlet -w 999` | |
columns=`tput cols` | |
spacer=`cat /dev/zero | head -c $columns | tr '\0' ' '` | |
banner_with_spacer=`echo $banner | sed "s/^/$spacer/"` | |
banner_length=`echo $banner_with_spacer | awk '{print length}' | head -n 1` | |
start_index=1 | |
while true | |
do | |
clear | |
end_index=`echo "($columns - 1) + $start_index" | bc` | |
echo $banner_with_spacer | cut -c $start_index-$end_index | |
start_index=`echo "$start_index + 1" | bc` | |
if [ $start_index -eq $banner_length ]; then | |
start_index=1 | |
fi | |
sleep 0.01 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment