On Fri, Sep 15, 2017 at 11:15 AM, Rob Hoelz <[email protected]> wrote:
> On Fri, 15 Sep 2017 07:03:04 -0700 (PDT)
> [email protected] wrote:
>
>> thank you
>> I have tried comm it is fast. the only thing is that I am looking to
>> one side difference.
>> I mean if file2 contains word not in file1 that will not be needed to
>> output. only if words in file1 but not in file2.
>> so I solved it by this bash script

In `comm` that's the -23 option.
Column 1 is words only in file 1.
-23 is minus 2,3, omit columns 2 (file 2 words) and 3 (both files words).

The other key to `comm` is files must be sorted by natural sort order.
So the shell command or alias needed is
    comm -23 <(sort $file1) <(sort $file2)
with modern bash <() command substitution as file-pipes.

> I'd like to recommend an alternative to comm: combine
> (https://joeyh.name/code/moreutils/).  I find its human readable
> boolean operators easier to remember than comm's numeric options!

yeah, -1 "minus one" meaning omit column one / file one only,
-3 omit column three (both files) is not very mnemonic.
It didn't take 35 years to become "natural" to me but ...
it's still not entirely natural, i just hear the author's peculiar mnemonic.

-- 
You received this message because you are subscribed to the Google Groups "ack 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/ack-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to