From 8d34b455f80678125b0fb6edcde2dab66986cc5d Mon Sep 17 00:00:00 2001 From: Bo Rydberg Date: Sun, 16 Apr 2017 19:07:49 -0700 Subject: [PATCH] doc: fix awk example for getting penultimate field * doc/coreutils.texi (cut invocation): Add required brackets. Fixes http://bugs.gnu.org/26519 --- doc/coreutils.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 284e7e36b0..0bbb9e966f 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -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 -- 2.47.3