Giter VIP home page Giter VIP logo

42sh's Introduction

42sh

The project consist to write a Unix SHELL.

It have two sections to achieve:

  • a mandatory section, which MUST be completed: display a prompt, parse and execute some commands (see below),
  • an optional section, which will only be evaluated if the mandatory section is fully functionnal.

Authorized functions: all functions included in the libC nor the ncurses library.

The 42sh is a shell that mimic the tcsh shell in it's behavior. For example, it followed the sames errors messages and parsing rules. (We're using tcsh version tcsh 6.24.07 (Astron) 2022-12-21)

Requirements of the project

Mandatory section

This section must be COMPLETELY FUNCTIONAL, otherwise the project will be considered non functional and will receive a 0 grade.

  • spaces and tabs,
  • $PATH and environment,
  • errors and return value,
  • redirections (‘<’, ‘>’, ‘<<’ and ‘>>’),
  • pipes (‘|’),
  • builtins: cd, echo, exit, setenv, unsetenv,
  • separators: ‘;’, ‘&&’, ‘||’.

For instance, you should be able to execute the following command:

∼/B-PSU-210> ./42sh
42sh> cd ; </etc/hosts od -c | grep xx | wc >> /tmp/z -l ; cd - && echo “OK”

Optional section

The most of your points you can get for the project are from this section. This project is free-rein and can do what you want. However, the entire project’s coherence will be taken into consideration. Once more, stability will be much more important that quantity. An option that will cause a problem for the rest of the program (especially for the mandatory section!) will make you lose a lot of points.

Here is a list of desired extras:

  • inhibitors (‘\’),
  • globbings (‘*’, ‘?’, ‘[’, ’]’),
  • job control (‘&’, fg),
  • backticks ("`"),
  • parentheses (‘(’ and ‘)’),
  • variables (local and env),
  • special variables (term, precmd, cwdcmd, cwd, ignoreof for instance),
  • history (‘!’),
  • aliases,
  • line edition (multiline, dynamic rebinding, auto-completion dynamic),
  • scripting (a bit harsh though).

These extras are not bonuses! Bonuses will be evaluated only after every item on this list have been correctly implemented.

Needed packages to compile the project

  • gcc
  • make

How to compile the project

  • Clone the repository
  • Run make in the root of the repository
  • Run ./42sh
  • Enjoy

How to use the shell

  • Run ./42sh
  • Type a command
  • Poof magic

Dependencies

RepoCard

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.