or, if you need arguments to your scriptrecurse.pl /complete/path/to/other/script.pl dirname
might work (amazing that I haven't tested that).recurse.pl "/complete/path/to/other/script.pl -blah" dirname
#!/usr/bin/perl #this needs some comments... chdir $ARGV[1]; @ls_retval = `ls -l`; shift ( @ls_retval ); foreach $line (@ls_retval) { @items = split( /\s+/, $line ); $first_char = substr( $items[0], 0, 1 ); if ( $first_char eq 'd' ) { print "directory: $items[8]\n"; print `$0 $ARGV[0] $items[8]`; } elsif ( $first_char eq 'l' ) { print "link: $items[8]\n"; print `$0 $ARGV[0] $items[8]`; } elsif ( $first_char eq '-' ) { print "file: $items[8]\n"; $action_retval = `$ARGV[0] $items[8]`; if ( $action_retval != 0 ) { print "Error $action_retval in $items[8]\n"; } else { print "OK $action_retval for $items[8]\n"; } } } print "Finished\n";
In reply to Recursively run another script by bean
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |