Article 6R65W [SOLVED] [BASH] grep literally the whole word only and nothing more?

[SOLVED] [BASH] grep literally the whole word only and nothing more?

by
czezz
from LinuxQuestions.org on (#6R65W)
From the following list, I want to remove all IP addresses that have the same value as subnets.

Code:cat input.out
192.168.1.208
192.168.1.208/32
192.168.1.213/32
192.168.1.214/32
192.168.1.253/32
192.168.1.254
192.168.1.254/28
192.168.1.245/32
192.168.1.180
192.168.1.181For that I am using "w" flag in grep to match the whole word.
That however, is also matching addresses with subnet.

Code:cat input.out | grep -Evw "192.168.1.208|192.168.1.254"
192.168.1.213/32
192.168.1.214/32
192.168.1.253/32
192.168.1.245/32
192.168.1.180
192.168.1.181Question:
How can i filter out IP addresses that have the same value as subnets and keep the ones with subnet?
This is what I am trying to get.

Code:192.168.1.208/32
192.168.1.213/32
192.168.1.214/32
192.168.1.253/32
192.168.1.254/28
192.168.1.245/32
192.168.1.180
192.168.1.181
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments