Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in C. Solution must use system calls for obtaining input and generating output. MUST use system calls NOT library calls. Previous solutions incorrect. This

Code in C. Solution must use system calls for obtaining input and generating output. MUST use system calls NOT library calls. Previous solutions incorrect. image text in transcribed
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 The output saved to capture.txt might be: rw1 schubert the 51Jan 18 12:07 apple rw1 schubert them 27 Jan 18 12:09 banana rw+1 schubert them 13179 Jan 18 12:15 cantaloupe first line of file apple second line of file apple banana first and only line 41 217 cantaloupe 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 The output saved to capture.txt might be: rw1 schubert the 51Jan 18 12:07 apple rw1 schubert them 27 Jan 18 12:09 banana rw+1 schubert them 13179 Jan 18 12:15 cantaloupe first line of file apple second line of file apple banana first and only line 41 217 cantaloupe

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions