LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shell script to search a pattern in a diretory and output number of find counts (http://www.linuxquestions.org/questions/linux-newbie-8/shell-script-to-search-a-pattern-in-a-diretory-and-output-number-of-find-counts-4175420757/)

vivignesh 08-07-2012 12:59 AM

shell script to search a pattern in a diretory and output number of find counts
 
I need a Shell script which take two inputs which are
1) main directory where it has to search and
2) pattern to search within main directory all files (.c and .h files)
It has to print number of pattern found in main directory & each sub directory.
main dir --> Total pattern found = 5
|
sub dir --> 3
|
sub dir --> 2

EricTRA 08-07-2012 01:14 AM

Hello,

You'll have a hard time finding someone here on LQ that will do your work for you. Show us what you've got and where it's failing and we'll point you in the right direction. Good starting points are:
Bash Guide for Beginners
Advanced Bash Scripting Guide

Kind regards,

Eric


All times are GMT -5. The time now is 11:28 PM.