Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Comparing to 3 data

$
0
0
Code:

# cat list.txt
server1
server2
server3
server4

# data to be compared of.
#dns address
1.1.1.1

2.2.2.2

3.3.3.3


#for i in `cat list.txt`
do
grep dns $ i
done

Desired output:
Code:

#cat server1|grep dns
1.2.3.4

Then it will send an email that dns is different, not equal to 1.1.1.1 , 2.2.2.2 and 3.3.3.3

---------- Post updated at 10:52 PM ---------- Previous update was at 10:20 PM ----------

done,,we may clsed this

Viewing all articles
Browse latest Browse all 16232

Trending Articles