Antonio Macchi
2009-11-18 12:26:18 UTC
#!/bin/bash
trap reset 0
size=`stty size`
LINES=${size% *}
COLUMNS=${size#* }
PI2=628
PI4=$(( PI2 * 2 ))
centerx=$(( COLUMNS / 2 ))
centery=$(( LINES / 2 ))
radiusx=200
radiusy=100
text=( d e b i a n )
textlength=6
textpos=0
echo -en "\e[H\e[J"
echo -en "\e[31m"
x=0
y=0
for (( angle = 0; angle < PI4; ++angle )) {
exx=$x;
exy=$y;
x=`echo "scale=3; $centerx + s($angle / 100) * ($radiusx / 100)" | bc -l`
y=`echo "scale=3; $centery + c($angle / 100) * ($radiusy / 100)" | bc -l`
x=${x%.*}
y=${y%.*}
if test $x -ne $exx -o $y -ne $exy; then
char=${text[$(( textpos % textlength ))]}
echo -en "\e[$y;${x}H$char"
(( ++textpos ))
fi
radiusx=$(( radiusx + 2 ))
radiusy=$(( radiusy + 1 ))
}
echo -n ...
while :; do :; done
trap reset 0
size=`stty size`
LINES=${size% *}
COLUMNS=${size#* }
PI2=628
PI4=$(( PI2 * 2 ))
centerx=$(( COLUMNS / 2 ))
centery=$(( LINES / 2 ))
radiusx=200
radiusy=100
text=( d e b i a n )
textlength=6
textpos=0
echo -en "\e[H\e[J"
echo -en "\e[31m"
x=0
y=0
for (( angle = 0; angle < PI4; ++angle )) {
exx=$x;
exy=$y;
x=`echo "scale=3; $centerx + s($angle / 100) * ($radiusx / 100)" | bc -l`
y=`echo "scale=3; $centery + c($angle / 100) * ($radiusy / 100)" | bc -l`
x=${x%.*}
y=${y%.*}
if test $x -ne $exx -o $y -ne $exy; then
char=${text[$(( textpos % textlength ))]}
echo -en "\e[$y;${x}H$char"
(( ++textpos ))
fi
radiusx=$(( radiusx + 2 ))
radiusy=$(( radiusy + 1 ))
}
echo -n ...
while :; do :; done