Skip to content

Instantly share code, notes, and snippets.

Created June 3, 2016 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/22fdf6765c12fa84b875cd7791e8c5db to your computer and use it in GitHub Desktop.
Save anonymous/22fdf6765c12fa84b875cd7791e8c5db to your computer and use it in GitHub Desktop.
#!/bin/bash
green="\033[0;32m"
brightgreen="\033[1;32m"
colors=($green $brightgreen)
colorcount=${#colors[@]}
OLDIFS="${IFS}"
trap "echo -e \"\\e[m\"; tput sgr0; IFS=\"${OLDIFS}\"; exit" SIGTERM SIGINT
IFS=""
clear
tput cup 0 0
while read -n 1 -r XVAL <&0; do echo -n -e "${colors[$RANDOM%$colorcount]}${XVAL}"; done
echo -e "\e[m"
tput sgr0
IFS="${OLDIFS}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment