Re: Netstat Grep Port Range

2014-07-01 Thread Ted Rodriguez-Bell
I'm not sure if this is the question, but if you're trying to find all processes with a network socket open in the 2--22000 range this should do it: # netstat -anp | awk '/^tcp|^udp/ && $4 ~ /.*:2[0-2][0-9][0-9][0-9]/' Most regular expression packages would let one say /.*:2[0-2][0-9]{3}

Re: USS Env not recognized for TCPIP and DNS server

2014-07-01 Thread Alan Altmark
On Tuesday, 07/01/2014 at 02:51 EDT, mf db wrote: > Hi, > Cross posted to mvs oe tcpip-l linux. > > We have an application which used to run even without specifying SYSTCPD DD > statement since it used to get the environment from USS. Now recently its > not recognising the USS ENV but we have to s

USS Env not recognized for TCPIP and DNS server

2014-07-01 Thread mf db
Hi, Cross posted to mvs oe tcpip-l linux. We have an application which used to run even without specifying SYSTCPD DD statement since it used to get the environment from USS. Now recently its not recognising the USS ENV but we have to specify SYSTCPD DD statement. Any idea what would gone wrong h

Re: Netstat Grep Port Range

2014-07-01 Thread Mauro Souza
Stuart's email got base64'd, so I decoded it below: Tomas, Well then, if IPV6 concerned you, then you might wish to use this instead: awk -v lower=2 -v upper=65000 'NR > 2 {n=split($5,a,":"); if (a[n] >= lower && a[n] <= upper) print a[n];}' <<<"$(netstat -tn)" Very Respectfully, Stuart

Re: Netstat Grep Port Range

2014-07-01 Thread Tener, Stuart (ITS)
<6286054842037442b271c4ae64b55fb014d7f...@usilms112b.ca.com> In-Reply-To: <6286054842037442b271c4ae64b55fb014d7f...@usilms112b.ca.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [204.115.33.236] x-microsoft-antispam:

Re: Netstat Grep Port Range

2014-07-01 Thread Pavelka, Tomas
> 'NR > 2 {split($5,a,":"); One thing you should watch out for is that the IP address could be an IPv6. In that case, you cannot split by ":" because there may be many ":" in the address. So you would need something that parses out the number after the last colon in field 5. But I'm not really

Re: Netstat Grep Port Range

2014-07-01 Thread Mauro Souza
Really, my one-liner was a dirty cheap one-time-only solution Now I have a better one on my pocket! Mauro http://mauro.limeiratem.com - registered Linux User: 294521 Scripture is both history, and a love letter from God. 2014-07-01 9:21 GMT-03:00 Tener, Stuart (ITS) : > Mauro, > > T

Re: Netstat Grep Port Range

2014-07-01 Thread Tener, Stuart (ITS)
Mauro, That seems to require far more cpu utilization than something like this (presuming that one is looking only for ports on IPV4): awk -v lower=2 -v upper=65000 'NR > 2 {split($5,a,":"); if (a[2] >= lower && a[2] <= upper) print a[2];}' <<<"$(netstat -tn -A inet)" Very Respect

Re: Netstat Grep Port Range

2014-07-01 Thread Mauro Souza
Something like this? netstat -tn | awk 'NR>2{print $5}' | grep $( echo -e\ :{2..22000} ) Mauro http://mauro.limeiratem.com - registered Linux User: 294521 Scripture is both history, and a love letter from God. 2014-06-30 22:27 GMT-03:00 Jake anderson : > Hi, > > Is there a command to show