Question: In this assignment, you are to explore the use and programming of some system calls through the creation of a simple shell program (you are

In this assignment, you are to explore the use and programming of some system calls through the creation of a simple shell program (you are writing a simple user-interface to the operating system).

In several cases, your shell program is implementing built-in commands. In others, it is to use exec to execute external commands. The list of built-in commands that your shell must support includes date, cd, mkdir, rmdir, pwd, kill, echo, hostname, and exit. This means that your program must implement these commands directly by using the system calls that implement them, or otherwise (echo doesn't require a system call). For all of the listed commands, do not use exec to implement them. Additionally, the exit and cd commands are special cases described below.

For all other commands (not built-in), your program must implement them using exec (using some version of exec). Because your program is to implement a simple shell, it should operate in a fashion similar to that as illustrated in the book

while (true) { print a command prompt get a line of user input if (they didn't type "exit" or "cd") { create a child process if (I am the parent) wait for the child else (I am the child) directly execute the sys call - OR - execute the command using a version of exec. } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!