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: revert changes to exampl...
details: https://anonhg.NetBSD.org/src/rev/eb047ec19bb0
branches: trunk
changeset: 368307:eb047ec19bb0
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Jul 04 18:07:41 2022 +0000
description:
awk.1: revert changes to example 'echo' program
I had removed the exit statement in the strong belief that POSIX had
specified that an AWK program consisting of only a BEGIN block would
implicitly exit after the BEGIN block. This assumption was wrong.
There are several implementations that implement this special case
though.
https://mail-index.netbsd.org/source-changes-d/2022/07/03/msg013718.html
diffstat:
external/historical/nawk/bin/awk.1 | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diffs (34 lines):
diff -r 2cf2cd1d36c3 -r eb047ec19bb0 external/historical/nawk/bin/awk.1
--- a/external/historical/nawk/bin/awk.1 Mon Jul 04 15:09:12 2022 +0000
+++ b/external/historical/nawk/bin/awk.1 Mon Jul 04 18:07:41 2022 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: awk.1,v 1.9 2022/07/03 10:56:22 rillig Exp $
+.\" $NetBSD: awk.1,v 1.10 2022/07/04 18:07:41 rillig Exp $
.\"
.\" Copyright (C) Lucent Technologies 1997
.\" All Rights Reserved
@@ -22,7 +22,7 @@
.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
.\" THIS SOFTWARE.
.\"
-.Dd July 3, 2022
+.Dd December 19, 2019
.Dt AWK 1
.Os
.Sh NAME
@@ -711,11 +711,10 @@
.Pp
Simulate echo(1):
.Bd -literal -offset indent
-BEGIN {
- if (1 < ARGC) printf "%s", ARGV[1]
- for (i = 2; i < ARGC; i++) printf " %s", ARGV[i]
- printf "\en"
-}
+BEGIN { # Simulate echo(1)
+ for (i = 1; i < ARGC; i++) printf "%s ", ARGV[i]
+ printf "\en"
+ exit }
.Ed
.Pp
Print an error message to standard error:
Home |
Main Index |
Thread Index |
Old Index