Code Monkey home page Code Monkey logo

42-school-exam-rank-04's Introduction

42-school-exam-rank-04's People

Contributors

0bvim avatar cozy-hn avatar dolmalin avatar laendrun avatar martinthonon avatar nargin avatar pasqualerossi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

42-school-exam-rank-04's Issues

can't use pipe

You deleted implementation about pipe in this commit.
So the current program on master branch don't allow us to use pipe for example $>./microshell /bin/ls "|" /usr/bin/grep microshell ";" /bin/echo i love my microshell

Using the `__environ` variable.

it is reported that using the __environ is not allowed in the test.
In general, it's recommended to use environ rather than __environ, because environ is standardized by POSIX and is more portable across different systems. The __environ variable is not standardized and might not be available on all systems.
I would advise to use:

extern char **environ;

which is not a global and it is posix compliant.

Review

A lot of big mistakes in this code, it s odd that the moulinette allowed this to pass :

  • STDIN and STDOUT are not restored at the end of a pipeline, args like ./microshell "/bin/echo" "a" "|" "/bin/cat" "-e" "|" "/bin/wc" "-l" ";" "/bin/cat" will not work correctly (the last cat should read on STDIN).

  • Commands in a pipeline do not work simultaneously, args like ./microshell "/bin/yes" "|" "head" "-n" "20" will result in an infinite loop because the 'head' command will never start and cant sigpipe the first command. You must launch each command of the pipeline before waiting with waitpid.

It's disappointing to promote this kind of program even though the moulinette won't KO it.

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.