Karl Riauba
2018-08-22 23:32:03 UTC
Hi,
I think I found egrep bug.
No tabs in example file or in variable.
10.193.132.65:9102 should suppose to be filtered out, but it doesn't.
Thanks
$ echo ===$egrep===
=== 10.193.132.65:9102 | 10.193.132.65:111 | 10.193.132.65:4560 |
10.193.132.65:2800 | 10.193.132.65:4369 | 10.193.132.65:22 |
10.193.132.65:8888 | 10.193.132.65:8088 | 10.193.132.65:8089 |
10.193.132.65:38012 | 10.193.132.65:8126 | 10.193.132.65:5280 |
10.193.132.65:39073 | 10.193.132.65:8834 | 10.193.132.65:2850 |
10.193.132.65:41187 | 10.193.132.65:5285 | 10.193.132.65:9125 |
10.193.132.65:5222 | 10.193.132.65:5287 | 10.193.132.65:5223 |
10.193.132.65:35848 ===
***@gamesvc-2-001.dev.qa.las1:~
$ cat egrep_bug
tcp 0 0 0.0.0.0:9102 0.0.0.0:* LISTEN
12160/statsd_export
tcp 0 0 0.0.0.0:9125 0.0.0.0:* LISTEN
12160/statsd_export
tcp 0 0 10.193.132.65:9102 10.196.128.42:46852
ESTABLISHED 12160/statsd_export
udp 0 0 0.0.0.0:9125 0.0.0.0:*
12160/statsd_export
unix 3 [ ] STREAM CONNECTED 47777
12160/statsd_export
***@gamesvc-2-001.dev.qa.las1:~
$ cat egrep_bug | egrep -v "$egrep"
tcp 0 0 0.0.0.0:9102 0.0.0.0:* LISTEN
12160/statsd_export
tcp 0 0 0.0.0.0:9125 0.0.0.0:* LISTEN
12160/statsd_export
tcp 0 0 10.193.132.65:9102 10.196.128.42:46852
ESTABLISHED 12160/statsd_export
udp 0 0 0.0.0.0:9125 0.0.0.0:*
12160/statsd_export
unix 3 [ ] STREAM CONNECTED 47777
12160/statsd_export
***@gamesvc-2-001.dev.qa.las1:~
$
I think I found egrep bug.
No tabs in example file or in variable.
10.193.132.65:9102 should suppose to be filtered out, but it doesn't.
Thanks
$ echo ===$egrep===
=== 10.193.132.65:9102 | 10.193.132.65:111 | 10.193.132.65:4560 |
10.193.132.65:2800 | 10.193.132.65:4369 | 10.193.132.65:22 |
10.193.132.65:8888 | 10.193.132.65:8088 | 10.193.132.65:8089 |
10.193.132.65:38012 | 10.193.132.65:8126 | 10.193.132.65:5280 |
10.193.132.65:39073 | 10.193.132.65:8834 | 10.193.132.65:2850 |
10.193.132.65:41187 | 10.193.132.65:5285 | 10.193.132.65:9125 |
10.193.132.65:5222 | 10.193.132.65:5287 | 10.193.132.65:5223 |
10.193.132.65:35848 ===
***@gamesvc-2-001.dev.qa.las1:~
$ cat egrep_bug
tcp 0 0 0.0.0.0:9102 0.0.0.0:* LISTEN
12160/statsd_export
tcp 0 0 0.0.0.0:9125 0.0.0.0:* LISTEN
12160/statsd_export
tcp 0 0 10.193.132.65:9102 10.196.128.42:46852
ESTABLISHED 12160/statsd_export
udp 0 0 0.0.0.0:9125 0.0.0.0:*
12160/statsd_export
unix 3 [ ] STREAM CONNECTED 47777
12160/statsd_export
***@gamesvc-2-001.dev.qa.las1:~
$ cat egrep_bug | egrep -v "$egrep"
tcp 0 0 0.0.0.0:9102 0.0.0.0:* LISTEN
12160/statsd_export
tcp 0 0 0.0.0.0:9125 0.0.0.0:* LISTEN
12160/statsd_export
tcp 0 0 10.193.132.65:9102 10.196.128.42:46852
ESTABLISHED 12160/statsd_export
udp 0 0 0.0.0.0:9125 0.0.0.0:*
12160/statsd_export
unix 3 [ ] STREAM CONNECTED 47777
12160/statsd_export
***@gamesvc-2-001.dev.qa.las1:~
$