summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2016-11-05 12:16:34 +0000
committerPádraig Brady <P@draigBrady.com>2016-11-05 12:16:34 +0000
commit5161effd835167c113037aaec2e874d76f566c2c (patch)
tree9555640ae14504088f573704134d986e11958ffa
parent9ad400f1adfcb90289107afcbc49469560ba14b5 (diff)
downloadcoreutils-5161effd835167c113037aaec2e874d76f566c2c.tar.xz
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
-rw-r--r--doc/coreutils.texi7
1 files changed, 5 insertions, 2 deletions
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