Code Monkey home page Code Monkey logo

simple-multiprocessing-shell's Introduction

๐Ÿš [myshell] A Simple Shell with Multiprocessing and Pipes

About

myshell is a simple shell (command-line interpreter) capable of handling one command (with or without pipes).

It reads a single line from the stdin, lexes it, then executes it via execvp.

More information can be found here.

Team members and contribution

  • Gary Tou (@garyhtou)
    • Parsing and lexing function (Helper::lex) that also handles quoted strings
    • File descriptors and forking
    • Object orientated Command class for more organized code
  • Castel Villalobos (@impropernoun)
    • Makefile
    • Handle difference between single vs multi-command
    • Set up pipes
  • Hank Rudolph (@hankrud)
    • Setup and call execvp
    • Convert C++ string to c string
    • Prompt and get input

Strengths and Weaknesses

Strength:

  • Handles quoted strings. eg. echo "it works on my machine"
  • Object orientated design (See Command class)
  • Able to handle "unlimited" commands and arguments (not restricted to the 10 commands and 20 arguments per command requirement from the instruction)
  • Well commented

Weaknesses:

  • Shell does not run continuously
  • Does not handle changing operators such as &&, ||, and ; (it does handle |)
  • Does not handle environment variables

The program is composed of three files:

  • myshell.cpp: Contains the main function and handles the coordination of multiple commands and pipes.
    • Gets the inputted command and parses and lexes it.
    • Then runs it as either a single command (no pipes) or multi-command (with pipes).
  • command.cpp: Responsible for executing the commands and managing pipe file descriptors.
  • helper.cpp: Contains functions that parses and lexes commands into tokens, as well as handles whitespace.

simple-multiprocessing-shell's People

Contributors

garyhtou avatar hankrud avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.