Hi Keith Thanks it worked like a charm. I should have been able to find this. I ended up in a mind set-up, I didn't seem to be able to get out of.
I realize it is not the best way. It just sort of evolved. You should have seen what it orginal looked like. :) david On Thu, 9 May 2002, Keith Winston wrote: > On Thu, May 09, 2002 at 03:36:45PM -0400, dbrett wrote: > > > > sort -n +2 list.txt | awk '{print $2}' | grep - list2.txt > > > > list.txt list2.txt > > server1 10.1.1.1 server1 10.1.1.1 > > server2 10.1.1.2 server2 10.1.1.2 > > server3 10.1.1.3 server3 10.1.1.3 > > ... server4 10.1.1.4 > > ... > > What I was hoping was the last grep would take the ip addresses from the > > first file search for this IP address in the second file. > > This is far from optimal, but I think you want the grep -f option. > > sort -n +2 list.txt | awk '{print $2}' > list.sorted > grep -f list.sorted list2.txt > > Best Regards, > Keith > -- > LPIC-2, MCSE, N+ > Got spam? Get spastic http://spastic.sourceforge.net > > > > _______________________________________________ > Redhat-list mailing list > [EMAIL PROTECTED] > https://listman.redhat.com/mailman/listinfo/redhat-list > _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list