Leser: 2
8 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/usr/bin/perl -w use strict; use File::Find; @Verzeichnis = ("Subdir1","Subdir12","Subdir3"); find(\&wanted, @Verzeichnis); sub wanted { $File::Find::dir = "/home/james/gbt" $_ =~ m/pdf/ } #END
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#! /usr/bin/perl -w eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; #$running_under_some_shell use strict; use File::Find (); # Set the variable $File::Find::dont_use_nlink if you're using AFS, # since AFS cheats. # for the convenience of &wanted calls, including -eval statements: use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; sub wanted; # Traverse desired filesystems File::Find::find({wanted => \&wanted}, '/home/james/gbt'); exit; sub wanted { /^.*-.*\.pdf\z/s && print("$name\n"); }
8 Einträge, 1 Seite |