Hi,
I want find all the files that satisfy one set of conditions in
directories that satisfies another set of conditions in one 'find'
command. As an example, I want to search for executables in
directories that has a file named ".export".
As of now, I use the follow commands (to demonstrate ideas but are not
fully tested).
search_dirs=(`find . -type d -exec sh -c "test -f '{}'/.export" ';' -print`)
files=(`find "${search_dirs[@]}" -mindepth 1 -maxdepth 1 -executable
-type f`)
Is there a more compact (but still readable way preform such search in
one find command?
--
Regards,
Peng