Module Name: src Committed By: uwe Date: Tue Jul 5 13:29:18 UTC 2022
Modified Files: src/external/historical/nawk/bin: awk.1 Log Message: awk(1): document programs that only has BEGIN and/or END pattern-actions. Copied from POSIX, except "getline" is a statement, not a function, so call it that. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/external/historical/nawk/bin/awk.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/historical/nawk/bin/awk.1 diff -u src/external/historical/nawk/bin/awk.1:1.15 src/external/historical/nawk/bin/awk.1:1.16 --- src/external/historical/nawk/bin/awk.1:1.15 Tue Jul 5 13:21:38 2022 +++ src/external/historical/nawk/bin/awk.1 Tue Jul 5 13:29:18 2022 @@ -1,4 +1,4 @@ -.\" $NetBSD: awk.1,v 1.15 2022/07/05 13:21:38 uwe Exp $ +.\" $NetBSD: awk.1,v 1.16 2022/07/05 13:29:18 uwe Exp $ .\" .\" Copyright (C) Lucent Technologies 1997 .\" All Rights Reserved @@ -634,6 +634,26 @@ and after the last. and .Ic END do not combine with other patterns. +.Pp +If an awk program consists of only actions with the pattern +.Ic BEGIN , +and the +.Ic BEGIN +action contains no +.Ic getline +statement, awk shall exit without reading its input when the last +statement in the last +.Ic BEGIN +action is executed. +If an awk program consists of only actions with the pattern +.Ic END +or only actions with the patterns +.Ic BEGIN +and +.Ic END , +the input shall be read before the statements in the +.Ic END +actions are executed. .Ss Built-in Variables Variable names with special meanings: .Bl -hang -width Va