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: remove trailing space in...



details:   https://anonhg.NetBSD.org/src/rev/b3ed18cd379e
branches:  trunk
changeset: 368288:b3ed18cd379e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 03 10:56:22 2022 +0000

description:
awk.1: remove trailing space in output of 'echo' example program

diffstat:

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

diffs (34 lines):

diff -r c02efe2bd18d -r b3ed18cd379e external/historical/nawk/bin/awk.1
--- a/external/historical/nawk/bin/awk.1        Sun Jul 03 07:33:08 2022 +0000
+++ b/external/historical/nawk/bin/awk.1        Sun Jul 03 10:56:22 2022 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: awk.1,v 1.8 2019/12/21 09:11:59 wiz Exp $
+.\"    $NetBSD: awk.1,v 1.9 2022/07/03 10:56:22 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 December 19, 2019
+.Dd July 3, 2022
 .Dt AWK 1
 .Os
 .Sh NAME
@@ -711,10 +711,11 @@
 .Pp
 Simulate echo(1):
 .Bd -literal -offset indent
-BEGIN { # Simulate echo(1)
-        for (i = 1; i < ARGC; i++) printf "%s ", ARGV[i]
-        printf "\en"
-        exit }
+BEGIN {
+       if (1 < ARGC) printf "%s", ARGV[1]
+       for (i = 2; i < ARGC; i++) printf " %s", ARGV[i]
+       printf "\en"
+}
 .Ed
 .Pp
 Print an error message to standard error:



Home | Main Index | Thread Index | Old Index