Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: trivial question




On 2022-12-04 18:52, Lawrence Velázquez wrote:
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.
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.

% zsh +o NOMATCH foo.zsh
	<var[2]><ain't><nothing>

That works.  First experiments trying '(un)setopt NOMATCH' aren't working but now that I know what to chew on I'll bag it.
This is all explained in the manual.
https://zsh.sourceforge.io/Doc/Release/Expansion.html#Filename-Generation


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.






Messages sorted by: Reverse Date, Date, Thread, Author