Bug 129114 - cut can not work correctly with two file argument
Summary: cut can not work correctly with two file argument
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 158749
TreeView+ depends on / blocked
 
Reported: 2004-08-04 05:29 UTC by han pingtian
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version: 5.2.1-19
Clone Of:
Environment:
Last Closed: 2004-12-10 11:51:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description han pingtian 2004-08-04 05:29:30 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.4.1)
Gecko/20031114 MultiZilla/1.6.3.1c

Description of problem:
Where are two file:
$ cat file1
1 abc
2 def
3 ghi
4 jkl
$ cat file2
a 123
b 456
c 789
d 248
and my locale is:
$ locale
LANG=zh_CN.GB18030
LC_CTYPE=zh_CN.GB18030
LC_NUMERIC="zh_CN.GB18030"
LC_TIME=en_US.UTF-8
LC_COLLATE="zh_CN.GB18030"
LC_MONETARY="zh_CN.GB18030"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="zh_CN.GB18030"
LC_NAME="zh_CN.GB18030"
LC_ADDRESS="zh_CN.GB18030"
LC_TELEPHONE="zh_CN.GB18030"
LC_MEASUREMENT="zh_CN.GB18030"
LC_IDENTIFICATION="zh_CN.GB18030"
LC_ALL=
then when execute the command as below:
$ cut -d " " -f 1 file1 file2
always gets this result:
1
2
3
4
\n
I think this is a bug of core 1's cut's bug, but not a bug of 
coreutils. Because I download the coreutils from gnu and complie
it, the cut has no this problem.

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

How reproducible:
Always

Steps to Reproduce:
1.Create two file:
$ cat file1
1 abc
2 def
3 ghi
4 jkl
$ cat file2
a 123
b 456 
c 789
d 248
2.Set the locale to
LANG=zh_CN.GB18030
LC_CTYPE=zh_CN.GB18030
LC_NUMERIC="zh_CN.GB18030"
LC_TIME=en_US.UTF-8
LC_COLLATE="zh_CN.GB18030"
LC_MONETARY="zh_CN.GB18030"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="zh_CN.GB18030"
LC_NAME="zh_CN.GB18030"
LC_ADDRESS="zh_CN.GB18030"
LC_TELEPHONE="zh_CN.GB18030"
LC_MEASUREMENT="zh_CN.GB18030"
LC_IDENTIFICATION="zh_CN.GB18030"
LC_ALL=

3. Execute this command:
$ cut -d " " -f 1 file1 file2
    

Actual Results:  the command give this result
1
2
3
4
\n

Expected Results:  1
2
3
4
a
b
c
d

Additional info:

I think this is a bug of core 1's cut, but not a bug of 
coreutils. Because I download the coreutils from gnu and complie
it, the cut has no this problem.

Comment 1 Tim Waugh 2004-08-04 10:27:32 UTC
Fixed in CVS.

Comment 2 Tim Waugh 2004-08-04 15:20:11 UTC
Fixed package is 5.2.1-19.  Thanks for the report.

Comment 3 han pingtian 2004-08-05 02:47:30 UTC
coreutils-5.2.1-19 can not be installed on core 1, please help.

Comment 4 Tim Waugh 2004-08-05 08:43:36 UTC
It should work fine on FC1.

Comment 5 han pingtian 2004-08-06 00:55:16 UTC
# rpm -Uvh coreutils-5.2.1-19.i386.rpm 
error: Failed dependencies:
        libselinux.so.1 is needed by coreutils-5.2.1-19
        /usr/bin/kill is needed by (installed) redhat-lsb-1.3-1

Comment 6 Tim Waugh 2004-08-06 09:57:12 UTC
Reopening in case I get time to look at making an FC1 update.


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