bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug On CUT


From: James Youngman
Subject: Re: Bug On CUT
Date: Fri, 17 Apr 2009 10:22:08 +0100

On Thu, Apr 16, 2009 at 1:05 AM, Eric Blake <address@hidden> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Ar3s on 4/15/2009 5:25 PM:
>>
>> echo "a"|cut --delimiter=" " --fields=2-
>> I have assumed that it would return an empty string
>> but it returns a
>>
>> Is it normal or is it a bug in the matrix ?
>
> Not a bug.  According to POSIX, when -f (--fields) is in effect, "Lines
> with no field delimiters shall be passed through intact, unless -s is
> specified."
>
> http://www.opengroup.org/onlinepubs/9699919799/utilities/cut.html

Indeed, the Texinfo documentation for cut also indicates this:

       -s, --only-delimited
              do not print lines not containing delimiters

FWIW, I've used cut for years and years and didn't know about this feature.

James.




reply via email to

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