#
# recurs.pl
#
# This script executes recursively on subdirs the command you supply as a parameter
#
# Run "program -h" to see the run options
#
# Last modified: Apr 10 1997
# Author: Bekman Stas
#
$|=1;
# Set here the pattern extensions of your image files
# Usage
(@ARGV == 1 ) || die ("Usage: recurs.pl [-h] \n\t-h this help\n\n");
$command=$ARGV[0];
#$command=~s/(.*)/'$1'/;
&recursive();
# Subroutine "recursive" goes recursively down at the dir tree and
# and runs the $ARGV[0] for you. After comming to the end it's coming back up
# at the tree.
sub recursive {
#orig system($command);
`$command` ;
#print "$command\n";
#die;
foreach $dir (<*>) {
if (-d $dir) {
# print "$dir\n";
chdir $dir;
&recursive();
chdir "..";
}
}
}
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!