Giter Site home page Giter Site logo

trash's Introduction

traSH

This is a continuation of the Unix-like shell I did in my OS class. I want to add more functionality that makes it more usable.

Goal

A complete overhaul of my previous sshell, along with additional features from a real shell (e.g. bash or tcsh). Below is a rough plan for this project

Phase 1: Single Execution with Status Display and IO Redirection

Phase 2: Pipelining

Phase 3: Background Execution

Phase 4: Shortcut to Previous Commands

Phase 5: Auto-complete?

Features

  • Execute programs or commands with arguments
  • Change current working directory
  • Redirect program input / output
  • Pipelining
  • Background execution

Additional Features

  • Log and reuse previous commands
  • Auto complete

Building

File Organization

  • ./include/ for all self defined header files
  • ./src/ for all source files
  • ./test/ for all testing files
  • Final executable names fshell is at the outer most folder

Conventions

Coding Style

Follows Kernel style, specifically:

  • 4 spaces indentation
  • Curly brackets start on the next line.
  • All operators padded with space, including if and while, except for function calls
  • All virtual disk files generated should be named *.fs
  • In line comment using single-line comments. Documentations using multi-line comments
  • Enforced offensive programing (success or crash)

Naming Convention

  • small_letter_snake_case for type alias, variables and functions
  • SCREAMING_SNAKE_CASE for macros
  • All type alias postfixed with _t
  • For functions associated with struct, function name always starts with the associated struct name, with the first parameter being the struct pointer.

Program Specification

Command_line and Command

Command_line

A Command_line is an entire line of command entered by the user. It is a string that terminates wirh "\n\0"

  • A command line cannot exceed 512 characters

Parsing Command_line

Command

A command is a string that issues a single shell command (built-in or otherwise). A command_line can consist of multiple commands pipelined together

  • There can be at most 16 arguments per single command. An argument can be as long as 64 characters

Pipeline

Testing

Unit testing c script and a total testing shell script

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.