version 1.775, 2020/05/29 13:42:13 |
version 1.776, 2020/06/04 07:12:05 |
|
|
variable. |
variable. |
.El |
.El |
.Pp |
.Pp |
Braces are similar to single quotes in that the text inside is taken literally |
Braces are parsed as a configuration file (so conditions such as |
without any replacements but this also includes line continuation. |
.Ql %if |
Braces can span multiple lines in which case a literal newline is included in the |
are processed) and then converted into a string. |
string. |
They are designed to avoid the need for additional escaping when passing a |
They are designed to avoid the need for additional escaping when passing a group |
group of |
of |
|
.Nm |
.Nm |
or shell commands as an argument (for example to |
commands as an argument (for example to |
.Ic if-shell |
.Ic if-shell ) . |
or |
|
.Ic pipe-pane ) . |
|
These two examples produce an identical command - note that no escaping is |
These two examples produce an identical command - note that no escaping is |
needed when using {}: |
needed when using {}: |
.Bd -literal -offset indent |
.Bd -literal -offset indent |
|
|
display -p 'brace-dollar-foo: }$foo' |
display -p 'brace-dollar-foo: }$foo' |
} |
} |
|
|
if-shell true "\en display -p 'brace-dollar-foo: }\e$foo'\en" |
if-shell true "display -p 'brace-dollar-foo: }\e$foo'" |
.Ed |
.Ed |
.Pp |
.Pp |
Braces may be enclosed inside braces, for example: |
Braces may be enclosed inside braces, for example: |