Question
Write a program in Python that implements a simple shell. The shell takes a user command as input and executes the command. When the shell
Write a program in Python that implements a simple shell. The shell takes a user command as input and executes the command. When the shell is started, it should take a user command as input, execute it and display the output. The following example shows an execution of the shell. It displays the command prompt uofmsh and takes the user commandlsas input from STDIN. It then executes the command ls and prints the output to STDOUT.
Implement the command cd in your shell using the chdir(2) system call. Make sure that cd - should change the directory to the last directory that the user was in. Verify that the cd command works correctly by using the pwd command which displays the current working directory.
$./uofmsh uofmsh> Is ** output of Is uofmsh> exit
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