make(1): mark up the variable expansion example

This commit is contained in:
uwe 2022-08-14 22:11:20 +00:00
parent e92ea9877b
commit 5787f4b7f0
1 changed files with 16 additions and 6 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: make.1,v 1.329 2022/08/14 21:57:26 uwe Exp $ .\" $NetBSD: make.1,v 1.330 2022/08/14 22:11:20 uwe Exp $
.\" .\"
.\" Copyright (c) 1990, 1993 .\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -1282,7 +1282,9 @@ variable (where a
is white-space delimited sequence of characters). is white-space delimited sequence of characters).
The general format of a variable expansion is as follows: The general format of a variable expansion is as follows:
.Pp .Pp
.Dl ${variable[:modifier[:...]]} .Sm off
.D1 Ic \&${ Ar variable\| Oo Ic \&: Ar modifier\| Oo Ic \&: Ar ... Oc Oc Ic \&}
.Sm on
.Pp .Pp
Each modifier begins with a colon, Each modifier begins with a colon,
which may be escaped with a backslash which may be escaped with a backslash
@ -1290,13 +1292,21 @@ which may be escaped with a backslash
.Pp .Pp
A set of modifiers can be specified via a variable, as follows: A set of modifiers can be specified via a variable, as follows:
.Pp .Pp
.Dl modifier_variable=modifier[:...] .Bd -literal -offset indent
.Dl ${variable:${modifier_variable}[:...]} .Ar modifier_variable\^ Li \&= Ar modifier Ns Oo Ic \&: Ns Ar ... Oc
.Sm off
.Ic \&${ Ar variable Ic \&:${ Ar modifier_variable Ic \&} Oo Ic \&: Ar ... Oc Ic \&}
.Sm on
.Ed
.Pp .Pp
In this case the first modifier in the modifier_variable does not In this case the first modifier in the
.Ar modifier_variable
does not
start with a colon, since that must appear in the referencing start with a colon, since that must appear in the referencing
variable. variable.
If any of the modifiers in the modifier_variable contain a dollar sign If any of the modifiers in the
.Ar modifier_variable
contain a dollar sign
.Pq Ql $ , .Pq Ql $ ,
these must be doubled to avoid early expansion. these must be doubled to avoid early expansion.
.Pp .Pp