Advertisement
bashor

The Matrix (Bash)

Oct 7th, 2011
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | None | 0 0
  1. clear
  2. tput setf 2
  3.  
  4. lines="$(tput lines)"
  5. col="$(tput cols)"
  6.  
  7. for i in `seq 0 $col`
  8. do
  9.     m[i]=0
  10. done
  11.  
  12. while [ 0 ]
  13. do
  14.     c=$((RANDOM%col))
  15.     tput cup ${m[c]} $c
  16.     m[c]=$((${m[c]}+1))
  17.     if [ ${m[c]} -gt $lines ]
  18.     then
  19.         m[c]=0
  20.     fi
  21.  
  22.     d=$((RANDOM%lines/3))
  23.     if [ $d -ne 0 ]
  24.     then
  25.         printf \\$(printf '%03o' $((32+$RANDOM%90)))
  26.         #cat /dev/urandom | tr -d -c [:print:] |  head -c 1
  27.     fi
  28. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement