Giter VIP home page Giter VIP logo

mcombeau / minishell Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 0.0 2.82 MB

Minishell is a 42 school team project to create a basic shell program in C. It implements redirections and pipes, as well as environment variables and some builtin commands.

Home Page: https://www.codequoi.com/

Makefile 2.41% C 97.59%
42 42born2code 42cursus 42paris 42school c child-process environment-variables minishell minishell42 pipe pipeline readline-library redirection shell signal-processing signals variable-expansion

minishell's Introduction

minishell

Minishell 42 project badge

Minishell is a 42 school team project to create a basic shell program in C. It implements redirections and pipes, as well as environment variable expansions and the cd, echo, env, exit, export, pwd and unset builtin commands.

Status

Validated 11/11/2022. Grade: 99%.

Usage

Clone the repository with the minitester submodule:

git clone --recurse-submodules [email protected]:mcombeau/minishell.git

To compile:

cd minishell && make

To run the program:

./minishell

A prompt will appear. You may enter your commands to be executed.

To run the included tester:

cd minitester/ && bash minitester.sh

Supported Features

Minishell is a miniature shell program based on Bash. Minishell supports:

  • Prompt display
  • Command history (up and down arrows)
  • System executables available from the environment (ls, cat, grep, etc.)
  • Local executables (./minishell)
  • Builtin commands :
    • echo (and option -n)
    • cd (with only a relative or absolute path)
    • pwd (no options)
    • export (no options)
    • unset (no options)
    • env (no options or arguments)
    • exit (with exit number but no other options)
  • Pipes | which redirect output from one command to input for the next
  • Redirections:
    • > redirects output
    • >> redirects output in append mode
    • < redirects input
    • << DELIMITER displays a new prompt, reads user input until reaching DELIMITER, redirects user input to command input (does not update history)
  • Environment variables (i.e. $USER or $VAR) that expand to their values.
    • $? expands to the exit status of the most recently executed foreground pipeline.
  • User keyboard signals:
    • ctrl-c displays a new prompt line.
    • ctrl-d exits minishell
    • ctrl-\ does nothing

However, Minishell does not support \, ;, &&, ||, or wildcards.


Useful Resources for the Minishell Project

🇺🇸 Articles in English about the concepts tackled in this project:

🇫🇷 Articles en français sur les concepts abordés dans ce projet :

Other useful links:


Made by aquesada and mcombeau

minishell's People

Contributors

alexquesad avatar mcombeau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

minishell's Issues

command loop

loop which runs all the time and displays the promt the whole time after inputting something

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.