shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] feet.sh


From: Renato S. Yamane
Subject: Re: [shell-script] feet.sh
Date: Mon, 30 Jul 2007 11:06:30 -0300
User-agent: Thunderbird 2.0.0.5 (X11/20070716)

./feet.sh: line 16: 5913: command not found

Correção abaixo:

--left_foot=$( ($RANDOM % $((`tput cols` - 12)))) || exit -1
++left_foot=$(($RANDOM % $((`tput cols` - 12)))) || exit -1

Att,
Renato


Valtoir S. Jardim escreveu:
Olá, pessoal. Lembram do script "pes.sh", aquele dos pezinhos?

<http://www.mail-archive.com/address@hidden/msg06385.html>

Reescrevi todo ele, com um lógica diferente. Ficou mais enxuto (menos de
50 linhas) e mais randômico. Se alguém quiser baixar o arquivo prá não
precisar copiar, colar e ajustar a identação, o link é
http://dwarfurl. com/8f937. Segue <http://dwarfurl.com/8f937.Segue> o código:

#!/bin/bash
# author: Valtoir dos Santos Jardim
# e-mail: valtoirjardim_ at_gmail_ dot_com
# blog: valtoir.blogspot. com
# date: 2007-07-29-21: 28
# version: ~ 0.99
trap "" 2
setterm -cursor off -bold on
colors=(31 32 33 34 35 36 37)
rfp=("+8" "+9" "+8" "+8")
rfo=("(_/" ") /" "( )" "Oooo.")
lfp=("+2" "+1" "" "")
lfo=("\_)" "\ (" "( )" ".oooO")
feet () {
while :; do
left_foot=$( ($RANDOM % $((`tput cols` - 12)))) || exit -1
act_foot=$(( RANDOM % 2))
color=${colors[ $(($RANDOM % ${#colors[*] }))]}
seed=$((RANDOM % 4))
delay=.$(((RANDOM % 8) + 4))
actline=$(tput lines)
while :; do
for i in $(seq $seed 4); do
[ $((actline-- )) -ge 1 ] || break
if [ $act_foot -eq 0 ]; then
tput cup $((actline)) $((left_foot ${rfp[$i]}))
echo -e "\e[$color;1m" "${rfo[$i] }""\c\e[m"
else
tput cup $((actline)) $((left_foot ${lfp[$i]}))
echo -e "\e[$color;1m" "${lfo[$i] }""\c\e[m"
fi
done
if [ $act_foot -eq 0 ]; then
act_foot=1
else
act_foot=0
fi
[ $actline -ge 1 ] || break
seed=0
sleep $delay
done
done
}
feet &
read -rs -n 1
echo -e "\e[m"
setterm -reset
clear
pkill feet

Isso aí.

Abraços,

Valtoir


reply via email to

[Prev in Thread] Current Thread [Next in Thread]