Glob expansion on zero matches
mkdir ~/heap
touch ~/heap/1.txt ~/heap/2.txt
let a = [~/heap/*.txt]
echo @a # => /home/user/heap/1.txt /home/user/heap/2.txt
let a = [~/heap/*.jpg]
echo @a # => /home/user/*.jpg
This sort of makes sense for initiating an array, but not when glob is used in a for
loop.
A sub-type of this problem when using brace expansion:
for f in ~/heap/*.{txt,jpg}
echo $f
end
/home/user/heap/1.txt
/home/user/heap/2.txt
/home/user/heap/*.jpg
ion 1.0.0-alpha (x86_64-unknown-linux-gnu)
rev c6d4aa1ed5e1f5729507fc476ef0944ac4a3e321