GNU bug report logs - #20928
cut (v. 8.21), using -f option with a single column

Previous Next

Package: coreutils;

Reported by: "Kuchta, Tomasz" <t.kuchta12 <at> imperial.ac.uk>

Date: Mon, 29 Jun 2015 15:19:02 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Kuchta, Tomasz" <t.kuchta12 <at> imperial.ac.uk>
To: 20928 <at> debbugs.gnu.org
Subject: bug#20928: cut (v. 8.21), using -f option with a single column
Date: Mon, 29 Jun 2015 08:18:25 +0000
Hello.

I’m not sure if this is a bug - I just wanted to let you know.
Thanks,
Tomek

——

When there is more than one column and we go beyond the number of columns with the -f option, the output is empty

$ echo "test1 test2" | cut -d' ' -f1
test1
$ echo "test1 test2" | cut -d' ' -f2
test2
$ echo "test1 test2" | cut -d' ' -f3

$

—— 

When there is only one column and we go beyond 1 with the -f option, the output remains the first column

$ echo "test1" | cut -d' ' -f1
test1
$ echo "test1" | cut -d' ' -f2
test1
$ echo "test1" | cut -d' ' -f3
test1

My setup:

$ cut --version
cut (GNU coreutils) 8.21
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David M. Ihnat, David MacKenzie, and Jim Meyering.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.2 LTS
Release:	14.04
Codename:	trusty

This bug report was last modified 10 years and 27 days ago.

Previous Next


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