Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE LOOK AT PICTURE. Question 1: Creating Your Own Command Shell Write a program that will display a prompt to the user as following where

PLEASE LOOK AT PICTURE. image text in transcribed

Question 1: Creating Your Own Command Shell Write a program that will display a prompt to the user as following where the user can enter their commands -SHELL-FOURID On this prompt it will accept regular Linux commands from the user e.g. -SHELL-FOURID>s-l This command then will be executed by creating a child process and running the command in that child process. However, the output will not be displayed immediately to the user rather, will be stored in a named pipe. Once, the output is ready (child process will indicate to the parent process which is your shell (you are free to pick your logic here)), the parent process will indicate the user that the output of the process is ready, and if user agrees, it will be displayed on the screen. Winter 2019 LE/EECS 3221 The user will have two choices to run a command: foreground and background. In case of foreground request, when user will submit a command, the prompt will not be returned to the user. It will be returned only when the output is ready, as mentioned above. Below is an example output. The "FG" prefix indicates that command should be executed in foreground SHELL-YOURID FGI ...working on reques... ouput is ready. Display it now [ENSY Response of command SHELL-YOURID> In case of backrround request, when user will submit a command, a message indicating the submission of the command will be displayed and the prompt will be returned to the user for further commands. When the output is ready, the user will be indicated of that and if agreed the output will be delayed. Below is an example output. The "BG" prefix indicates that command should be executed in foreground SHELL-YOURIDBGI ....request sudmitted, reurning promp. SHELL-YOURID> ouputfor "BGIiseadyDisplay it now[YNY Response of command SHELL-YOURID> The key requirements in this program are: running the request in child process and implementing the FGBG feature. Additional algorithmic details are not significant, and students are free to pick their logic 1-A: Write type your source code in your submission file/document. Also, submit the.c file separatel,y 1-B: In your submission file'document, add a screenshot which displays: the execution of your program with the FG case the execution of your program with the BG case o o

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

More Books

Students also viewed these Databases questions