[comp.unix.questions] find cannot find all files in a directory

david@wubios.wustl.edu (David J. Camp) (09/04/89)

I want find to return all the files in each directory to exec.  That is,
I want to do something like:

     find /path -type d -exec command {}/\* \; -print

so that command will be run on each file, one directory at a time.  I
cannot seem to get this to work.  I cannot cd to the directory, since I
need to be somewhere else when the command is run.  Any help will be 
appreciated.  Please reply directly to me.  Thank you,  -David-
-- 
Bitnet:   david@wubios.wustl                ^      Mr. David J. Camp
Internet: david%wubios@wucs1.wustl.edu    < * >    Box 8067, Biostatistics
uucp:     uunet!wucs1!wubios!david          v      660 South Euclid
Washington University (314) 36-23635               Saint Louis, MO 63110

leo@philmds.UUCP (Leo de Wit) (09/07/89)

In article <874@wubios.wustl.edu> david@wubios.wustl.edu (David J. Camp) writes:
|I want find to return all the files in each directory to exec.  That is,
|I want to do something like:
|
|     find /path -type d -exec command {}/\* \; -print
|
|so that command will be run on each file, one directory at a time.

If you don't have xargs, how about:

     find /path -type d -print|while read dir; do command $dir/*; done

   Leo.