bug-bash
[Top][All Lists]
Advanced

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

Re: Sort command doesn't sort '@' character correctly


From: Eli Schwartz
Subject: Re: Sort command doesn't sort '@' character correctly
Date: Thu, 20 May 2021 14:05:46 -0400

On 5/20/21 12:43 PM, Michael Jensen wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-a6qmCk/bash-5.0=. 
> -fstack-protector-stron>
> uname output: Linux ubuntu 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 
> 17:39:42 UTC 2021 x86_64 x86_>
> Machine Type: x86_64-pc-linux-gnu
> 
> Bash Version: 5.0
> Patch Level: 17
> Release Status: release
> 
> Description:
>         sorting lines where some starts with @ and some doesn't, it will not 
> sort the lines correct
> 
> Repeat-By:
> 
>         echo "xxaxxon" > test.txt
>         echo "@zorg" >> test.txt
>         echo "@jupiterlander" >> test.txt
>         cat test.txt | sort
> 
>         Note it prints out:
> 
>         @jupiterlander
>         xxaxxon
>         @zorg
> 
>         Expected:
> 
>         @jupiterlander
>         @zorg
>         xxaxxon

The "sort" utility is not part of bash, so this is the wrong mailing
list for the question.

However, you will probably find that your vendor's "sort" utility will
act as you expect, if you invoke it like this:

cat test.txt |  LC_ALL=C sort



-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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