|
Re: lug-bg: sum and sort with bash
- Subject: Re: lug-bg: sum and sort with bash
- From: Ivailo Ivanov <higeronimo@xxxxxxxxx>
- Date: Thu, 21 Oct 2004 12:06:15 -0700 (PDT)
--- Vasil Kolev <vasil@xxxxxxxxxx> wrote:
> On Ñ?Ñ?, 2004-10-21 at 16:48 +0300, Georgi Genov
> wrote:
> > Georgi Genov wrote:
> >
> > > Ivailo Ivanov wrote:
> > >
> > >> Zdraveite,
> > >> Imam fail sas sledata struktura:
> > >
> > >
> > > #!/bin/sh
> > > source_ip_db="10.0.1.2 10.0.1.3 10.0.1.4
> 10.0.1.5 10.0.1.6"
> > > for $source_ip in $source_ip_db; do
> > > tmp_trafic_ip=`cat trafic.log | grep "$source_ip
> " | tr -s ' ' | awk
> > > '{ print $3 }'`
> > > trafic_db[$source_ip]=$(echo
> "${trafic_db[$source_ip]} +
> > > $tmp_trafic_ip" | bc)
> > > echo "$source_ip ${trafic_db[$source_ip]}"
> > > done
> > > exit 0
> > >
> > >
> > да Ñ?е fixna дока е вÑ?еме :)
> >
> > #!/bin/sh
> > source_ip_db="10.0.1.2 10.0.1.3 10.0.1.4 10.0.1.5
> 10.0.1.6"
> > for source_ip in $source_ip_db; do
> > tmp_trafic_ip=`cat trafic.log | grep "$source_ip "
> | tr -s ' ' | awk '{
> > print $3 }'`
> > trafic_db[$source_ip]=$(echo
> "${trafic_db[$source_ip]} + $tmp_trafic_ip"
> > | bc)
> > echo "$source_ip ${trafic_db[$source_ip]}"
> > done
> > exit 0
>
> Ð?дна кÑ?аÑ?ка пÑ?епоÑ?Ñ?ка -
> source_ip_db=`cat traffic_log|cut -d ' ' -f
> 1|sort|uniq`
> , понеже Ñ?овека каза, Ñ?е нÑ?ма
> идеÑ? каквоÑ? Ñ?оÑ?но има каÑ?о
> sources (но
> нали в Ñ?Ñ?Ñ? нÑ?ма инÑ?еÑ?вали?:)
> Че инаÑ?е задаÑ?каÑ?а Ñ?Ñ?ава
> по-Ñ?ложна).
>
> п.Ñ?. Ñ?поÑ?ед мене Ñ?еалниÑ?
> инÑ?Ñ?Ñ?Ñ?менÑ? за Ñ?елÑ?а Ñ?и е
> бозаÑ?а данни, Ñ?ова
> изобÑ?о не Ñ?е scale-ва...
>
Super - mersi mnogo. Sega ostava samo to4kite da
fix-nem.
./usertraf: line 1: 172.1.1.162: syntax error in
expression (error token is ".1.1.162")
./usertraf: line 7: 172.16.11.162: syntax error in
expression (error token is ".1.1.162")
_______________________________
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
============================================================================
|
|
|