

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Programming Assignment 2 : Interactive Shell Program Assigned Monday 22, 2008 Due Sunday Oct 12, 2008 Goal In this project you will write an interactive shell program. Your shell will implement a few basic commands, as well as learn how to create child processes. Furthermore, you will learn how to perform inter-process communication using the standard UNIX pipe and redirection mechanisms. Project Description In this assignment, you will develop a shell program called âcoolshellâ. This shell program will be a stripped down version of a common Linux shell. Your shell should be able to execute any binary/ program or command requested by the user. Project Specification As an example, the following illustrates the order of execution of âcoolshellâ : %> ./coolshell coolshell:~> ls [ output goes here ] coolshell:~> exit exiting coolshell ... %> (Note: When process is running in foreground, process should complete execution before returning to the prompt) Your âcoolshellâ program must support the following built in commands: cd Change the present working directory exit Exit from your interactive shell program echo Print the input. If prefix with $, print the current environment variable ls List the files and folders in the current directory. hist Displays the last 15 folders accessed, sorted oldest first.
Your shellâs prompt must follow these rules: