Write C Program List Files Contents Directory Subdirectories Matches Given String Emulate Q37077359

Write a C program to list all files and its contents in adirectory and subdirectories that matches a given string.

It should emulate the following UNIX command: find . -name ‘*.c’-print -exec grep Bill {} ; Basically it prints out every C filesthat contains Bill along with information of its directories andsubdirectories. Something like this:

Author: Bill Mahoney
./lens.c
Author: Bill Mahoney
./update.c
Author: Bill Mahoney
./udis86_modified/libudis86/syn.c
// Bill was here
// Bill was here
// Bill was here
// Bill was here
./udis86_modified/libudis86/syn-intel.c
./udis86_modified/libudis86/itab.c
./udis86_modified/libudis86/udis86.c
./udis86_modified/libudis86/syn-att.c
./udis86_modified/libudis86/decode.c
/* Bill was here */
/* Bill was here – new function */
/* Bill was here – Additional parameter */
/* Bill was here – Additional parameter */
/* Bill was here

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.