[ILUG] calling a program recursively

From: John Allman (allmanj at domain houseofireland.com)
Date: Fri 20 Sep 2002 - 16:28:03 IST


Hi - i dont know if there's a program to do this all ready - i strongly
suspect there is (if not i might just write one). I want to call a
program recursively in each directory under a particular directory. I
have a little script to do things to every file in a directory. I want
to call it in every directory inside that directory, and every directory
in that and so on, recursively.

I could do it with perl like this:

#!/usr/bin/perl

use File::Find;

finddepth (\&wanted, $ARGV[0]);

sub wanted {
#call program here, e.g
    exec /path/to/my/script
 }

but i wonder, is there something similar i can use directly in the shell
for future reference?

thanks!

John



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:18:59 GMT