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

Re: Bug in case stmt with '('



On Jul 22,  2:51pm, Bart Schaefer wrote:
> Subject: Re: Bug in case stmt with '('
> On Jul 22,  4:48pm, Morris M. Siegel wrote:
> } Subject: Re: Bug in case stmt with '('
> } 
> } Considering the fact that glob patterns in general are supposed to generate
> } file names, which usually do not contain blanks
> 
> I dispute that assertion.  Ever used a filesystem that's shared with a
> Macintosh?

I confess not.  By the way, has zsh been ported to the Macintosh? or to
any non-Unix OS?

> } zsh might also ignore
> } unescaped whitespace in glob patterns (in general, not just in 'case'
> } statements).
> 
> There's no such thing as "unescaped whitespace in glob patterns."  Zsh
> lexes glob patterns as a STRING token.  By the time filename generation
> gets around to interpreting the string as a glob pattern, any spaces
> that are left MUST have been "escaped" somehow, to make it through the
> lexer.  Putting parens around the pattern is one such possible quoting.

Okay -- (not knowing how lex.c works puts me somewhat at a disadvantage) --
in light of what you say, then what I mean is that the whitespace would have
to be escaped with backslash or quotes to be non-trivial.  E.g., the glob
pattern
	( file*.* ~ file.c )
would be equivalent to
	(file*.*~file.c)
and
	(  )
would be the empty pattern, whereas
	(my\ file)
or
	'my file'
would each match the 7-character filename 'my file'.

-- Morrie Siegel



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