Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PART 1 Implementing myshell and Capturing Result 40 points Your shell program must provide services to support the following commands and features: 1 Note: The
PART 1 Implementing myshell and Capturing Result 40 points Your shell program must provide services to support the following commands and features: 1 Note: The commands are shown in uppercase font, but don't have to be programmed that way. The parameters to the commands are enclosed between the symbols and , but the symbols are not actually part of the parameters. a. (3 marks) STOP: Terminates execution of the current myshell session. b. (3 marks) SETSHELLNAME > : Sets the shell name in the myshell command prompt to >. For example, a sample command prompt is shown below: myshell> In this command prompt, there are two parts. The first part, myshel1, is the shell name. The second part, >, is the terminator. If no shell name is defined, myshell should be the default shell name. c. (3 marks) SETTERMINATOR : Sets the terminator in the myshell command prompt to >. If no terminator is defined, myshel1 should use > as the default terminator. d. (10 marks) NEWNAME > | > : Manages the alias list. The first option deletes a previously defined alias. The second option defines an alias for another command. For example, the command NEWNAME mymove deletes the alias for mymove, the command NEWNAME mycopy cp defines mycopy as the alias for the cp command. If an alias for a command already exists, then the new alias replaces the old alias. The maximum number of aliases in the alias list should be set to 10 as the default. e. (6 marks) LISTNEWNAMES: Outputs 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: mycd cd mycopy cp f. (6 marks) SAVENEWNAMES > : Stores all currently defined aliases in the file file_name >. g. (5 marks) READNEWNAMES file_name > : Reads all aliases in the file file_name . h. (2 marks) UNLXcommand >: Executes the UNIX command UNLX command , corresponding to any valid UNIX command. If the first token on a command line is not a built-in command, assume that it is a UNIX command. i. (2 marks) HELP: shows all built-in commands supported by myshell. Note: You 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 commands entered at the command prompt to break them down into their component parts. Once a command has been parsed, the component parts can be checked to ensure that a valid command has been entered and that it adheres to the required syntax. PART 1 Implementing myshell and Capturing Result 40 points Your shell program must provide services to support the following commands and features: 1 Note: The commands are shown in uppercase font, but don't have to be programmed that way. The parameters to the commands are enclosed between the symbols and , but the symbols are not actually part of the parameters. a. (3 marks) STOP: Terminates execution of the current myshell session. b. (3 marks) SETSHELLNAME > : Sets the shell name in the myshell command prompt to >. For example, a sample command prompt is shown below: myshell> In this command prompt, there are two parts. The first part, myshel1, is the shell name. The second part, >, is the terminator. If no shell name is defined, myshell should be the default shell name. c. (3 marks) SETTERMINATOR : Sets the terminator in the myshell command prompt to >. If no terminator is defined, myshel1 should use > as the default terminator. d. (10 marks) NEWNAME > | > : Manages the alias list. The first option deletes a previously defined alias. The second option defines an alias for another command. For example, the command NEWNAME mymove deletes the alias for mymove, the command NEWNAME mycopy cp defines mycopy as the alias for the cp command. If an alias for a command already exists, then the new alias replaces the old alias. The maximum number of aliases in the alias list should be set to 10 as the default. e. (6 marks) LISTNEWNAMES: Outputs 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: mycd cd mycopy cp f. (6 marks) SAVENEWNAMES > : Stores all currently defined aliases in the file file_name >. g. (5 marks) READNEWNAMES file_name > : Reads all aliases in the file file_name . h. (2 marks) UNLXcommand >: Executes the UNIX command UNLX command , corresponding to any valid UNIX command. If the first token on a command line is not a built-in command, assume that it is a UNIX command. i. (2 marks) HELP: shows all built-in commands supported by myshell. Note: You 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 commands entered at the command prompt to break them down into their component parts. Once a command has been parsed, the component parts can be checked to ensure that a valid command has been entered and that it adheres to the required syntax
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started