diff options
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r-- | doc/gawk.texi | 26 |
1 files changed, 23 insertions, 3 deletions
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: <email>gnu@@gnu.org</email> URL: <ulink url="https://www.gnu.org">https://www.gnu.org/</ulink></literallayout> -<literallayout class="normal">Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2019 +<literallayout class="normal">Copyright © 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2020 Free Software Foundation, Inc. All Rights Reserved.</literallayout> @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 |