On Tue, Jan 04, 2005 at 09:01:07PM +0100, Giuliano Colla wrote:
> I've written a small utility which I think may be useful.
> 
> It's called "trv" (for "traverse"). It will recursively traverse a 
> directory tree and execute in each subdirectory the command passed as an 
> argument.

Quite a good idea.
Once  findutils does the deacent thing...

cat >> $HOME/.env <<EOF
trv() {         
        find . -type d -execdir "$1" \;
}
EOF

Meanwhile ..

> trv "rm *.pyc"
find . -name "*.pyc" -delete

> trv "touch -r foo *.h"
find . -name "*.h" -exec touch -r foo 

> The implementation is so trivial that I'm almost ashamed to propose it, 
> bu the idea behind is smart enough to be worth some attention.

An almost identical command comes in the "contrib" directory of the
CVS sources code.   One typically uses it for a recursive "cvs add".

James.



_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to