what the best way to find duplicate IP from file ( I have ksh script in this script I need to write function that check for duplicate IP )
for example if IP - 192.1926.23.52 exists twice in file - config_IP.txt then need to print "duplicate IP - xxx.xxx.xxx.xxx"
- solution can be with ksh or perl one liner , sed ,awk etc
the format of the file should be as the following:
more config_IP.txt
# NETWORK adminstration
192.192.23.150 192.192.23.120
192.192.23.152 192.192.23.52
192.192.23.153 192.192.23.53
192.192.23.154 192.192.23.54
#NETWORK private
192.192.23.170 192.192.23.122
192.192.23.172 192.192.23.126
192.192.23.174 192.192.23.123
192.192.23.177 192.192.23.121
# NETWORK oracle internal
152.3.4.12 152.3.4.12
152.3.4.14 152.3.4.16
# NETWORK oracle ext
152.3.4.10 152.3.4.19