Skip to content

janrau9/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell

Table of Contents

Overview

Minishell is 42-cursus project that mimics bash shell. This project is designed to help us understand the problems encountered before when windows did not exists yet. It is ideal for students to learn how it works and to have a great foundation of coding. The program runs in a loop and waits for a prompt from the user. Parse the line and build an abstract syntax tree (AST). Run the command using the AST.

Features

  • History: Store command history and allow users to cycle through it using arrow keys.

  • Pipes and Redirection: Support pipes | and input/output redirection (<, >, <<, >>) including heredoc.

  • Signal Handling: Handle signals such as Ctrl+C (SIGINT) and Ctrl+D (SIGQUIT).

  • Environment Variables: Enable setting, modifying, and using environment variables.

  • The following builtins are implemented

    • echo with option -n
    • cd with only a relative or absolute path
    • pwd with no options
    • export with no options
    • unset with no options
    • env with no options or arguments
    • exit with no options

Installation

  1. Clone the repository:

    git clone git@github.com:janrau9/minishell.git
    cd minishell
  2. Install dependencies: install readline package using brew install readline on MacOS, or sudo apt-get update and sudo apt-get install libreadline-dev on Ubuntu/Debian.

  3. Compile:

make

Run the application

./minishell

Contact

Your Name
Email
LinkedIn

About

A 42-cursus project that mimics bash shell. It allows users to communicate to a computer in a human like language.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages