Module Name:    src
Committed By:   uwe
Date:           Sun Aug 14 21:53:58 UTC 2022

Modified Files:
        src/usr.bin/make: make.1

Log Message:
make(1): prettify .for index variable example


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/usr.bin/make/make.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.327 src/usr.bin/make/make.1:1.328
--- src/usr.bin/make/make.1:1.327	Sun Aug 14 21:48:05 2022
+++ src/usr.bin/make/make.1	Sun Aug 14 21:53:58 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.327 2022/08/14 21:48:05 uwe Exp $
+.\"	$NetBSD: make.1,v 1.328 2022/08/14 21:53:58 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -674,38 +674,42 @@ but only as far as necessary to determin
 Variables in shell commands are expanded when the shell command is
 executed.
 .It
-.Dq .for
+.Ic .for
 loop index variables are expanded on each loop iteration.
 Note that other variables are not expanded when composing the body of a loop,
 so the following example code:
 .Bd -literal -offset indent
-
-.Dv .for i in 1 2 3
+\&.for i in 1 2 3
 a+=     ${i}
 j=      ${i}
 b+=     ${j}
-.Dv .endfor
+\&.endfor
 
 all:
 	@echo ${a}
 	@echo ${b}
-
 .Ed
+.Pp
 will print:
 .Bd -literal -offset indent
 1 2 3
 3 3 3
-
 .Ed
-Because while ${a} contains
-.Dq 1 2 3
-after the loop is executed, ${b}
+.Pp
+Because while
+.Va a
+contains
+.Ql 1 2 3
+after the loop is executed,
+.Va b
 contains
-.Dq ${j} ${j} ${j}
+.Ql ${j} ${j} ${j}
 which expands to
-.Dq 3 3 3
-since after the loop completes ${j} contains
-.Dq 3 .
+.Ql 3 3 3
+since after the loop completes
+.Va j
+contains
+.Ql 3 .
 .El
 .Ss Variable classes
 The four different classes of variables (in order of increasing precedence)

Reply via email to