From 3611609a48ea18cebb51a195bc32f7dbb7209d6e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 1 Jan 2020 22:33:00 +0200 Subject: Doc update. --- doc/gawk.texi | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'doc/gawk.texi') diff --git a/doc/gawk.texi b/doc/gawk.texi index 9a62fb8d..51bb1d53 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -59,7 +59,7 @@ @c applies to and all the info about who's publishing this edition @c These apply across the board. -@set UPDATE-MONTH September, 2019 +@set UPDATE-MONTH January, 2020 @set VERSION 5.1 @set PATCHLEVEL 0 @@ -285,13 +285,13 @@ Fax: +1-617-542-2652 Email: gnu@@gnu.org URL: https://www.gnu.org/ -Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2019 +Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2020 Free Software Foundation, Inc. All Rights Reserved. @end docbook @ifnotdocbook -Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2019 @* +Copyright @copyright{} 1989, 1991, 1992, 1993, 1996--2005, 2007, 2009--2020 @* Free Software Foundation, Inc. @end ifnotdocbook @sp 2 @@ -26987,6 +26987,26 @@ print data[lines[i]], lines[i] This works because @code{data[$0]} is incremented each time a line is seen. +@c rick@openfortress.nl, Tue, 24 Dec 2019 13:43:06 +0100 +Rick van Rein offers the following one-liner to do the same job of +removing duplicates from unsorted text: + +@example +awk '@{ if (! seen[$0]++) print @}' +@end example + +This can be simplified even further, at the risk of becoming +almost too obscure: + +@example +awk '! seen[$0]++' +@end example + +@noindent +This version uses the expression as a pattern, relying on +@command{awk}'s default action of printing the line when +the pattern is true. + @node Extract Program @subsection Extracting Programs from Texinfo Source Files -- cgit v1.2.3