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

 

начало

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

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

семинари ...

документи

как да ...

 

 

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

Re: lug-bg: sum and sort with bash


  • Subject: Re: lug-bg: sum and sort with bash
  • From: Georgi Genov <ggenov@xxxxxxxxxxx>
  • Date: Thu, 21 Oct 2004 16:48:03 +0300

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
============================================================================
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.