Question
In unix - Take three arguments: a directory, a file pattern, and a search string - Look for the search string inside the files determined
In unix
- Take three arguments: a directory, a file pattern, and a search string
- Look for the search string inside the files determined by the directory and the file pattern.
- Print the number of files that contain the pattern
- Print the names of the files that contain the pattenumrn
- Calculate the average words per file in all the .doc files in the directory. The calculation must be to four decimal places.
- Print the average words per file for the .doc files
- Use bc and a here-document to calculate the average word count of the .doc files
- Calculate the average word count to four decimal places
Output should look like
Found ?? matches for search-string in dir/file_pattern The files containing matches were: list of file names here There are ?? . doc files in dir The .doc files average ??.???? words per fileStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started