aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawktexi.in
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gawktexi.in')
-rw-r--r--doc/gawktexi.in26
1 files changed, 23 insertions, 3 deletions
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 7e40bc5f..0046bf57 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -54,7 +54,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
@@ -280,13 +280,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 &copy; 1989, 1991, 1992, 1993, 1996&ndash;2005, 2007, 2009&ndash;2019
+<literallayout class="normal">Copyright &copy; 1989, 1991, 1992, 1993, 1996&ndash;2005, 2007, 2009&ndash;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
@@ -25997,6 +25997,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