Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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.

image text in transcribed

$./uofmsh uofmsh> Is ** output of Is uofmsh> exit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions