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

In unix - Take three arguments: a directory, a file pattern, and

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 file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!