On 2022-12-04 18:52, Lawrence Velázquez wrote:
I see. A file glob would be the last thing I'd be expecting, I'm expecting it to be a nothing but a string. Anyway that's a clear explanation.In this context, "var[2]" is recognized as a valid glob, and zsh attempts to generate filenames with it. If a file or directory matches, its name is inserted as usual.
That works. First experiments trying '(un)setopt NOMATCH' aren't working but now that I know what to chew on I'll bag it.% zsh +o NOMATCH foo.zsh <var[2]><ain't><nothing>
Thanks, as is so often the case, it's not having a clue where to look that's that hard part. I'd not have dreamed this was a filename generation issue.This is all explained in the manual. https://zsh.sourceforge.io/Doc/Release/Expansion.html#Filename-Generation