Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C Program Please use system calls only! Use the fork() and execv function please! Help please! read input file and send to output of commands
C Program Please use system calls only! Use the fork() and execv function please! Help please! read input file and send to output of commands to capture.txt file!
C Program Please use system calls only! Use the fork() and execv functions please! Help please! read input file and send to output of commands to capture.txt file!
2. capture This solution to this problem will require using some system calls that will be discussed in week 3. This program should accept the name of a file that includes a list of commands (one per line) to execute. Each line of the file should be executed by a subprocess and the output written to the file capture.txt For example, given the command file /bin/ls -1 /bin/cat apple banana /usr/bin/wc -1 -w canteloupe The output saved to capture.txt might be: 51 Jan 18 12:07 apple rw---+1 schubert them -rw1 schubert them 27 Jan 18 12:09 banana 1 schubert them 13179 Jan 18 12:15 cantaloupe first line of file apple second line of file apple banana first and only lineStep 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