[Solved]1 Tasks Task 1 50 Points Tee Command Reads Standard Input End File Writing Copy Input Stan Q37218213
please use c
1 Tasks Task 1 (50 points) The tee command reads its standard input until end-of-file, writing a copy of the input to standard output and to the file named in its command-line argument. Implement tee using I/O system calls open C) read), vrite. You can read about tee in its man page: san tee. Example session: echo ‘Test Text, I ./tee outfile Test Text $ cat outfile Test Text Task 2 (50 points) By default, tee overwrites any existing file with the given name. Using getopt), implement the -a command-line option (tee -a file), which causes tee to append text to the end of a file if it already exists You can read about getopt O function in Appendix B of The Linux Programming Interface” and in its man page: man 3 getopt. Example session (note that position of the option -a does not matter): echo TestText1I./tee file TestText1 串 cat file TestText1 $ echo TestText2I./tee -a file TestText2 cat file TestText1 TestText2 echo TestText3 I ./tee file-a TestText3 cat file TestText1 TestText2 TestText3 Show transcribed image text 1 Tasks Task 1 (50 points) The tee command reads its standard input until end-of-file, writing a copy of the input to standard output and to the file named in its command-line argument. Implement tee using I/O system calls open C) read), vrite. You can read about tee in its man page: san tee. Example session: echo ‘Test Text, I ./tee outfile Test Text $ cat outfile Test Text Task 2 (50 points) By default, tee overwrites any existing file with the given name. Using getopt), implement the -a command-line option (tee -a file), which causes tee to append text to the end of a file if it already exists You can read about getopt O function in Appendix B of The Linux Programming Interface” and in its man page: man 3 getopt. Example session (note that position of the option -a does not matter): echo TestText1I./tee file TestText1 串 cat file TestText1 $ echo TestText2I./tee -a file TestText2 cat file TestText1 TestText2 echo TestText3 I ./tee file-a TestText3 cat file TestText1 TestText2 TestText3
Expert Answer
Answer to 1 Tasks Task 1 (50 points) The tee command reads its standard input until end-of-file, writing a copy of the input to st… . . .
OR

