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

Re: Excluding files & directories from a glob



> >  grep -i 'host' **/(*.cfm~(ctpigeonbot|env).cfm)~*((#s)|/)junk*/*(.)
>
> Is the following OK/ (appears 2b?)
>
> grep -i 'host' **/(*.cfm~ctpigeonbot.cfm)~junk*/*

The difference between what Peter posted and this is that this pattern
will only avoid files with a path starting with 'junk' relative to the
current directory.
To make it more concrete, it behaves the same except in the case when
you have a subdirectory called junk not immediately in the directory
you're executing the command in, so any file under a directory
./*/junk*/ would not be ignored.
For example, if you have
./foo
./junkfoo/bar
./qux/junkcorge/garply

Then your pattern will match the third file whereas Peter's one will exclude it.

--
J
"If you wish to leave a record of your call,
 please state your messij at the sound of the tone."


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