Lines Matching refs:variable
7 provides a facility for expanding variable and command references and
1678 advantage of @dfn{variable substitution}, which is also part of word
1690 * Variable Substitution:: Different types of variable substitution.
1711 @cindex variable substitution
1962 The input string refers to an undefined shell variable, and you used the flag
2044 If the input refers to a shell variable that is not defined, report an
2122 Plain @samp{~} uses the value of the environment variable @code{HOME}
2132 Part of ordinary shell syntax is the use of @samp{$@var{variable}} to
2133 substitute the value of a shell variable into a command. This is called
2134 @dfn{variable substitution}, and it is one part of doing word expansion.
2136 There are two basic ways you can write a variable reference for
2140 @item $@{@var{variable}@}
2141 If you write braces around the variable name, then it is completely
2142 unambiguous where the variable name ends. You can concatenate
2143 additional letters onto the end of the variable value by writing them
2147 @item $@var{variable}
2148 If you do not put braces around the variable name, then the variable
2150 follow the @samp{$}. The next punctuation character ends the variable
2151 name. Thus, @samp{$foo-bar} refers to the variable @code{foo} and expands
2159 @item $@{@var{variable}:-@var{default}@}
2160 Substitute the value of @var{variable}, but if that is empty or
2163 @item $@{@var{variable}:=@var{default}@}
2164 Substitute the value of @var{variable}, but if that is empty or
2165 undefined, use @var{default} instead and set the variable to
2168 @item $@{@var{variable}:?@var{message}@}
2169 If @var{variable} is defined and not empty, substitute its value.
2177 @item $@{@var{variable}:+@var{replacement}@}
2178 Substitute @var{replacement}, but only if @var{variable} is defined and
2183 @item $@{#@var{variable}@}
2185 characters in the value of @var{variable}. @samp{$@{#foo@}} stands for
2189 These variants of variable substitution let you remove part of the
2190 variable's value before substituting it. The @var{prefix} and
2193 in this context, they match against parts of the variable value
2197 @item $@{@var{variable}%%@var{suffix}@}
2198 Substitute the value of @var{variable}, but first discard from that
2199 variable any portion at the end that matches the pattern @var{suffix}.
2207 @item $@{@var{variable}%@var{suffix}@}
2208 Substitute the value of @var{variable}, but first discard from that
2209 variable any portion at the end that matches the pattern @var{suffix}.
2217 @item $@{@var{variable}##@var{prefix}@}
2218 Substitute the value of @var{variable}, but first discard from that
2219 variable any portion at the beginning that matches the pattern @var{prefix}.
2227 @item $@{@var{variable}#@var{prefix}@}
2228 Substitute the value of @var{variable}, but first discard from that
2229 variable any portion at the beginning that matches the pattern @var{prefix}.