Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/historical/nawk/bin awk(1): Another echo(1) example...



details:   https://anonhg.NetBSD.org/src/rev/a7adf7087634
branches:  trunk
changeset: 368327:a7adf7087634
user:      uwe <uwe%NetBSD.org@localhost>
date:      Tue Jul 05 17:58:47 2022 +0000

description:
awk(1): Another echo(1) example that demonstrates field assignment

diffstat:

 external/historical/nawk/bin/awk.1 |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 16e029130737 -r a7adf7087634 external/historical/nawk/bin/awk.1
--- a/external/historical/nawk/bin/awk.1        Tue Jul 05 16:59:41 2022 +0000
+++ b/external/historical/nawk/bin/awk.1        Tue Jul 05 17:58:47 2022 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: awk.1,v 1.26 2022/07/05 16:59:41 uwe Exp $
+.\"    $NetBSD: awk.1,v 1.27 2022/07/05 17:58:47 uwe Exp $
 .\"
 .\" Copyright (C) Lucent Technologies 1997
 .\" All Rights Reserved
@@ -788,6 +788,12 @@
 }
 .Ed
 .Pp
+Another way to do the same that demonstrates field assignment and
+.Li $ Ns Va 0
+re-evaluation:
+.Pp
+.Dl BEGIN { for (i = 1; i < ARGC; ++i) $i = ARGV[i]; print }
+.Pp
 Print an error message to standard error:
 .Bd -literal -offset indent
 { print "error!" > "/dev/stderr" }



Home | Main Index | Thread Index | Old Index