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

Re: (#cN,M) error, %? doesn't glob

On Jun 24,  4:00am, Mikael Magnusson wrote:
}  The flag tt(LPAR()#c)var(N)tt(,)var(M)tt(RPAR()) can be used anywhere
} +that the tt(#) or tt(##) operators can be used except in the expressions
} +`tt((*/)#)' and `tt((*/)##)'

That's not quite right.  [[ bar/foo == (*/)(#c1,2)foo ]] does not produce
a bad pattern error.  It's only in glob context where "/" has special
significance that (*/)# is also a special case.

} While looking at Src/glob.c I also noticed that ? is ignored for
} globbing if it is preceded by a % at the start of a string, is that
} documented anywhere?

Etc/BUGS -- second to last entry.

} I sort of feel like an explicit option for this would be a bit awkward.

See one proposed fix in Etc/BUGS ...

I believe this behavior is actually "inherited" from csh -- one original
design goal of zsh was to import as much as possible of csh's interactive
behavior into the Bourne shell's syntax structure.

Tcsh seems to have solved it by making builtins that manipulate jobs into
special keywords that alter the parse of what comes after, much in the
way that ksh applies assignment context to arguments that follow the
typeset and local builtins:

$ echo %?foo
echo: No match.
$ fg %?foo
fg: No job matches pattern.


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