mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
doc: fix awk example for getting penultimate field
* doc/coreutils.texi (cut invocation): Add required brackets. Fixes http://bugs.gnu.org/26519
This commit is contained in:
1 parent
ba5fe2d4b8
commit
8d34b455f8
1 file changed
+3
-3
+3
-3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user