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

Re: Recursive globbing



On Fri, 14 May 2004, Peter Stephenson wrote:

> > Is there any difference between *.tex and **.tex ?
> 
> No, and in fact they are documented to be the same.  Hence...
>
> > how about having improved recursive globbing, where ** not followed
> > by a slash would mean **/* (ditto for *** -> ***/*)?
> 
> I can't see any problem with this

No; please please don't do this.  Consider:

	foo='x*'

	print ${~foo}*

Or

	bar="$foo*"
	print $~bar

Completely unexpected results.

Also it seriously breaks sh compatibility, so at the very least it should
be disabled when SH_GLOB or similar options are in effect.

There's a reason that only **/ and not blather**/ is special.



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