Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

Re: lug-bg: sum and sort with bash


  • Subject: Re: lug-bg: sum and sort with bash
  • From: Ivailo Ivanov <higeronimo@xxxxxxxxx>
  • Date: Fri, 22 Oct 2004 02:49:19 -0700 (PDT)

--- Georgi Genov <ggenov@xxxxxxxxxxx> wrote:

> Ivailo Ivanov wrote:
> 
> >                  Zdraveite,
> >Imam fail sas sledata struktura:
> >
> >source-ip-1 dest-ip bytes digit1 digit2 digit3
> >source-ip-2 dest-ip bytes digit1 digit2 digit3
> >source-ip-1 dest-ip bytes digit1 digit2 digit3
> >source-ip-1 dest-ip bytes digit1 digit2 digit3
> >-----------------------
> >source-ip-n dest-ip bytes digit1 digit2 digit3
> >
> >Iskam da sortiram source ip-ta ta spriamo sumarnite
> >bytes ot vsiako ot tiah. Triabva da se polu4i
> neshto
> >takova, primerno:
> >
> >1. source-ip-1 10929Mb
> >2. source-ip-6 1234Mb
> >3. sourceip-24 125Mb
> >--------------------
> >I taka natatak....
> >
> >
> > 
> >  
> >
> Ð?Ñ?о Ñ?и един Ñ?кÑ?ипÑ? за
> подÑ?еждане по големина на
> Ñ?иÑ?ла.
> Ð? ако ми дадеÑ? и пÑ?имеÑ?ен Ñ?ед
> оÑ? лога за да видÑ? какÑ?в
> Ñ?оÑ?но е паÑ?Ñ?еÑ?а 
> междÑ? Ñ?Ñ?ойноÑ?Ñ?иÑ?е
> Ñ?е Ñ?и ги обединÑ? и дваÑ?а
> Ñ?кÑ?ипÑ?а в един.
209.25.134.7 172.1.1.162 3880868 3880868 1098296995
1098297024
172.1.1.162 209.25.134.7 508987 508987 1098296995
1098297024
212.36.9.10 172.1.1.162 895 895 1098296995 1098297024
172.1.1.162 212.36.9.10 679 679 1098296995 1098297024
195.24.37.245 172.1.1.162 6974 6974 1098296995
1098297024
172.1.1.162 195.24.37.245 644 644 1098296995
1098297024
195.24.39.97 172.1.1.162 56997 56997 1098296995
1098297024
172.1.1.162 195.24.39.97 3366 3366 1098296995
1098297024
212.50.8.31 172.1.1.162 36843 36843 1098296995
1098297024
172.1.1.162 212.50.8.31 1604 1604 1098296995
1098297024
69.93.62.154 172.1.1.162 264820 264820 1098296995
1098297024
172.1.1.162 69.93.62.154 19349 19349 1098296995
1098297024
> 
> #!/bin/sh
> #edit
> db="2345 4634 677547 45 2 574 876854 4563463 35
> 34637 734443 4573 7457 
> 376277 357447 7457 5 5 98"
> #########
> 
> #vuvejda dannite v masiv
> n=0
> for m in $db; do
> n=`expr $n + 1`
> db[$n]=$m
> done
> 
> #prenarejda masiwa
> x=$n
> while [ ! $x -eq 1 ]; do
> y=$n
> while [ ! $y -eq 1 ]; do
> y1=`expr $y - 1`
> if [ $(echo "${db[$y]} < ${db[$y1]}" | bc) -eq 1 ];
> then
> tmp=${db[$y1]}
> db[$y1]=${db[$y]}
> db[$y]=$tmp
> fi
> y=`expr $y - 1`
> done
> x=`expr $x - 1`
> done
> 
> #izvejda rezultata
> while [ ! $n -eq 0 ]; do
> echo -n "${db[$n]} "
> n=`expr $n - 1`
> done
> echo
> exit 0
> 
>
============================================================================
> A mail-list of Linux Users Group - Bulgaria
> (bulgarian linuxers).
> http://www.linux-bulgaria.org - Hosted by Internet
> Group Ltd. - Stara Zagora
> To unsubscribe:
> http://www.linux-bulgaria.org/public/mail_list.html
>
============================================================================
> 



		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================



 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.