Starting from:
$29.99

$26.99

Shell in C_Program 3 Complete


Overview
In this assignment you will write your own shell in C. The shell will run command lineinstructions and return the results similar to other shells you have used, but without manyof their fancier features.In this assignment you will write your own shell, called smallsh.This will work like thebash shell you are used to using, prompting for a command line and running commands,but it will not have many of the special features of the bash shell.Your shell will allow for the redirection of standard input and standard output and it willsupport both foreground and background processes.Your shell will support three built in commands:exit,cd, andstatus. It will also supportcomments, which are lines beginning with the # character.SpecificationsAll execution, compiling, and testing of this program should be done from the bashprompt on the eos-class.engr.oregonstate.edu server.Use the colon : symbol as a prompt for each command line. Be sure you flush out theprompt each time you print it, this makes the test script look nicer.The general syntax of a command line is:command[arg1arg2...][<input_file][output_file][&]…where items in square brackets are optional.You can assume that a command is madeup of words separated by spaces. The special symbols <, , and & are recognized, but they must be surrounded by spaces like other words. If the command is to be executed inthe background, the last word must be &. If standard input or output is to be redirected,the or < words followed by a filename word must appear after all the arguments. Inputredirection can appear before or after output redirection.Your shell does not need to support any quoting; so arguments with spaces inside themare not possible.Your shell should support command lines with a maximum length of 2048 characters, anda maximum of 512 arguments. You do not need to do any error checking on the syntax ofthe command line.Command ExecutionYou will use fork, exec, and waitpid to execute commands.The shell will wait forcompletion of foreground commands (commands without the &) before prompting for thenext command.The shell will not wait for background commands to complete.

More products