× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Charles,

With respect to:
find /mydir/*.java

you said:
Which I took to mean that find was seeing the *.java instead of the
shell expanding it...

The *.java is going to be expanded by the shell. I always like to think of it in steps. First the shell does it's job, and that's the first step. Then the output of that is run, and that's the second step. So if you have 3 files that match the wildcard of *.java, then the command that gets run in the 2nd step is this:

find /mydir/file1.java /mydir/file2.java /mydir/file3.java

So even though you typed *.java, the 'find' program receives the actual file names because the _shell_ did the expansion. This is exactly why it doesn't recurse. If the wildcard expands into any directory names, they will be searched recursively... but since you probably haven't created a directory that ends in .java, it won't match the pattern that the shell is expanding, and therefore 'find' won't receive the directory name in it's list of things to search.


But perhaps the shell _is_ expanding it, and since the resulting list
doesn't have any directories in in find doesn't recurse?


Yep. That's what I just said :-)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.