linux - Need help in file filtering -


i have list of host names in file , 1 more file complete host names details in file b.i want remove hosts matches hosts in b file.any short script this?please let me know.

ex:

cat  server1 server2 server3 server4   cat b server700 server1 server300 server4  

so here in , b ,server1 , server4 matching,so need script removes matching servers names fromb in file

something on these lines might out. adjust regular expression on grep command sure match hostnames on details file:

cat file_with_hostnames | while read hname; grep -q "$hname" file_with_host_details || echo $hname; done 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -