CSCI 420 - Operating Systems & Concurrency

Spring 2017

Rush - the Rust Shell, part 2

Assignment

In this assignment, we continue implementing an interactive Unix shell using the Rust language. Implement your shell according to the following steps:
  1. If the line ends with the & symbol, it should run in the background. That is, your shell should not wait for it to terminate; the command line should immediately return. Your shell should print the PID of the process, so that the user may later manage it as needed.
  2. The line may contain two or more commands connected with the pipe symbol (|). If this happens, start a process for each command, setting up pipes to send the output of each left-hand command to the input of the following right-hand command.
  3. If the line contains a < symbol, the immediately following string is the input source for the command. If it contains a >, the command's output goes to the targeted file.
  4. The * pattern-matching symbol should work with arbitrary paths.

Grading

Completing each step is worth 10 points. Full credit will be received for completing any three of the steps, so the assignment is worth 30 points. If an additional step is completed, it will be worth 10 points of extra credit. Furthermore, if the first three steps are completed and they will all work together properly on a single command line, that is also worth 10 points of extra credit. No credit will be given for code that fails to compile. Partial credit may be given for incomplete or flawed versions of a given step.

Tips

Acknowledgement

This assignment was adapted from materials developed by David Evans at the University of Virginia.