GNU bug report logs -
#24881
make blindingly clear cut -f 2,1 = cut -f 1,2
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24881 in the body.
You can then email your comments to 24881 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#24881
; Package
coreutils
.
(Sat, 05 Nov 2016 11:32:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Sat, 05 Nov 2016 11:32:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
$ info cut
‘-f FIELD-LIST’
‘--fields=FIELD-LIST’
Select for printing only the fields listed in FIELD-LIST. Fields
are separated by a TAB character by default. Also print any line
that contains no delimiter character, unless the ‘--only-delimited’
(‘-s’) option is specified.
Note ‘awk’ supports more sophisticated field processing, and by
default will use (and discard) runs of blank characters to separate
fields, and ignore leading and trailing blanks.
awk '{print $2}' # print the second field
awk '{print $NF-1}' # print the penultimate field
awk '{print $2,$1}' # reorder the first two fields
Mention here:
whereas cut -f 2,1 will just give you the same output as cut -f 1,2
Thanks.
In the unlikely event that ‘awk’ is unavailable, one can use the
‘join’ command, to process blank characters as ‘awk’ does above.
join -a1 -o 1.2 - /dev/null # print the second field
join -a1 -o 1.2,1.1 - /dev/null # reorder the first two fields
Reply sent
to
Pádraig Brady <P <at> draigBrady.com>
:
You have taken responsibility.
(Sat, 05 Nov 2016 12:20:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
:
bug acknowledged by developer.
(Sat, 05 Nov 2016 12:20:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 24881-done <at> debbugs.gnu.org (full text, mbox):
On 05/11/16 11:31, 積丹尼 Dan Jacobson wrote:
> $ info cut
>
> ‘-f FIELD-LIST’
> ‘--fields=FIELD-LIST’
> Select for printing only the fields listed in FIELD-LIST. Fields
> are separated by a TAB character by default. Also print any line
> that contains no delimiter character, unless the ‘--only-delimited’
> (‘-s’) option is specified.
>
> Note ‘awk’ supports more sophisticated field processing, and by
> default will use (and discard) runs of blank characters to separate
> fields, and ignore leading and trailing blanks.
> awk '{print $2}' # print the second field
> awk '{print $NF-1}' # print the penultimate field
> awk '{print $2,$1}' # reorder the first two fields
>
>
> Mention here:
> whereas cut -f 2,1 will just give you the same output as cut -f 1,2
> Thanks.
Pushed at
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.25-86-g5161eff
thanks,
Pádraig
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 03 Dec 2016 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 204 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.