Build a Shell 🐚

The objective of this assignment is to build a UNIX style shell.

Outcomes:

What to submit:

Procedure:

  1. Download the provided starter files into your container

  2. Create a makefile (submissions/$USER/shell/Makefile)

  3. Set your shell as the init program and pass your shell a PATH environment variable

  4. Implement the features outlined below. This assignment will guide you through the process of building a shell by iteratively improving your code and adding more features, starting with a very simple program

Features:

  1. The shell prints a prompt (see man 2 write), which consists of the absolute path the shell is currently running in (see man 2 getcwd) followed by a $ and a space (e.g. /your/current/directory$)

  2. The shell reads lines of user input and calls the provided starter code to parse the input

  3. If the user hits enter without typing anything, nothing happens and the prompt is printed again

  4. The shell supports the following two builtin commands:

  5. The shell supports running executable files as commands within child processes

  6. In the case that the user types something that isn't a path or a builtin, the shell checks whether a file with that name exists (see man 2 access) in any of the directories listed in the PATH environment variable in order

  7. Redirect the input/output if any redirections are provided in a given command.

  8. The shell supports the | (pipe) operator to chain multiple commands and their inputs and outputs

Frequently Asked Questions


msg = (silence)
whoami = None
singularity v0.6-56-g8e52bc8 https://github.com/underground-software/singularity