Giter Site home page Giter Site logo

minishell's Introduction

Minishell

projet made by

Antoine and 0cculus

for this projet you need

  • gcc

  • make

  • readline

if you are missing one of those you can install them with

$ sudo apt install gcc
$ sudo apt install make
$ sudo apt install libreadline-dev

how to install it use:

$ https://github.com/sm222/minishell.git && make

to open it use

$ ./minishell
1WcBSTY.-.Imgur.mp4

what was ask for the projet

  • Display a prompt while waiting for a new command.
  • Have a functional history.
  • Find and launch the correct executable (based on the environment variable PATH, or on a relative or absolute path).
  • Do not use more than one global variable. Think about it because you will need to justify its use.
  • Do not interpret unclosed quotes or unclosed special characters. requested in the subject, such as \ (the backslash) or ; (the semicolon).
  • Handle โ€™ (single quote) which should prevent the shell from interpreting meta-characters present in the sequence between quotes.
  • Handle " (double quote) which should prevent the shell from interpreting meta-characters present in the sequence between quotation marks except the $ (dollar sign).
  • Implement redirects:
    • < should redirect the input.
    • > must redirect the output.
    • << must receive a delimiter and read the given input until encountering a line containing the delimiter. However, the history does not need to be updated!
    • >> should redirect output in append mode.
  • Implement pipes (| character). The output of each command in the pipeline is connected to the input of the following command using a pipe.
  • Manage environment variables (a $ followed by a sequence of characters) which must be substituted by their content.
  • Manage $? which must be substituted by the exit status of the last pipeline executed in the foreground.
  • Handle ctrl-C, ctrl-D and ctrl-\ which should work as in bash.
  • In interactive mode:
    • ctrl-C displays a new prompt on a new line.
    • ctrl-D exits the shell.
    • ctrl-\ does nothing.
  • Your shell must implement the following builtins:
    • echo and the -n option
    • cd only with relative or absolute path
    • pwd without any options
    • export without any options
    • unset without any options
    • env without any options or arguments
    • exit without any options

thout any options or arguments

  • exit without any options

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.