How do I list subdirectories?

Tue Aug 31 23:49:00 GMT 1999

A minor nit in an otherwise very clear and concise description of
the misunderstandings..

> > It seems that this is a question on pattern matching.
> > It seems to me that a directory which is mached by:
> > \/
> > should also be matched by
> > *\/
> ... if we're using shell patterns (which the grep command isn't).
> In the regexps that grep is using, it'd be appropriate for you to be
> told that your regexp is invalid, because there aren't any characters
> before the Kleen star.
> Remember, too, that the "*/" isn't being fed to grep, too--all of the
> file-names, ending in '/', joined together by spaces, are, and that's
> not going to match.

Actually, I believe that all of the file-names ending in '/' (that is,
all of the valid paths with an element of the current directory followed
by a slash, except for those beginning with a .) will be passed to egrep
as separate arguments.  egrep will interpret the first argument as the
pattern to search for, and the subsequent arguments as files to search for
the pattern in.  If there are two or more paths expanded, (i.e. egrep sees
a pattern and one or more files), egrep will not read standard input at
all and will instead search the "files" for the "pattern".

Depending on whether the OS allows a directory to be opened and read, egrep
may complain that it cannot open the "files", or it may open it and search
for the "pattern", which it probably would not find, but it just might if
the directory looked just right.


Well, I did say that it was a minor nit!

marcus hall

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list