From 5161effd835167c113037aaec2e874d76f566c2c Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Sat, 5 Nov 2016 12:16:34 +0000 Subject: doc: clarify in texinfo that cut doesn't reorder fields * doc/coreutils.texi (cut invocation): Clarify the more sophisticated field processing supported by awk(1). Fixes http://bugs.gnu.org/24881 --- doc/coreutils.texi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 927e552ab..839af8871 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -5864,8 +5864,9 @@ line that contains no delimiter character, unless the @option{--only-delimited} (@option{-s}) option is specified. Note @command{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. +like reordering fields, and handling non fixed width fields. +By default @command{awk} uses (and discards) runs of blank characters +to separate fields, and ignores leading and trailing blanks. @example @verbatim awk '{print $2}' # print the second field @@ -5873,6 +5874,8 @@ awk '{print $NF-1}' # print the penultimate field awk '{print $2,$1}' # reorder the first two fields @end verbatim @end example +Note while @command{cut} accepts field specifications in +arbitrary order, output is always in the order encountered in the file. In the unlikely event that @command{awk} is unavailable, one can use the @command{join} command, to process blank -- cgit v1.2.3-54-g00ecf