aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2016-05-07 19:48:01 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-05-07 19:49:15 +0200
commit1d101ef3d01a7a8f7e651527fc81ee4bd4588ac5 (patch)
tree17873b9a3e664ecb6fca784229a49ce18af7ec85 /doc_src
parentac47100a7d89d53fa2c44c7de692617741387f38 (diff)
docs: Mention cartesian product in variable-expansion section
See #3002.
Diffstat (limited to 'doc_src')
-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 24f70e31..5e4d7724 100644
--- a/doc_src/index.hdr.in
+++ b/doc_src/index.hdr.in
@@ -522,7 +522,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 behave very differently to POSIX shells.
+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.
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.