version 1.120, 2015/03/13 19:58:41 |
version 1.121, 2016/10/23 14:54:14 |
|
|
.Pc . |
.Pc . |
Normally, expansion is not done until the variable is referenced. |
Normally, expansion is not done until the variable is referenced. |
.It Ic \&!= |
.It Ic \&!= |
Expand the value and pass it to the shell for execution and assign |
Perform variable expansion and pass the result to the shell for |
the result to the variable. |
execution on the spot, assigning the result to the variable. |
Any newlines in the result are replaced with spaces |
Any newlines in the result are also replaced with spaces |
.Po |
.Po |
.Bx |
.Bx |
extension |
extension |
.Pc . |
.Pc . |
|
.It Ic \&!!= |
|
Perform variable expansion on the spot and pass the result to the shell |
|
for execution only when the value is needed, assigning the result to |
|
the variable. |
|
.Pp |
|
This is almost identical to |
|
.Ic \&!= |
|
except that a shell is only run when the variable value is needed. |
|
Any newlines in the result are also replaced with spaces |
|
.Po |
|
.Ox |
|
extension |
|
.Pc . |
.El |
.El |
.Pp |
.Pp |
Any whitespace before the assigned |
Any whitespace before the assigned |
|
|
if |
if |
.Va A |
.Va A |
is not yet defined. |
is not yet defined. |
|
.Pp |
|
Combinations that do not make sense, such as |
|
.Bd -literal -offset indent |
|
A +!!= cmd |
|
.Ed |
|
will not work. |
.Pp |
.Pp |
Variables are expanded by surrounding the variable name with either |
Variables are expanded by surrounding the variable name with either |
curly braces |
curly braces |