Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help asap history at the osh> prompt. As an example, assume that the history consists of the commands (from most to least recent):
I need help asap
history at the osh> prompt. As an example, assume that the history consists of the commands (from most to least recent): ps, 1s -1, top, cal, vho, date The command history will output: 6 ps 5 1s -1 4 top 3 cal 2 who 1 date froeprogamd houl support two techniques for retrieving commands 1. When the user enters !, the most recent command in the history is 2. When the user enters a single followed by an integer N, the Nr the command history executed command in the history is executed. Continuing our example from above, if the user enters I I, the ps command will be performed; if the user enters !3, the command cal will be executed. Any command executed in this fashion should be echoed on the user's screen. The command should also be placed in the history buffer as the next command The program should also manage basic error handling. If there are no commands in the history, entering !! should result in a message "No commands in history."If there is no command corresponding to the number entered with the single , the program should output "No such comnand in historyStep 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