GNU bug report logs - #24929
comm enhancement proposal: --print-summary --quiet

Previous Next

Package: coreutils;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sat, 12 Nov 2016 09:46:02 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-coreutils <at> gnu.org
Subject: comm enhancement proposal: --print-summary --quiet
Date: Sat, 12 Nov 2016 07:24:35 +0800
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.




This bug report was last modified 6 years and 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.