]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: clarify in texinfo that cut doesn't reorder fields
authorPádraig Brady <P@draigBrady.com>
Sat, 5 Nov 2016 12:16:34 +0000 (12:16 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 5 Nov 2016 12:16:34 +0000 (12:16 +0000)
* doc/coreutils.texi (cut invocation): Clarify the more
sophisticated field processing supported by awk(1).
Fixes http://bugs.gnu.org/24881

doc/coreutils.texi

index 927e552ab67abcd33abc354356d6d3372645f5f8..839af8871442ed52197164e6037b2849e628d264 100644 (file)
@@ -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