Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mephisto!prism!gt0178a From: gt0178a@prism.gatech.EDU (BURNS,JIM) Newsgroups: comp.unix.questions Subject: Re: Execute a command w/wildcards & recursive descent Message-ID: <13265@hydra.gatech.EDU> Date: 1 Sep 90 21:46:59 GMT References: <1990Sep01.154949.16559@chinet.chi.il.us> Organization: Georgia Institute of Technology Lines: 33 in article <1990Sep01.154949.16559@chinet.chi.il.us>, les@chinet.chi.il.us (Leslie Mikesell) says: > Unless there is some requirement to do a single directory at a time you > could use: > > find . -type f -name 'wildcard' -print | xargs command Yeah, I guess I was getting to hung up on the order. Thanx. For those who are interested tho', I did play with it some more, and got the script below to work the same way as the 'c' program, and it executes in 1/2 to 3/4 the time (according to the ksh time command), and is 100th the size and works on BSD - go figure! -rwxr-xr-x 1 gt0178a 290 Sep 1 17:07 ftw* -rwxr-xr-x 1 gt0178a 23949 Aug 27 20:16 ftw2* startdir=$1;shift for i in `du $startdir|awk '{print $2}'`;do (cd $i echo '****************************************' echo -n "in $i do ";set -f;echo $*;set +f echo '****************************************' eval $* return=$? echo "" echo Command return code = $return echo "";echo "") done -- BURNS,JIM Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332 uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a Internet: gt0178a@prism.gatech.edu