Question: 1. [10 points] Write a C program in simtee.c that is a simplified version of tee [Mic21]. It should take exactly one argument ( )

 1. [10 points] Write a C program in simtee.c that is

1. [10 points] Write a C program in simtee.c that is a simplified version of tee [Mic21]. It should take exactly one argument ( ) and, using system calls, copy the standard input to the standard output as well as to outfile. If outfile already exists, it should be overwritten; the file should be created if it does not exist. Note: Multiline input is allowed. The user should use Ctr+D to indicate end of input. The gif files provided show sample interaction with the executable simtee.out: - sample1: simtee. out invoked directly from the command line; you can see the input provided directly from the command line and how it is echoed line-by-line as also written to the argument file provided. - sample2: input piped to simtee.out; shell manages the connection of the output of cat to the input of simtee.out; you can then see the output on stdout as well as in the file provided as argument. Note: simtee doesn't need to provide any of the options made available by tee. Note: You should not use TEE(1) or TEE(2). An error message should be displayed if no file name is provided as argument (see Listing 1). Listing 1: simtee should take exactly one argument. Deliverable: simtee.c, readme.txt

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!