Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hw help please!!! PART 1 Implementing myshell and Capturing Result 40 peints Yoar shell program must provide services to support the following commands and features:

hw help please!!!
image text in transcribed
image text in transcribed
PART 1 Implementing myshell and Capturing Result 40 peints Yoar shell program must provide services to support the following commands and features: Note: The commands are shown in uppercase fow, but don't have to be programmed that way. The parameters to the commands are enclosed between the symbols , but the symbols are nen actually part of the parameters. a. (3 marks) STOP: Terminates execution of the current myshe 11 session. b. ( 3 marks) SETSHELLNME sshell_name>: Sets the shell name in the my she 11 command prompt to eshell_name>. For example, a sample coenmand promp is shown below: myshe 11> In this command prompt, there are two parts. The first part, myshe11, is the shell name. The second part, >, is the terminator. If no shell name is defined, my she 1 sheald be the default shell name, c. (3 marks) SETTERMINATOR Arminator>: Sets the terminator is the myake11 comanand pronspt to . If no terniator is defined, myahe 11 should use > as the default terminator. d. (10 marks) NEWNNME mew_name> I - : Manages the alias list. The first option deletes a previously defined alias. The second option defines an alias for anotber command. For example, the command NEWRAME mymove deletes the alias for mymove, the command NEVkAYy mycopy ep defines mycopy as the alias for the ep command. If an alias for a command already exists, then the new alias replaces the old alias. The maximam number of aliases in the alias list should be set to 10 as the default. c. (6 marks) L.1STNEWNAMES: Oulpues all the aliases that have been defined. Each pair of names should be shown on one line. For example, the possible aliases for a few commands are shown below: nyed ed mycopy cp f. (6 marks) SAVENEWNAMES file_name?: Stores all currently defined aliases in the file Cfite_naite?. g. (5 marks) READNEWNAMES >; Execules the UNIX command UNDXcommand >, correspooding to any valid UNIX command. If the first token on a conmand line is not a built-in command, assume that it is a UNIX command. i. (2 marks) HEL.P: shows all built-in commands supported by myshell. Nose: Yos must handle all the built-in commands with exactly the same syntax as shown above. Thus, an important part of the myshe 11 program will be to parse conmands entered at the coumand prompt to break them down into their component parts. Once a command has been paried, the component parts can be ehecked to ensure that a valid command has bece entered and that it adheres to the required syntax. Fer this peoblem, the results are worth 40 manks out of the 50 marks available. The breakdown of these marks is shown above. Demonsarate that your shell werks and that it can hundle all of the requirements described above. Your demonstration should be capeured in a script log file and follow the sequence of commands given bclow: PART 2 Error Hasdling 5 marks Finally, demonstrate that your shell can handle crrors. Your shell program should effectively identily and recover from errors. For example, tad input and or the inability to execute a command should not cause ryy he 11 to crash. This will be worh 5 marks ext of the 50 marks available. In eeder to receive all 5 marks, yoe ment be able to thanlle at least 5 different kieds of errors. Your demonstration should be captured is a stripe leg fille. PART 3 Progrummieg Style 5 marks Please ase the following style when programming: a. Opening Comment block' there sbould be cemments at the beginning of the program describing - Name, ID, the date you write this program. - Purpose: what the program does. b. Comment block for member functions: thene should be cemencnts before the member finction definition describing - Purpose: explain whar the flanction does. - Parameter(s): explain the purpose of cach parameter to the function. - Return: if this function sends back a value via a retam statensent. describe the purpose of that value bere. c. Indentaticol spacing: - Indenting each subcomoponent of sutemenes two er fiour spaces nsore than the construct within which it is nested. - A siagle space should be added on both nides of a binary eperator. - Place braces (i.e. { and i) on separate lines, aligned with one anocher and the preceding line. d. The deseriptive identifiers make programs eary to read

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_2

Step: 3

blur-text-image_3

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

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

Define and measure service productivity.

Answered: 1 week ago