I managed to find thelist of files in a directory as below:
Expand|Select|Wrap|Line Numbers
grep {/\.txt$/i}
How do I use grep statement to list directories of statting name as test...
Thanks and Regards
Expand|Select|Wrap|Line Numbers
my @dirs = grep { chomp; /^\.\/test/i } `find . -type d -maxdepth 1 -iname "*"`;
Assuming u r working on unix/linux, above code can be used to store directory names (into @dirs) that start with 'test'. If you want to find directories recursively remove '-maxdepth 1' from the find command...