How to implement a script that returns all the files and directories (including the path) which name contains "$txt" from "$srcdir" ??
I am close to it using the File::Find module but not quite...
Try using a regex match instead. This will print any file or directory that contains the text in the $txt variable. You will have to modify it some if you want to match exactly.
Code:
find sub { print "$File::Find::name\n" if /$txt/ }, "$src";
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.