bug-coreutils
[Top][All Lists]
Advanced

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

RE: Undocumented cut feature


From: Gambs, David (CONT)
Subject: RE: Undocumented cut feature
Date: Fri, 26 Oct 2007 07:45:47 -0400

Philip,

It has been corrected in coreutils-5.2.1-31.6. As the client I am
working for is very risk adverse, it is unlikely they will upgrade the
OS/patch level unless there is a security issue.

I found the error by comparing the output files. The original feed from
vgdisplay did not have the ^M. It was not there after the egrep nor the
first cut -b23-. After the cut -f1 -d' ' the single ^M was there. It
only appeared at the end of cut field where the line consisted of a
single field at the end of the line. It did not matter if there was
leading white space or not.

Hopefully, it is not something that can slip back into the release code.
If someone wants, I can post the entire script that shows the error when
using coreutils-4.5.3-28.4. The latest coreutils I have found on any
system is the above 5.x release.


>Regards,
>David M Gambs
>Linux Engineer
>Solutions Engineering
>IBM/CapitalOne
>Int: 433-6519
>Ext: 804-284-6519
>cell: 804-201-3499

-----Original Message-----
From: Philip Rowlands [mailto:address@hidden 
Sent: Thursday, October 25, 2007 4:51 PM
To: Gambs, David (CONT)
Cc: address@hidden
Subject: Re: Undocumented cut feature

On Thu, 25 Oct 2007, Gambs, David (CONT) wrote:

> I have found a consistent "feature" in cut that is causing issues for 
> what I am trying to accomplish.
>
> I am pulling data from the system and trying to extract three pieces 
> out of that data. What I am finding is that when the field of interest

> is the last field, cut is adding a ^M to the end of the line:
>
> vgdisplay > file1
> cat file1 | egrep -e Name -e "PE Size" -e Free > file2 cut -b23- file2

> > file3 cut -f1 -d' ' > file1
>
> It is only at the last step that the ^M is added to the end of the 
> volume group name extracted.

How did you determine this? Can you give a (short) before-and-after
example run which explicitly shows cut adding spurious CRs?

> And we are at core utilities: coreutils-4.5.3-28.4

If there is a bug and it's fixed in the latest version of coreutils, the
only recourse you'll have is to petition the vendor (RedHat in this
case) to release an update, as there's nothing that the coreutils
maintainers can directly do to RHEL's packages.

It would be helpful if you were able to test with the latest
(non-snapshot) release, which can be found here: 
http://ftp.gnu.org/gnu/coreutils/coreutils-6.9.tar.bz2


Cheers,
Phil







The information contained in this e-mail is confidential and/or proprietary

to Capital One and/or its affiliates. The information transmitted herewith

is intended only for use by the individual or entity to which it is 

addressed.  If the reader of this message is not the intended recipient, 

you are hereby notified that any review, retransmission, dissemination, 

distribution, copying or other use of, or taking of any action in reliance 

upon this information is strictly prohibited. If you have received this 

communication in error, please contact the sender and delete the material 

from your computer.







reply via email to

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