Advertisement
Lateralus138

Matrix Rain - Bash Script

Apr 9th, 2021
1,054
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. # Bash script version "Matrix Rain" of this post: https://twitter.com/climagic/status/1380542449861427202
  2. # Replaces COULUMNS and LINES with 'tput cols/lines' for use in a script
  3. #!/usr/bin/env bash
  4. while :; do
  5.   LINES=$(tput lines) COLUMNS=$(tput cols)
  6.   echo $LINES $COLUMNS $[RANDOM%COLUMNS] $(printf "\U$[ RANDOM%500]")
  7.   sleep 0.05
  8. 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;}}}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement