Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: strange glob expansion
- X-seq: zsh-users 2551
- From: Hubert Canon <Hubert.Canon@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: strange glob expansion
- Date: Thu, 2 Sep 1999 12:15:32 +0200
- Cc: zsh-users@xxxxxxxxxxxxxx
- In-reply-to: <990901174608.ZM19896@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <19990901101116.A8076@xxxxxxxxxxxxxxxxx> <990901174608.ZM19896@xxxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer écrivait :
> On Sep 1, 10:11am, Hubert Canon wrote:
> } % echo .scwm/(chan*|**/scwmrc*)
>
> Directory separators can't be used inside parentheses.
I didn't know that. Thank you.
> % echo .scwm/**/(chan*|scwmrc*)
Yes, it works.
> % echo .scwm/{chan*,**/scwmrc*}
Not exactly. The { , } construct is somewhat different than ( | ) :
for example, when one of the partterns fails, the whole expression
fails.
Like :
% echo (foo*|bar*)
foo
% echo {foo*,bar*}
zsh: no matches found: bar*
The { , } construct always expands its components : echo {foo*,bar*}
is exatcly the same as : echo foo* bar*
That's why I prefer ( | ) in general ofr globbing.
--
Hubert Canon
Messages sorted by:
Reverse Date,
Date,
Thread,
Author