Re: Execute command on one file per directory



On Nov 29, 4:41 pm, Icarus Sparry <use...@xxxxxxxxxxxxxxxxx> wrote:
On Thu, 29 Nov 2007 06:27:03 -0800, mathieu wrote:
Could anyone tell me what is wrong with the following:

Print one filename per directory (ok):

find /images/ -type d -exec find {} -maxdepth 1 -type f -print -quit \;

Print one basename per directory:

find /images/ -type d -exec find {} -maxdepth 1 -type f -print -quit -
exec basename {} png \; \;

Thanks

Lots of things. how does the first find know that it needs to skip over
the first semicolon and use the second one?

How does the first find know it should substitute for the first {}, but
not the second?

If you "quit", why do you expect to "exec" later?

Because I want only *one* file per directory. Without the quit it is
not working...
but indeed with the -quit -exec does not work anymore

-Mathieu
.