Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I pulled up the manual for <code>sort</code> and noticed the following:</p> <blockquote> <p><strong>* WARNING *</strong> The locale specified by the environment affects sort order. Set LC_ALL=C to get the traditional sort order that uses native byte values.</p> </blockquote> <p>As it turns out, locales actually specify how lexicographic ordering works for a given locale. This makes a lot of sense, but for some reason it trips over multi field files... </p> <p>(see also:)<br> <a href="https://stackoverflow.com/questions/5868465/unusual-behaviour-of-linuxs-sort-command">Unusual behaviour of linux&#39;s sort command</a><br> <a href="https://stackoverflow.com/questions/10309033/why-does-the-sort-command-sort-differently-if-there-are-trailing-fields">Why does the sort command sort differently if there are trailing fields?</a></p> <p><strong>There are a couple of things you can do:</strong></p> <p>You can sort naively by byte value using </p> <pre><code>LC_ALL="C" sort temp </code></pre> <p>This will give a more logical result, but it might not be the one you actually want.</p> <p>You could try to get sort to do a more basic lexicographical ordering by setting the locale to C and telling it you want dictionary ordering:</p> <pre><code>LC_ALL="C" sort -d temp </code></pre> <p>To have sort output your locale information and hilight the sort key, you can use</p> <pre><code>sort --debug temp </code></pre> <p><br><br><br> Personally I'm really curious to know what rule is being specified that makes sort behave unintuitively across multiple fields. </p> <p>They're supposed to specify correct lexicographic order in the given language and dialect. Do the locales' functions simply not handle the multiple field case at all, or are they taking some kind of different interpretation on the "meaning" of the line?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload