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

Re: Question about extended globbing



Hi Raúl ;),

>  * Davilín <david@xxxxxxxxxxxx> dixit:
> > grep something $FOO/^{*txt,*info}
> > 
> > but it didn't work. How can I achieve to include several alternatives with
> > the ^ operator?
> 
>     Like this: grep something $FOO/^(*txt|*info)

I knew that the answer had to be simple ;), i just was to sleepy yesterday
to think of this solution ;)).

>     grep something $FOO/^*txt $FOO/^*info
> 
>     That way, when filename generation takes place, it expands the
> first expression, which include any *info file, and then it expands
> the second expression, which contains any *txt file.

I see...

>     I think we are in the second case, brace expansion and after that
> filename generation. 

I think they're are took literally. If a type 'grep something $FOO/^*txt' or
the solution you gave me above, the filenames are generated when Tab is
pressed, but not in the case of the braces, it seems they're are ignored
after the ^ operator.

> See if you have dupes in the generated file list

It works great ;), thanks for your help.


-- 
David Gómez

"The question of whether computers can think is just like the question of
whether submarines can swim." -- Edsger W. Dijkstra



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