Please add a comm --print-summary and --quiet, so we wouldn't have to write
$ comm FILE1 FILE2|perl -nwe '
/^\t+/;
$h{ length $& || 0 }++;

END {
    @L = ( "Lines in 1st ", "Lines in 2nd ", "Lines in both" );
    printf "%s: %5d\n", $L[$_], $h{$_} for sort keys %h;
}
'
Lines in 1st :   601
Lines in 2nd :   437
Lines in both:  2417

(Which would get fooled by leading tabs in the files anyway.)
(Or add "only": 'Lines only in 1st'...)

--print-summary
        Print totals at end.

--quiet
        Suppress file content output.

In fact my formatting is ugly. Make it look like the output of
$ wc -l FILE1 FILE2

Thanks.



Reply via email to