Summary: Quick AWK help

From: Siva Singam Santhakumar <santha_at_stepsoft.com.au>
Date: Wed Aug 25 2004 - 00:25:55 EDT
Thanks to John F Wall (at us.ibm.com) for the quick and detailed reply. 
Correct syntax:

/usr/sbin/netstat -an |grep ESTA |\
awk ' { split($4,a,".")
if (a[5] == "8005")
DEV++
if (a[5] == "8006")
PROD++
}
END { printf DEV, PROD }
'
I am using it on a Tru64 box, so please ignore the field I am working on.

Thanks Gurus

Siva Singam Santhakumar wrote:

> Dear Managers,
>
> Sorry for the OT
>
> What is wrong in this awk line?
>
> /usr/sbin/netstat -an |grep ESTA | awk 
> '{split($4,a,".");if(a[4]=8005)DEV++;if(a[4]=8006)PROD++;print 
> $DEV,$PROD} '
>
> In this line I am trying to get the total connections for ports 8005 
> and 8006.
>
> Thanks


-- 

 

/Siva //S Santhakumar ( Santha)/

System Administrator

Stepsoft Pty Ltd

+ Unit 5, 11 National Circuit, BARTON   ACT   2600

Stepsoft is the developer of Foxtrot, an Enterprise

Customer Knowledge System (CKS).  Find out more

At www.stepsoft.com.au <http://www.stepsoft.com.au/>

 Email: santha@stepsoft.com.au

 Phone: (+61) 02 6233 0913

 Fax: (+61) 02 6233 0990

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Wed Aug 25 00:25:47 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:38 EST