in reply to Comparing strings in 2 files.

Since TIMTOWTDI, here's a slight variation on one of my favorite one-liners (original by merlyn): perl -ne 'print if ($seen{$_} .= @ARGV && /^Query:/) =~ /10$/' fileA fileB > output