RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1255107 - Sort command sorts on the whole line when it should sort on first column.
Summary: Sort command sorts on the whole line when it should sort on first column.
Keywords:
Status: CLOSED DUPLICATE of bug 1148347
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: coreutils
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Ondrej Vasik
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-19 16:12 UTC by Ashkan
Modified: 2015-08-19 20:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-19 20:30:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
CentOS 9289 0 None None None Never

Description Ashkan 2015-08-19 16:12:41 UTC
Description of problem:
While sorting files, sometimes sort command sorts the whole line even if it is used like sort -k1,1 and there are spaces in the file.

Version-Release number of selected component (if applicable):


How reproducible:
Always reproducible

Steps to Reproduce:
Create a file with this content:
a
b
B
A

Another file with this content:
a 1
b 0
B 1
A 0

Use sort -k1,1 filename to sort the files the first one results in

Actual results:
sorting result of first file:
a
A
b
B

sorting result of second file:
A 0
a 1
b 0
B 1


Expected results:
Note that in the first result a is before A and in the second a is after A. It shouldn't be different. Either the first result should be:
A
a
b
B

Or the second result should be:
a 1
A 0
b 0
B 1

It just needed to be consistent across both files.

Additional info:
Centos-7.0-1406-x86_64
sort version: 8.22
LC_COLLATE is not set.
LC_ALL is not set.
LANG is set to en_US.UTF-8
LC_CTYPE is not set.

Comment 2 Ondrej Vasik 2015-08-19 20:30:13 UTC
I believe this is a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1148347 .
Actually, when using LC_ALL=C sort , you will get consistent sort results even with current coreutils (however, different from your expectations).

*** This bug has been marked as a duplicate of bug 1148347 ***


Note You need to log in before you can comment on or make changes to this bug.