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}
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
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
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
<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:
> '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
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
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
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