Bug 1304071 - possible sort bug
Summary: possible sort bug
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 22
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-02 19:31 UTC by George R. Goffe
Modified: 2016-02-03 08:23 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-03 08:23:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description George R. Goffe 2016-02-02 19:31:58 UTC
Description of problem:
sorting files produces error message for "-S 3g" but NOT for "-S3g".

Version-Release number of selected component (if applicable):
sort 8.23 (coreutils-8.23-11.fc22.x86_64)

How reproducible:
always

Steps to Reproduce:
1.see additional info
2.
3.

Actual results:


Expected results:


Additional info:

# this seems to work

sort -T $sorttmp -S"3g" -uk1 | egrep -v '^$' | egrep '\.com' < 1000s > 1000s.srtd

# this does not note the blank after "-S"

sort -T $sorttmp -S "3g" -uk1 | egrep -v '^$' | egrep '\.com' < 1000s > 1000s.srtd

sort: cannot read: 3g: No such file or directory

which sort

/bin/sort

sort --version
sort (GNU coreutils) 8.23
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.

Comment 1 Kamil Dudka 2016-02-03 08:23:33 UTC
(In reply to George R. Goffe from comment #0)
> # this seems to work
> 
> sort -T $sorttmp -S"3g" -uk1 | egrep -v '^$' | egrep '\.com' < 1000s >
> 1000s.srtd

I guess the only problem is that $sorttmp expands to an empty string.  So in the above case "-S3g" is consumed as an operand of the -T option.

> # this does not note the blank after "-S"
> 
> sort -T $sorttmp -S "3g" -uk1 | egrep -v '^$' | egrep '\.com' < 1000s >
> 1000s.srtd
> 
> sort: cannot read: 3g: No such file or directory

In this case, only "-S" is consumed as operand of the -T option.  So the string "3g" is interpreted as an input file.


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