1. Engineering
  2. Computer Science
  3. solution must only use system calls for obtaining input and...

Question: solution must only use system calls for obtaining input and...

Question details
Solution MUST ONLY use system calls for obtaining input and generating output. Examples of system calls are shown. Code in C.
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 ture.txt might be: Jan rW--1schubert then W-1 schubert them 27 Jan 18 12:09 banana rw-+1 schubert them 13179 Jan 18 12:15 cantaloupe irst line of file apple line of file apple first and only 1ine 41 217 cantal unlink open close dup read write lseek remove a file open a file for reading/writing close a previously open file duplicate an existing file descriptor extract info from a file put info into a file move to specified location in a file fork execl wait exit dup, dup2 duplicate an existing file descriptor kill create a new almost-copy of the current program replace program being executed with a new one wait for child process to complete terminate self Send a signal to a process .ТО send a signal: kill(pid, sig); To handle a signal: signal (sig, handler)
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution