[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 1791 - trunk/subversion/clients/cmdline trunk/tools/dev

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-04-27 02:37:51 CEST

Philip Martin <philip@codematters.co.uk> writes:

> > this is really cool, but i got syntax errors at lines 35 and 143.
> > apparently bash 2.05a (compiled out of the FreeBSD ports tree) is
> > having trouble with the following construct:
> >
> > @($foo)
> >
> > replacing it with
> >
> > @{$foo}
> >
> > seems to silence the syntax errors, and as far as i can tell, appears
> > to work, but i don't know much about bash scripting, so i'm hesitant
> > to commit this patch:
>
> I don't know that much either, I stole most of this from other files
> on my Debian box :)
>
> @(...) is documented in the bash man page:
>
> @(pattern-list)
> Matches exactly one of the given patterns
>
> whereas @{...} doesn't appear there and doesn't work when I try it.

I should have read more of the man page before replying...

Here is the relevant bit:

      "If the extglob shell option is enabled using the shopt
       builtin, several extended pattern matching operators are
       recognized. In the following description, a pattern-list
       is a list of one or more patterns separated by a |. Com­
       posite patterns may be formed using one or more of the
       following sub-patterns:

              ?(pattern-list)
                     Matches zero or one occurrence of the given
                     patterns
              *(pattern-list)
                     Matches zero or more occurrences of the
                     given patterns
              +(pattern-list)
                     Matches one or more occurrences of the given
                     patterns
              @(pattern-list)
                     Matches exactly one of the given patterns"

You need to do "shopt -s extglob".

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Apr 27 02:38:42 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.