Git Product home page Git Product logo

ecs150project1's Introduction

ECS150Project1

Group Members:

Hengze Ye
Fengshuo Song

Implementation:

The function “tokentocommand” changes the types of each subcommand, which is separated by “|” from string to struct Command. It takes 2 arguments: the first one is the receiver, and the second argument is the subcommand that need to be processed. We replace all spaces by ‘\0’, read each argument and store them in a 2D array. When there is a “>”, it finds the output filename and then links the file descriptor to standard output. The function “parse” splits a whole command by “|”, and manipulates each subcommands by the function “tokentocommand”. It takes 2 arguments: the first one is the receiver, and the second argument is the command that need to be processed. The function “process” executes the command. It takes one argument of type struct Command, and then returns what the command returns if successful. The function “initialization” initializes the command by assigning each term to be NULL.

Test Methods:

We used the reference shell to test different cases of command input and compare the output to our shell. We also added several printers to in our code to see where the bugs come from.

Sources:

We learned how to use strtok() function from the website https://www.tutorialspoint.com/c_standard_library/c_function_strtok.htm We also learned getcwd(), chdir(), strcpy() from GNU library.

ecs150project1's People

Contributors

fengshuo-song avatar

Stargazers

Eason Wang 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.