Skip to content

Instantly share code, notes, and snippets.

@gleero
Created April 14, 2014 17:01
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 gleero/10665416 to your computer and use it in GitHub Desktop.
Save gleero/10665416 to your computer and use it in GitHub Desktop.
#!/bin/bash
#################################
str="Привет, наркомания"
#################################
# Карта цветов
len=`echo $str | wc -c`
for step in `seq $len`; do
let "color = $RANDOM % 16"
map="$map $color"
done
# Хуячим бесконечно
while [ 1 ]; do
# Рендерим
i=0
> "/tmp/.tqkgpgq"
grep -o . <<< "$str" | while read letter; do
let "i += 1"
ret="`echo $map | cut -d ' ' -f$i`"
echo -n "`tput setaf $ret`$letter" >> /tmp/.tqkgpgq
done
cat /tmp/.tqkgpgq
tput cub $len
# Обновляем карту цветов
let "color = $RANDOM % 16"
map="`echo $map | cut -d ' ' -f 2-` $color"
sleep .2
done
rm /tmp/.tqkgpgq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment