aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2016-06-21 19:07:08 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-06-26 11:36:31 +0200
commitea71f0b6103f52aa09c8cef9a9e384cffc548b78 (patch)
tree3835aad4e4953fe14014ece2170f5ad6d99dfbcb
parenta3e9e179eb51476f3c700e485268db45d367f408 (diff)
Reword variable expansion docs
-rw-r--r--doc_src/index.hdr.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in
index 49d8552d..a998b907 100644
--- a/doc_src/index.hdr.in
+++ b/doc_src/index.hdr.in
@@ -524,7 +524,7 @@ echo The plural of $WORD is {$WORD}s
Note that without the quotes or braces, fish will try to expand a variable called `$WORDs`, which may not exist.
-The latter syntax `{$WORD}` works by exploiting <a href="#expand-brace">brace expansion</a>; care should be taken with array variables and undefined variables, as these expand as a <a href="#cartesian-product">cartesian product</a>, so undefined variables eliminate the string.
+The latter syntax `{$WORD}` works by exploiting <a href="#expand-brace">brace expansion</a>; care should be taken with zero-element array variables and undefined variables, as these expand as a <a href="#cartesian-product">cartesian product</a>, so they eliminate the string.
Variable expansion is the only type of expansion performed on double quoted strings. There is, however, an important difference in how variables are expanded when quoted and when unquoted. An unquoted variable expansion will result in a variable number of arguments. For example, if the variable `$foo` has zero elements or is undefined, the argument `$foo` will expand to zero elements. If the variable $foo is an array of five elements, the argument `$foo` will expand to five elements. When quoted, like `"$foo"`, a variable expansion will always result in exactly one argument. Undefined variables will expand to the empty string, and array variables will be concatenated using the space character.