Overview

The aim of this undertaking is to acquire hands-on experience in utilizing system calls and managing processes. Specifically, your task involves creating a fundamental shell in C/C++, utilizing fork, exec, and wait system calls. The given code serves as the foundation for a basic shell program in C++ designed for a Unix-like environment. This shell enables users to engage with the system by inputting commands, executing them, and presenting the results. Your goal is to manage user input, execute the relevant command(s), and incorporate pipes as necessary.

Learning Objectives

  1. Apply your understanding of process management.
  2. Define and implement a shell program used in a typical Unix environment.
  3. Use the fork, exec, and wait system calls.
  4. Learn the basics of interprocess communication by using pipe() and dupe2().
  5. Understand how to upload a project to Gradescope.
  6. Become oriented to the structure of a project.

Slides: Explain Pipe by Dave

https://docs.google.com/presentation/d/1EJvY-rIxUjKc6VdsUF16YXVmZZ8hg4eZeuBfuPlAXas/edit?slide=id.g3028c11209e_0_462#slide=id.g3028c11209e_0_462

Video (a bit outdated compared to the slides)

Please refer to the slides for more accurate info.

video1760803530.mp4

Getting Started

Starter Code:

project_shell.zip

  1. Download the starter code.
  2. Unzip the project_shell.zip with the following command unzip -d PROJECT project_shell.zip. This will create a new directory called PROJECT. You can replace PROJECT with a directory name of your choice.