in reply to Running Batch of Files
#!/usr/bin/perl my $dir = '.'; my $pattern = '.jpg$'; #Filenames ending in .jpg opendir DIR, $dir or die "Cannot readdir $dir:$!\n"; my @files = grep /$pattern/,(readdir DIR); closedir DIR; print "@files\n"; foreach my $file (@files){ system ("somecommand $file"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Running Batch of Files
by tej (Scribe) on Oct 07, 2010 at 18:17 UTC | |
by tokpela (Chaplain) on Oct 08, 2010 at 02:27 UTC | |
by tej (Scribe) on Oct 08, 2010 at 02:44 UTC | |
by marto (Cardinal) on Oct 07, 2010 at 18:22 UTC |