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