Hi,
I develop simple animation ping script on Solaris Platform. It is like Cisco ping.
Examples and source code are below.
bash-3.00$ gokcell 152.155.180.8 30
Sending 30 Ping Packets to 152.155.180.8
!!!!!!!!!!!!!.!!!!!!!!!!!!!!!.
% 93.33 success... % 6.66 packet loss...
Start:04-12-2011-03:53:17
End :04-12-2011-03:54:08
bash-3.00$ gokcell 152.155.180.8 60
Sending 60 Ping Packets to 152.155.180.8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
% 100.00 success... % 0 packet loss...
Start:04-12-2011-05:36:40
End :04-12-2011-05:37:44
bash-3.00$ more gokcell
#!/bin/bash
count1=0
count2=0
start=`date +"%d-%m-%Y-%T"`
#Developed by Goksel Yangin for STC Network
echo
echo Sending $2 Ping Packets to $1
echo
for ((i=1; i<=$2; i++))
do
sonuc=`/usr/sbin/ping -s $1 64 1 | grep packet | awk '{print $(NF-2)}'`
sleep 1
if [[ "$sonuc" == "0%" ]]
then
count1=`expr $count1 + 1`
echo -n !
else
count2=`expr $count2 + 1`
echo -n .
fi
done
end=`date +"%d-%m-%Y-%T"`
let "count1*=100"
#let "count1/=$2"
#let kalan=count1%$2
let "count2*=100"
#let "count2/=$2"
#let kalan2=count2%$2
echo
num1=$(echo "scale=2; $count1 / $2" | bc)
num2=$(echo "scale=2; $count2 / $2" | bc)
#printf "\x1b[5m$num1..$num2\x1b[25m"
#echo -n % $num1 success... % $num2 packet loss...
echo -n "`tput blink`% $num1 success... % $num2 packet loss...`tput sgr0`"
echo
echo Start:$start
echo End :$end
echo
Regards,
Goksel Yangin
Computer Engineer