[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: extglob
From: |
Chris F.A. Johnson |
Subject: |
Re: extglob |
Date: |
Sat, 16 May 2009 03:35:55 -0400 (EDT) |
User-agent: |
Alpine 1.00 (LRH 882 2007-12-20) |
On Sat, 16 May 2009, Pierre Gaston wrote:
> On Sat, May 16, 2009 at 2:44 AM, Chris F.A. Johnson <cfaj@freeshell.org>
> wrote:
> >
> > Am I missing something, or are these extended globbing patterns
> > equivalent to a plain asterisk?
> >
> > ?(pattern-list) Matches zero or one occurrence of the given patterns
> > *(pattern-list) Matches zero or more occurrences of the given patterns
>
> a * will match too much:
Thanks. I knew I was missing something.
> [[ bor = b?(a)r ]] # false
> [[ bor = b*r ]] # true
>
> [[ baar = b?(a)r ]] #false
> [[ baar = b*r ]] #true
>
>
> [[ bor = b*(a)r ]] # false
> [[ bor = b*r ]] # true
--
Chris F.A. Johnson, webmaster <http://woodbine-gerrard.com>
===================================================================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
- extglob, Chris F.A. Johnson, 2009/05/15
- Re: extglob, Pierre Gaston, 2009/05/16
- Re: extglob,
Chris F.A. Johnson <=