Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago