Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: trivial question
On Tue, Dec 6, 2022 at 7:28 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> If a word contains an unquoted instance of one of the characters ‘*’, ‘(’, ‘|’, ‘<’, ‘[’, or ‘?’, it is regarded as a pattern for filename generation, unless the GLOB option is unset. If the EXTENDED_GLOB option is set, the ‘^’ and ‘#’ characters also denote a pattern; otherwise they are not treated specially by the shell.
[...]
> Deus absit. What I might like is some way of turning it all off. Like unsetopt glob, yes?
Yes? Re-read the doc excerpt you quoted above?
Generally, though, you don't want to do that. Instead you should use
the "noglob" precommand modifier, e.g.
% noglob echo var[2]
Messages sorted by:
Reverse Date,
Date,
Thread,
Author