GNU bug report logs - #23922
cut fails for non-delimited input lines with -f 2

Previous Next

Package: coreutils;

Reported by: Jens Mueller <jens.k.mueller <at> gmx.de>

Date: Fri, 8 Jul 2016 23:37:01 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jens Mueller <jens.k.mueller <at> gmx.de>
To: 23922 <at> debbugs.gnu.org
Subject: bug#23922: cut fails for non-delimited input lines with -f 2
Date: Sat, 9 Jul 2016 01:05:22 +0200
Hi,

I'd like to report the following behavior of cut.
I execute

$ echo "abc" | cut -f 2 -d " "

and I expect the empty line as output but you get "abc\n".
I believe the empty line is correct because I selected the second
field which is empty.
If you select the 3rd field

$ echo "abc cde" | cut -f 3 -d " "

it outputs the empty line and works as expected which supports my
reasoning.

I am running Debian with

$ cut --version | head -1
cut (GNU coreutils) 8.25

Jens




This bug report was last modified 6 years and 206 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.