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

Re: Various notes on KSH_GLOB



On Thu, 30 May 2013 16:30:45 +0200
Christian Neukirchen <chneukirchen@xxxxxxxxx> wrote:
> juno% setopt kshglob
>...
> juno% echo *(v)
> zsh: unknown file attribute

You need to "unsetopt bareglobqual".  This would be done automatically
if you were in ksh emulation mode.  Glob qualifiers are parsed first, so
there's no way of making it prefer ksh globs.

> juno% echo *(v|v/)
> zsh: bad pattern: *(v|v/)
> juno% setopt extendedglob
> juno% echo (v/)# 
> v/ v/v/ v/v/v/ v/v/v/v/ v/v/v/v/v/
> 
> I realize that both mksh and ksh93 neither support directory recursion
> with *() (but this would be nice to have, IMO, at last with the explicit
> /), which probably only makes this a documentation bug:
> 
> >>     *(...) Match any number of occurrences.  (Like `(...)#'.)

Yes, it should say there's no equivalent to the (.../)# syntax.

diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 89d5c06..e8d1ed2 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -1957,10 +1957,12 @@ item(tt(@LPAR())...tt(RPAR()))(
 Match the pattern in the parentheses.  (Like `tt(LPAR())...tt(RPAR())'.)
 )
 item(tt(*LPAR())...tt(RPAR()))(
-Match any number of occurrences.  (Like `tt(LPAR())...tt(RPAR()#)'.)
+Match any number of occurrences.  (Like `tt(LPAR())...tt(RPAR()#)',
+except that recursive directory searching is not supported.)
 )
 item(tt(PLUS()LPAR())...tt(RPAR()))(
-Match at least one occurrence.  (Like `tt(LPAR())...tt(RPAR()##)'.)
+Match at least one occurrence.  (Like `tt(LPAR())...tt(RPAR()##)',
+except that recursive directory searching is not supported..)
 )
 item(tt(?LPAR())...tt(RPAR()))(
 Match zero or one occurrence.  (Like `tt(LPAR()|)...tt(RPAR())'.)

pws



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