Listmembers,

                Yesterday I was looking at this netstat filter by port code and 
decided to put in my library of handy stuff, realizing it had to be made into a 
bash function to be more useful for me! :)

netstat_portrange ()
{
    lower=${1:-"20000"};
    upper=${2:-"65000"};
    # awk -v lower="${lower}" -v upper="${upper}" '(NR > 2) {n=split($5,a,":"); 
if (a[n] >= lower && a[n] <= upper) print a[n];}' <<< "$(netstat -tn)"
    awk -v lower="${lower}" -v upper="${upper}" '(NR > 2) {n=split($5,a,":"); 
if (a[n] >= lower && a[n] <= upper) print $0;}' <<< "$(netstat -tn)"
}


Very Respectfully,

Stuart

Stuart Blake Tener, N3GWG
Computer Scientist, IBM (contractor)
NY State Office of Information Technology Services
Enterprise UNIX Systems Support
W. Averell Harriman State Office Building Campus
1220 Washington Avenue
Building 8, Cube 7-114
Albany, NY 12226-1800

[email protected]<mailto:[email protected]> (NY State)
[email protected]<mailto:[email protected]> (personal)
[email protected]<mailto:[email protected]> (Enterprise UNIX Team email 
address)

+(1) 518.862.6081 (desk)
+(1) 215.338.6005 (Google Voice)
+(1) 310.358.0202 (mobile)


----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to