Welcome to the Most Reliable Essay writing Service Online

MyShell is to continually prompt

by | May 24

Assignment 1MyShellDue Date: Wednesday May 8th, 2019 @ 11:59 pmThe purpose of this assignment is to use the fork, wait, and execvp to write a simple Linux shell.This shell is called “MyShell”, and the goal of MyShell is to continually prompt the user to supply acommand, execute that command, and show the next prompt, once the command is executed.The file MyShell.c is already given to you. The file contains the functions shown in the below table. Youshould NOT change the method signatures. You should implement the missing portions of the program asper the guidelines given below. You may add additional functions if necessary.

int main(int argc, char** argv)
Parameters: int argc, char **argvReturn: EXIT_SUCCESS

char** parse(void)
Parameters: noneReturn: char** pointer

int execute(char** args)
Parameters: char** argsReturn: 0/1

int main(int argc, char** argv)• The main function should display the MyShell> prompt. You should not change the name of theprompt.• The main function should indefinitely run until terminated by CTRL+C or when the user types theexit command in the MyShell> prompt.• It should call the parse() function in order to accept and process the command the user enters• It should call the execute() function to actually execute the commandchar** parse(void)• Gets the input typed by the use in the MyShell> prompt in the form of a line• Splits the line into tokens• The tokens are used to create a char** pointer which will serve as an argument for execvpint execute(char** args)• char** args is obtained from the parse function• You should fork a child and execute the command typed in by the user using EXECVP. You shouldonly use execvp and not other versions.• When fork fails, an error message should be printed. However, the next MyShell> prompt shouldbe shown.• When execvp is not successful, an error message should be printed, and the child should terminate.However, the next MyShell> prompt should be shown.• When an empty command is entered, the next MyShell> prompt should be shown.• When the command exit is entered by the user, the main program must exit [You may or may notfork in order to implement the exit command].• The parent should wait for the child to terminate before it accepts another command. You can usewait or waitpid for this.Other guidelines:• User command plus arguments will not exceed 255 characters• Only one command should be typed at the MyShell> prompt, no pipelining of commands• Commands run in MyShell> will assume the user’s original path: Type “echo $PATH” to see thecurrent path variable setting. Myshell is not responsible for finding the path for the commands orfiles.• If the user makes a mistake typing a command and/or its arguments, execvp should simply fail torun the command. A simple error should be shown, but next MyShell> prompt should be displayed.What you should submit: A single, completed file MyShell.c to canvasSample Output:Grading RubricThis assignment will be scored out of 100* points. (100/100)=100%110 points are possible.External Correctness:• MyShell> is displayed correctly 5• MyShell> accepts user input 5• MyShell> is displayed after executing a command 10• MyShell> is displayed after execvp fails 5• MyShell> is not displayed after the exit command 5• The command user types are executed 10• The command user types are executed, and the results are displayed 10• When the user types an empty command, no error message is printed and the next MyShell> promptis displayed 10• When the user types exit the program terminates 10• When the user presses CTRL+C, the program terminates 10Internal Correctness:• The execvp command is appropriately implemented with the correct arguments 5• After fork, the parent waits for the child to terminate 5• The user input is parsed and tokenized to suit the execvp arguments 5• There is code to display MyShell> prompt infinitely, except when exit command or CTRL+C isgiven 5Extra Credit:• If your program accepts user input (with unlimited length) you will receive additional 10 points
The post MyShell is to continually prompt appeared first on My Assignment Online.

  

CLIENT TESTIMONIALS

The Service Is Okay. I won’t Complain

The writers on the website are courteous and the customer service responds quickly. My paper was handled well; They promised...

Writers here are very professional and are native British

Thanks a lot for helping me out with my PhD Thesis, Writers here are very professional and are native British!!

Jack, The United Kingdom

Very Very Helpful, and On time.

Very Very Helpful, and On time.

Adelio M, Spain

I scored complete A’s in 3 out of four courses

I scored complete A’s in 3 out of four courses

Anonymous, Illinoi Chicago

CLICK HERE  To order your paper

About Essaysmiths Assignment writing service

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for upto 20% off in their first Order. Our payment method is safe and secure.

 CLICK HERE to Order Your Assignment

 

Recently Posted Questions.

Order your Assignment today and save 15% with the discount code ESSAYHELP

X