Skip to content

lorbke/42_minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

433 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42-Minishell

Project Description

This is the minishell project from the 42 core curriculum. The goal of this project is to create a bash-style shell, capable of handling basic command-line operations. The minishell project is designed to deepen your understanding of processes, file descriptors, and basic shell functionality.

Features

  • Command Execution: Minishell can execute simple commands with or without arguments.
  • Redirection: Support for input and output redirection (>, <).
  • Pipes: Ability to handle multiple commands connected by pipes (|).
  • AND/OR Operations: Allows executing commands based on conditions (&&, ||).
  • Subshells: Enables execution in a separate environment for parts of a command (()).
  • Environment Variables: Implement basic support for environment variables like $HOME, $PWD, etc.
  • Signals: Minishell should handle signals (Ctrl-C, Ctrl-D, etc.) appropriately.
  • Line Editing: Use the GNU Readline library to provide basic line editing capabilities.
  • Error Handling: Implement error handling and display meaningful error messages, including syntax errors.

Getting Started

Prerequisites

brew install readline
brew link --force readline

Add the path to the lib Replace ~/.zshrc with ~/.bashrc if you use bash instead of zsh

echo 'export C_INCLUDE_PATH="/usr/local/opt/readline/include:$C_INCLUDE_PATH"' >> ~/.zshrc
echo 'export LIBRARY_PATH="/usr/local/opt/readline/lib:$LIBRARY_PATH"' >> ~/.zshrc
source ~/.zshrc

Installation

  1. Clone the repository:

    git clone https://github.com/lorbke/42_minishell.git
  2. Change into the project directory:

    cd 42_minishell
  3. Build the project:

    make
  4. Run Minishell:

    ./minishell

About

My own shell environment, inspired by Bash (with some limitations), part of the curriculum at 42 Heilbronn.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors