bug-coreutils
[Top][All Lists]
Advanced

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

Re: Undocumented cut feature


From: Philip Rowlands
Subject: Re: Undocumented cut feature
Date: Thu, 25 Oct 2007 21:51:19 +0100 (BST)

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




reply via email to

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