Question: please write in c or c++ Write a program that repeatedly runs another program. Requirements: - The compiled program must be called 'repeatedly_run'. - a

 please write in c or c++ Write a program that repeatedly

please write in c or c++

Write a program that repeatedly runs another program. Requirements: - The compiled program must be called 'repeatedly_run'. - a Makefile which allows markers to build your program with 'make', and clean up any produced files afterwards using 'make clean'. - repeatedly_run should take a list of arguments. It must receive at least 3 arguments. - The first argument is the number of seconds between executions of the given program. This must be an integer >=1. - The second argument will be the number of times it runs the program. This will be either an integer >=1 (the number of times to run the given program), or 1 (if it should keep running the program indefinitely). - All the remaining arguments compose the command which will be repeatedly run. This could be any number of additional arguments (e.g. you might get 3, you might get 7 , you might get 25) - If the specified program does not exist, or if no arguments are given to repeatedly_run, then repeatedly_run should exit with a failure status. - You may not use the function called 'system'. As discussed in class, use an exec call to cause the given program to run. There are multiple variants of exec, as listed in 'man 2 exec'. Example

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!