/msh

A shell program for Minix

Primary LanguageC

msh -- A minix's shell program

Introduction

msh which is short of Minix's Shell is initialized for the project assigned from the course CS551 at IIT.

In this project, you will write your own shell with some minimum requirements from us:

  1. Your shell shall be invoked from the Ash shell provided with Minix.
  2. Your shell shall first execute a PROFILE file which defines the “prompt sign” and allows you to access programs provided in /bin and /usr/bin. Once the PROFILE file is executed, you will be in a HOME directory specified by you in the PROFILE file.
  3. In a command line of your shell you will be able to exercise utilities provided in /bin and /usr/bin. You will need to show that you can do the following:
  • a) A command with or without argument such as: cat, ls
  • b) A command with or without argument whose output is redirected to a file such as:ls –l > filename
  • c) A command with or without argument whose output is piped to the input of another command such as:cat filename | wc
  1. In a command line, your shell can execute a simple application program that will spawn a new process. The application will echo the process id of the new process then exits.
  2. In a command line, you can define integer variables (such as i with its value indicated by $i) and evaluate integer expressions. Cannot use environmental variables.
  3. Your shell shall provide a facility that allows a first command to be run and its output to be pasted back as input to another command. The first command is enclosed within $(…). E.g. $ wc $(fgrep –l malloc *.c) will count the number of statements containing the string “malloc” in all the .c files under the current directory This problem must be implemented by using system call.
  4. (Bonus): Can you nest the $(…) facility? Or other interesting feature.
  5. Your shell shall be terminated by exit or ctl-c. If it is terminated by ctl-c, it first asks the question “Are you sure?”, and wait for confirmation before terminating.
  6. Submit the following in a VMplayer readable package:
  7. An executable of your shell
  8. Source code of your shell programs
  9. Any other executable and shell scripts to test your programs
  10. A readme on how to use and test your program
  11. You will be graded on the robustness of your program.
  12. Submit a design document of no more than 3 pages (minimum 10 points font) including figures, which must discuss exception handling. The project is due February 2, 2012; February 3 for remote and India students. Self evaluations are due 24 hours afterwards and are private.

Development

Prerequisites

  • git
  • make
  • gcc

Steps

####1. fork this project

git clone git://github.com/bfeng/msh

####2. write you code

####3. commit

git commit -a "Your comments"

####4. push commits

git push origin master

####5. pull requests

howto

License

GPL v3