zsh-users
 help / color / mirror / code / Atom feed
* man page bug for negative pattern?
@ 2014-09-19  9:02 Han Pingtian
  2014-09-19 10:11 ` Jérémie Roquet
  0 siblings, 1 reply; 5+ messages in thread
From: Han Pingtian @ 2014-09-19  9:02 UTC (permalink / raw)
  To: zsh-user

Hi,

In man page of zshexpn, for "^x" negative pattern, it said:

    This has a higher precedence than `/'

But I think the precedence should be lower than /, right? Just as the
zshguide said:

    In filename generation, the ^ has a lower precedence than a slash:

in page 228.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: man page bug for negative pattern?
  2014-09-19  9:02 man page bug for negative pattern? Han Pingtian
@ 2014-09-19 10:11 ` Jérémie Roquet
  2014-09-19 13:50   ` Han Pingtian
  0 siblings, 1 reply; 5+ messages in thread
From: Jérémie Roquet @ 2014-09-19 10:11 UTC (permalink / raw)
  To: zsh-user

Hi,

2014-09-19 11:02 GMT+02:00 Han Pingtian <hanpt@linux.vnet.ibm.com>:
> In man page of zshexpn, for "^x" negative pattern, it said:
>
>     This has a higher precedence than `/'
>
> But I think the precedence should be lower than /, right? Just as the
> zshguide said:
>
>     In filename generation, the ^ has a lower precedence than a slash:
>
> in page 228.

The zshguide is wrong there. It also says that “~ is the only globbing
operator to have a lower precedence than /”

-- 
Jérémie


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: man page bug for negative pattern?
  2014-09-19 10:11 ` Jérémie Roquet
@ 2014-09-19 13:50   ` Han Pingtian
  2014-09-19 14:02     ` Jérémie Roquet
  2014-09-19 14:22     ` Peter Stephenson
  0 siblings, 2 replies; 5+ messages in thread
From: Han Pingtian @ 2014-09-19 13:50 UTC (permalink / raw)
  To: zsh-users

On Fri, Sep 19, 2014 at 12:11:01PM +0200, Jérémie Roquet wrote:
> Hi,
> 
> 2014-09-19 11:02 GMT+02:00 Han Pingtian <hanpt@linux.vnet.ibm.com>:
> > In man page of zshexpn, for "^x" negative pattern, it said:
> >
> >     This has a higher precedence than `/'
> >
> > But I think the precedence should be lower than /, right? Just as the
> > zshguide said:
> >
> >     In filename generation, the ^ has a lower precedence than a slash:
> >
> > in page 228.
> 
> The zshguide is wrong there. It also says that “~ is the only globbing
> operator to have a lower precedence than /”
> 
But if "^" has a higher precedence than "/", then 
    
    "^foo/bar"

will match any files in "." other than "foo/bar"? 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: man page bug for negative pattern?
  2014-09-19 13:50   ` Han Pingtian
@ 2014-09-19 14:02     ` Jérémie Roquet
  2014-09-19 14:22     ` Peter Stephenson
  1 sibling, 0 replies; 5+ messages in thread
From: Jérémie Roquet @ 2014-09-19 14:02 UTC (permalink / raw)
  To: Zsh Users

2014-09-19 15:50 GMT+02:00 Han Pingtian <hanpt@linux.vnet.ibm.com>:
> But if "^" has a higher precedence than "/", then
>
>     "^foo/bar"
>
> will match any files in "." other than "foo/bar"?

I'll match any file named “bar” in any subdirectory of “.” other than “foo”.

Think of “higher precedence” as implicit parentheses (even if these
parentheses wouldn't be valid zsh):

Since “^” has higher precedence, “^foo/bar” means “(^foo)/bar”. If “/”
had higher precedence, it'd mean “^(foo/bar)”, but that's not the
case.

Best regards,

-- 
Jérémie


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: man page bug for negative pattern?
  2014-09-19 13:50   ` Han Pingtian
  2014-09-19 14:02     ` Jérémie Roquet
@ 2014-09-19 14:22     ` Peter Stephenson
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2014-09-19 14:22 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 307 bytes --]

> > > Han Pingtian <hanpt@linux.vnet.ibm.com <javascript:;>>
> > But if "^" has a higher precedence than "/", then
> >
> >   "^foo/bar"
> >
> > will match any files in "." other than "foo/bar"?
>

"Has a higher precedence" means it parses as
(^foo) /bar
"Binds more closely" might be a clearer phrase.

pws

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-19 14:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-19  9:02 man page bug for negative pattern? Han Pingtian
2014-09-19 10:11 ` Jérémie Roquet
2014-09-19 13:50   ` Han Pingtian
2014-09-19 14:02     ` Jérémie Roquet
2014-09-19 14:22     ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).