Thread Einen Ordner suchen
(11 answers)
Opened by Xertno at 2012-06-20 10:13
Schneller Hack:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #! /usr/bin/perl use strict; use warnings; use feature qw(say); use File::Find; use Cwd; my $name = shift; my $basedir = shift; exit 1 unless defined $name; $basedir = getcwd unless defined $basedir; die "'$basedir' is not a directory.\n" unless -d $basedir; # print full path if it is a directory and the last part matches $name find( sub { say $File::Find::name if -d $File::Find::name && $_ eq $name }, $basedir ); meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen! |