On Thu, Apr 16, 2009 at 1:05 AM, Eric Blake <e...@byu.net> 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.


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to