Question
Linux Operating System tee is a Linux shell command that will take the output of a command and route it into a stdout AS WELL
Linux Operating System
"tee" is a Linux shell command that will take the output of a command and route it into a stdout AS WELL AS to multiple files or commands. For example: cat file.txt | tee > (do_stuff1_to_cat_output) > (do_stuff2_to_cat_output) > (do_stuff2_to_cat_output). For the third assignment, you are implementing your own shell: mysh. Write a pseudo-code implementation of this command as if you would be implementing it as a part of the assignment 3. for your sell (mysh). Use kernel pipes, dup, dup2 system calls to accomplish this. Let's say your code will implement new operator "||" that will pipe an output of a proceeding command to stdout and any number of commands afterwards separated by multiple ">".
For example: $ echo "this is my text" || grep this > grep my > wc-c
Here text "this is my text" will be echo-ed on stdout and it is also used by grep as its input to do "grep this" and "grep my" and "wc-c" (wordcount command) the output should be:
$ this is my text
$ this is my text
$ this is my text
$16
a.) Write pseudo-code for handing "||" with two commands following the special character "||"
b.) Generalize the command for any number of commands following the special character "||"
Step 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