Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objectives To add additional features to thesearchprogram implemented in Project #2. Description The goal of this project is to add additional functionality to thesearch program
Objectives To add additional features to thesearchprogram implemented in Project #2. Description The goal of this project is to add additional functionality to thesearch program implemented in Project #2. In addition to the functionality described in Project #2, the program must support the following command-line options: 1.-e "" For each file that matches the search criteria the UNIX command specified with arguments must be executed. 2.-E "" [Graduate Students Only] The list of files that matches the search criteria must be provided as an argument to the UNIX command specified. Note that with the-e option the UNIX command is executed for each file whereas with the- E option the UNIX command is executed only once but uses all the file names as the argument. You must use fork/exec/wait to create a new process to execute the UNIX command. The UNIX command and any optional arguments are enclosed within double quotes. The program should support-e or-E options in combination with-s and-f options. You can assume that the-e or-E options appear after the-s and-f options. Guidelines and Hints 1.You should use a Makefile to compile and build this project and make sure to submit the Makefile along with the rest of the source code. 2.You should upload all the source code, Makefile, and a README.txtfile to Canvas. Please do not upload any object files or executable files.Program Documentation and Testing 1.Use appropriate names for variables and functions. 2.Use a Makefile to compile your program. 3.Include meaningful comments to indicate variousoperations performed by the program. 4.Programs must include the following header information within comments:4.Test your program with the sample test cases provided as well as your own test cases. 5.You can include any comments you may have about testing in the README.txtfile. Examples CommandDescription $./search-s 1024-e "ls-l" List all files with size >= 1024 bytes in thecurrent directory and execute the command "ls-l" on each file (ignore directories) $./search-f jpg-E "tar cvf jpg.tar" List all files that have the substring jpg in their filename or directory name in the current directory and creates a tar file named jpg.tar that contains these files $./search-s 1024-e "wc-l" List all files that have the substring jpg in their filename or directory name with size >= 1024 in the current directory and execute the command "wc-l" on each file (ignore directories) Sample Input and Output: If you have the following directory structure as shown by the output of "ls-lR" command: $ ls-R projects projects: fread.c fwrite.c project1 project2 project3 project4 read.c write.c projects/project1: project1.docx README projects/project2: project2.docx README projects/project3: project3.docx README projects/project4: project4.docx README Then the output of find without any argument should look like this: projects fread.c fwrite.c project1 README project1.docx project2 project2.docx README project3 project3.docx README project4 project4.docx README read.c write.cSubmission Guidelines Use a Makefile to compile andbuild the multiple files. Document you code and include instructions for compiling and executing the program in theREADME.txtfile.
Step 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