Giter VIP home page Giter VIP logo

rshell's Introduction

rshell

This is a program that execute the function of shell command. It uses getlin to take command. Then parse the command into to char** argv2. At last, execvp function helps to achieve the function as shell command.

#There are severl bugs in the programm:

  • The username and hostname are set up contain only 256 spaces, the content cannot exceed this; otherwise, it cannot show the information of a user.

  • The getlogin_r does work in local computer, but doesn't work after start scripting

  • The strtok function cannot handle first argument perfectly, bin/rshell and ./a.out will work since the path is work because they are in the same directry as the program. But it doesn't work if a wrong command was input such as ./b.out, it will return instead of finding other paths.

  • The program also cannot parse the command like "-l-a" it will treat then as only one part not "-l", "-a".

  • When parsing command "#", it will ignore all the stuff beyond it,but the "#" cannot stay near any command such as "#-l" or "-l#" these two command will not work. It can only work with "ls # -l".

  • The & is not perfect, it can be taken from the middle of command, and ignore the rest behind. So a user has to put the & in the end of command, or it won't work as expect.

  • For signal ^C, in the initial state, if a user type in ^C, it does nothing but print out the `^C' in the same line, untill a command was type in.

  • For signal ^Z, program will be stopped untill typing in fg or bg. If the command runs an app such as gedit, both fg and bg will work correctly, but if run command cat, bg won't work; however, ^Z and fg still work.

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.