Skip to content

Instantly share code, notes, and snippets.

@robvanderleek
Last active September 11, 2021 09:24
Show Gist options
  • Save robvanderleek/3d7dad8d14c5eb98d7b9f3443e2ea15f to your computer and use it in GitHub Desktop.
Save robvanderleek/3d7dad8d14c5eb98d7b9f3443e2ea15f to your computer and use it in GitHub Desktop.
#!/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