From mboxrd@z Thu Jan 1 00:00:00 1970 From: "13mb80000-HallM(DR3132)37x10" To: cygwin@sourceware.cygnus.com Subject: Re: How do I list subdirectories? Date: Wed, 25 Aug 1999 14:23:00 -0000 Message-id: <199908252116.PAA07709@chorus> X-SW-Source: 1999-08/msg00696.html 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 cygwin-unsubscribe@sourceware.cygnus.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: "13mb80000-HallM(DR3132)37x10" To: cygwin@sourceware.cygnus.com Subject: Re: How do I list subdirectories? Date: Tue, 31 Aug 1999 23:49:00 -0000 Message-ID: <199908252116.PAA07709@chorus> X-SW-Source: 1999-08n/msg00696.html Message-ID: <19990831234900.eLQg6xbG9AcQBnQU15ffHpE7Fxh9JlfYF1m_drsVEcU@z> 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 cygwin-unsubscribe@sourceware.cygnus.com