Creating a Simple Shell
Lets write a simple shell, which is a program that prompts users to type commands on the screen.
We previously wrote a program that can echo typed keys. But users could not tell whether what they type will appear on the display since the screen is blank. A prompt, which in this case is just the two characters '>' (greater than symbol) and ' ' (space), serves as a visual cue to the user that they can start typing.
When the user presses the "Enter" key, the computer should move to the next line and print the prompt again.
Here is an example:
> hello >
The user entered "hello" and then pressed the Enter key.
A real shell executes the command that was entered, but we are going to skip that step for now.
Please use the simulator below to add, edit, or remove instructions and test your solution. You are also free to change memory cell values to aid with testing.
When you are finished, click the "Submit" button to save your work and submit it for grading.
Comments
Please log in to add comments