GNU bug report logs -
#38908
Bug on comm or sort
Previous Next
Reported by: Saint Michael <venefax <at> gmail.com>
Date: Sat, 4 Jan 2020 00:30:01 UTC
Severity: normal
Tags: notabug
Done: Bernhard Voelker <mail <at> bernhard-voelker.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 2020-01-04 01:28, Saint Michael wrote:
> I am trying to use the comm utility to compare two list of IP addresses,
> sorted with regular sort (not -n), and the result is erroneous. I could not
> find the answer in Google.
>
> list1=
> 208.78.161.18
> 208.78.161.19
> 208.78.161.20
> 208.78.161.206
> 208.78.161.207
> 208.78.161.21
> 208.78.161.22
> 208.78.161.224
> 208.78.161.226
> 208.78.161.227
>
> list2
> 208.78.161.17
> 208.78.161.18
> 208.78.161.19
> 208.78.161.20
> 208.78.161.206
> 208.78.161.207
> 208.78.161.21
> 208.78.161.22
> 208.78.161.224
> 208.78.161.226
> This command should work
> comm -12 --check-order <(sort list1.txt) <(sort list2.txt)
> my environment
> export LC_ALL=C
> export LANG=en_US.UTF-8
> export LC_CTYPE="en_US.UTF-8"
> export LC_COLLATE=C
>
> why these lists are no being compared correctly?
Unfortunately, you did not mention the actual output of the
above command (and what exactly you think is wrong with it),
nor did you mention an error message.
Here, it gives (without error):
$ comm -12 --check-order <(sort list1.txt) <(sort list2.txt)
208.78.161.18
208.78.161.19
208.78.161.20
208.78.161.206
208.78.161.207
208.78.161.21
208.78.161.22
208.78.161.224
208.78.161.226
which looks good, and BTW is identical with the output of
$ sort list1.txt list2.txt | uniq -d
Have a nice day,
Berny
This bug report was last modified 5 years and 233 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.