in reply to Re: search a particular file
in thread search a particular file
here the @lis has all the different files in the directory... but the specific file is not fetched..#!/usr/bin/perl $path = "path to the directory"; chomp($path); chdir($path); @lis = `ls`; foreach (@lis) { if ($_ =~ m/^dump*txt$/) #say the file i want is dump_234_129_15.txt { print $_."\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: search a particular file
by raghu_shekar (Novice) on Mar 11, 2010 at 04:21 UTC |