From: Bo Rydberg Date: Mon, 17 Apr 2017 02:07:49 +0000 (-0700) Subject: doc: fix awk example for getting penultimate field X-Git-Tag: v8.28~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d34b455f80678125b0fb6edcde2dab66986cc5d;p=thirdparty%2Fcoreutils.git doc: fix awk example for getting penultimate field * doc/coreutils.texi (cut invocation): Add required brackets. Fixes http://bugs.gnu.org/26519 --- 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