Created
April 9, 2021 23:07
-
-
Save renatoassis01/c897a9513c5d7311ff56b433506d5151 to your computer and use it in GitHub Desktop.
matrix for bash
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
# Matrix of this post: https://twitter.com/climagic/status/1380542449861427202 | |
#!/usr/bin/env bash | |
while :; do | |
LINES=$(tput lines) COLUMNS=$(tput cols) | |
echo $LINES $COLUMNS $[RANDOM%COLUMNS] $(printf "\U$[ RANDOM%500]") | |
sleep 0.05 | |
done | gawk '{c=$4; l=$4;a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1;printf "\033[%s;%sH\033[2;32m%s",o,x,l;printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,l;if(a[x]>=$1){a[x]=0;}}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment