aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-01-01 22:33:00 +0200
committerArnold D. Robbins <arnold@skeeve.com>2020-01-01 22:33:00 +0200
commit3611609a48ea18cebb51a195bc32f7dbb7209d6e (patch)
treeb48bd436bbe9e8b94fc6f8916110f7f291069e11 /doc/gawk.texi
parent2e428edc2cff833784ab9970f0f59a8c639a57e3 (diff)
downloadegawk-3611609a48ea18cebb51a195bc32f7dbb7209d6e.tar.gz
egawk-3611609a48ea18cebb51a195bc32f7dbb7209d6e.tar.bz2
egawk-3611609a48ea18cebb51a195bc32f7dbb7209d6e.zip
Doc update.
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi26
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 &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
@@ -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