The stupid question is the question not asked | |
PerlMonks |
Re^3: (thoughts on) Detect common lines between two files, one liner from shellby Anonymous Monk |
on Dec 23, 2004 at 18:31 UTC ( [id://417182]=note: print w/replies, xml ) | Need Help?? |
This should also work for an arbitrary number of files, which AFAIK has no equivalent UNIX command. To show common lines in 4 files:
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /32+1+0$/' fileA fileB fileC fileD
In Section
Cool Uses for Perl
|
|