Question: Assignment 2: Linux System Calls - Process Management Write a C++ program that forks two child processes: 1- Child 1 process will look for all


Assignment 2: Linux System Calls - Process Management Write a C++ program that forks two child processes: 1- Child 1 process will look for all the C++ programs stored in your home directory and store the searching results in a text file called (CPP_files.txt). (ONE statement ONLY to accomplish this task) Hint: you need to use (find *.cpp) command, the result of the find command should be stored in the CPP_files.txt file. 2- Child 2 process should reads the content of (CPP_files.txt) file and it should find number of lines in each .cpp file and store the results in a file called Output.txt Hint: you need to use the (wc-1) command. Child 2 MUST use the execve system call to accomplish its task. 3- At the end, the parent Process should delete the CPP_files.txt file. CPP_files.txt prog1.cpp test.cpp prog2.cpp Assignment_1.cpp Output.txt 15 progi.cpp 48 test.cpp 12 prog2.cpp 60 Assignment_1.cpp A Sample program that reads from file in C++: #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
