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
Get step-by-step solutions from verified subject matter experts
