]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: fix awk example for getting penultimate field
authorBo Rydberg <bolry@hotmail.com>
Mon, 17 Apr 2017 02:07:49 +0000 (19:07 -0700)
committerPádraig Brady <P@draigBrady.com>
Mon, 17 Apr 2017 02:10:17 +0000 (19:10 -0700)
* doc/coreutils.texi (cut invocation): Add required brackets.
Fixes http://bugs.gnu.org/26519

doc/coreutils.texi

index 284e7e36b0389f595954ebffe7744cab6157ca2f..0bbb9e966fe4040809c629a52e37ba4a56d93fa8 100644 (file)
@@ -5941,9 +5941,9 @@ 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
-awk '{print $NF-1}' # print the penultimate field
-awk '{print $2,$1}' # reorder the first two fields
+awk '{print $2}'      # print the second field
+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