Don't count successive "," as literal in brace expansion

This was highly surprising.

Fixes #3002.
This commit is contained in:
Fabian Homborg
2018-01-02 15:24:48 +01:00
parent 55ebf4430f
commit aa58cae601
5 changed files with 19 additions and 3 deletions

View File

@@ -514,6 +514,17 @@ echo foo-{}
echo foo-{$undefinedvar}
# Output is an empty line - see <a href="#cartesian-product">the cartesian product section</a>
\endfish
If there is nothing between a brace and a comma or two commas, it's interpreted as an empty element.
So:
\fish
echo {,,/usr}/bin
# Output /bin /bin /usr/bin
\endfish
To use a "," as an element, <a href="#quotes">quote</a> or <a href="#escapes">escape</a> it.
\subsection expand-variable Variable expansion