Question: Write a C program to implement the command line shell that does the following: A prompt should be displayed upon starting the execution of

Write a C program to implement the command line shell that does the following:
● A prompt should be displayed upon starting the execution of a program and it should allow the user to type basic linux commands one after the other. The program must support at least any 6 commands such as pwd, ls, cd, mkdir, rmdir, rm,cp, etc.
● For each of the user’s commands entered, a separate child process should be created to execute the command and display the output if any.
Note: After displaying the output of each command, the prompt should ask the user for other commands for input and it should be terminated only when the user types the command exit.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer The c code is as follow include include include include include define MAXCOMMANDLENGTH ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!