Find the answer to your Linux question:
Results 1 to 2 of 2
The manual page for command "sort" says: *** WARNING *** The locale specified by the environment affects sort order. Set LC_ALL=C to get the traditional sort order that uses native ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2013
    Posts
    25

    The SUSE specification of sort order


    The manual page for command "sort" says:

    *** WARNING *** The locale specified by the environment
    affects sort order. Set LC_ALL=C to get the traditional sort
    order that uses native byte values.

    But

    Code:
    matslinux-7bll:~> echo $LC_ALL
    
    matslinux-7bll:~> sort < sort_prov
    a
    A
    b
    c
    C
    matslinux-7bll:~> LC_ALL=C
    matslinux-7bll:~> echo $LC_ALL
    C
    matslinux-7bll:~> sort < sort_prov
    a
    A
    b
    c
    C
    1
    The parameter "LC_ALL" is by default empty
    2
    By default the native byte values are not used
    3
    Setting "LC_ALL=C" does not change the sort order

    Explanation? How to get the native byte sorting order?

  2. #2
    Just Joined!
    Join Date
    Sep 2013
    Posts
    25
    It was the command "export" that was missing! Necessary to make the parameter known to the sub-shell where "sort" is running

    Code:
    mats@linux-7bll:~> LC_ALL=C
    mats@linux-7bll:~> export LC_ALL
    mats@linux-7bll:~> sort < sort_prov
    A
    C
    a
    b
    c
    mats@linux-7bll:~>
    Last edited by skitgubbe; 09-28-2013 at 12:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •