bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Addendum: Possible Bug in comm ?


From: Bob Proulx
Subject: Re: Addendum: Possible Bug in comm ?
Date: Wed, 13 Sep 2006 22:37:35 -0600
User-agent: Mutt/1.5.9i

Joseph A. Wiencko, Jr. wrote:
> The expected behavior (instead of the anomalous behavior) occurs in a 
> bash script when the following statement is included:
> 
> export LC_ALL=POSIX

I don't see that when I tried your test case.  But my locale may be
different than the one you are currently using.  By setting the locale
you are affecting the real and apparent sorted status of the files.

> But why would the other behavior ever be desired, even if LC_ALL=POSIX 
> is not specified?

The comm program requires that the files be sorted.  By specifying the
files in an unsorted order it caused comm to behave differently than
it would on a sorted file.  Sorted is defined by the locale.

File a:
  4
  -

File b:
  5
  -

The files were not sorted in the current locale.  Try this:

  LC_ALL=en_US.UTF-8 sort a
  -
  4

  LC_ALL=C sort a
  -
  4

  sort -o a a
  sort -o b b
  comm a b
                  -
  4
          5

By the way, thank you for making such a nice small test case.  That
was perfect.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]