Your message dated Wed, 7 Oct 2015 16:34:39 +0100
with message-id <[email protected]>
and subject line Re: Bug#801222: sort doesn't sort properly
has caused the Debian Bug report #801222,
regarding sort doesn't sort properly
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
801222: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801222
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: coreutils
Version: 8.23-4
for example You have a file (attached):
$ cat file.test.txt
101 160B5393
101 2A73C7652
101 2C07190F7
100 53F9F0D8
10 12A0040C8
101 28F97E7A6
100 5C87DC23
101 2C793F80D
100 AF0378DE
101 2B32E3B09
101 184B53583
10 11062616C
101 15E4EEA10
101 24D54B3
101 28B0E9BA0
100 57160B47
101 2901E477E
You can sort it by perl:
$ cat sort.pl
#!/usr/bin/perl
@lines = <>;
print for sort @lines;
$ perl sort.pl < file.test.txt
10 11062616C
10 12A0040C8
100 53F9F0D8
100 57160B47
100 5C87DC23
100 AF0378DE
101 15E4EEA10
101 160B5393
101 184B53583
101 24D54B3
101 28B0E9BA0
101 28F97E7A6
101 2901E477E
101 2A73C7652
101 2B32E3B09
101 2C07190F7
101 2C793F80D
If You try to use `sort` from `coreutils`, You have unexpected result:
$ sort < file.test.txt
100 53F9F0D8
100 57160B47
100 5C87DC23
100 AF0378DE
10 11062616C
101 15E4EEA10
101 160B5393
101 184B53583
101 24D54B3
101 28B0E9BA0
101 28F97E7A6
101 2901E477E
10 12A0040C8
101 2A73C7652
101 2B32E3B09
101 2C07190F7
101 2C793F80D
Debian Release: 8.0
APT prefers stable
APT policy: (990, 'stable'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armel
Kernel: Linux 4.1.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages coreutils depends on:
ii libacl1 2.2.52-2
ii libattr1 1:2.4.47-2
ii libc6 2.19-18
ii libselinux1 2.3-2
coreutils recommends no packages.
coreutils suggests no packages.
--
. ''`. Dmitry E. Oboukhov
: :’ : email: [email protected] jabber://[email protected]
`. `~’ GPGKey: 1024D / F8E26537 2006-11-21
`- 1B23 D4F8 8EC0 D902 0555 E438 AB8C 00CF F8E2 6537
101 160B5393
101 2A73C7652
101 2C07190F7
100 53F9F0D8
10 12A0040C8
101 28F97E7A6
100 5C87DC23
101 2C793F80D
100 AF0378DE
101 2B32E3B09
101 184B53583
10 11062616C
101 15E4EEA10
101 24D54B3
101 28B0E9BA0
100 57160B47
101 2901E477E
signature.asc
Description: Digital signature
--- End Message ---
--- Begin Message ---
On 07/10/15 15:34, Dmitry E. Oboukhov wrote:
> Package: coreutils
> Version: 8.23-4
>
> for example You have a file (attached):
>
> $ cat file.test.txt
> 101 160B5393
> 101 2A73C7652
> 101 2C07190F7
> 100 53F9F0D8
> 10 12A0040C8
> 101 28F97E7A6
> 100 5C87DC23
> 101 2C793F80D
> 100 AF0378DE
> 101 2B32E3B09
> 101 184B53583
> 10 11062616C
> 101 15E4EEA10
> 101 24D54B3
> 101 28B0E9BA0
> 100 57160B47
> 101 2901E477E
>
> You can sort it by perl:
>
> $ cat sort.pl
> #!/usr/bin/perl
>
> @lines = <>;
> print for sort @lines;
>
> $ perl sort.pl < file.test.txt
> 10 11062616C
> 10 12A0040C8
> 100 53F9F0D8
> 100 57160B47
> 100 5C87DC23
> 100 AF0378DE
> 101 15E4EEA10
> 101 160B5393
> 101 184B53583
> 101 24D54B3
> 101 28B0E9BA0
> 101 28F97E7A6
> 101 2901E477E
> 101 2A73C7652
> 101 2B32E3B09
> 101 2C07190F7
> 101 2C793F80D
>
> If You try to use `sort` from `coreutils`, You have unexpected result:
>
> $ sort < file.test.txt
> 100 53F9F0D8
> 100 57160B47
> 100 5C87DC23
> 100 AF0378DE
> 10 11062616C
> 101 15E4EEA10
> 101 160B5393
> 101 184B53583
> 101 24D54B3
> 101 28B0E9BA0
> 101 28F97E7A6
> 101 2901E477E
> 10 12A0040C8
> 101 2A73C7652
> 101 2B32E3B09
> 101 2C07190F7
> 101 2C793F80D
>
>
> Debian Release: 8.0
> APT prefers stable
> APT policy: (990, 'stable'), (500, 'unstable'), (1, 'experimental')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386, armel
>
> Kernel: Linux 4.1.0-2-amd64 (SMP w/4 CPU cores)
> Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: sysvinit (via /sbin/init)
>
> Versions of packages coreutils depends on:
> ii libacl1 2.2.52-2
> ii libattr1 1:2.4.47-2
> ii libc6 2.19-18
> ii libselinux1 2.3-2
>
> coreutils recommends no packages.
>
> coreutils suggests no packages.
>
spaces are being ignored in your locale.
Either, sort each field separately: sort -k1,1 -k2,2
Or use the C locale: LC_ALL=C sort
thanks,
Pádraig.
--- End Message ---