/Minishell42

creating a shell using bash as a reference

Primary LanguageC

Minishell

The aim of the Minishell project is to write a simple UNIX-like shell program in C. It's a great opportunity to learn about process handling, low-level programming, and file descriptor manipulation.

Table of Contents

  1. About
  2. Installation
  3. Usage
  4. Features
  5. Built-in commands

About

Minishell is a challenge to create a working shell, similar to something like bash. The shell will have features like executing commands with their parameters, handling environment variables, and implementing some built-in commands.

Installation

  1. Clone the repository:
    git clone https://github.com/lpincoli/Minishell42.git
  2. Move to the project's directory:
    cd Minishell42
  3. Compile the project:
    make

Usage

The shell should be launched from the command line after running 'make'. You should see a prompt displaying where you can enter various commands.

Run the program like this:

./minishell

Features

  • Display a prompt for new commands
  • Command history
  • Search and launch executables based on PATH variable or absolute/relative path
  • Handle quotes and special characters
  • Implement simple redirections and pipes
  • Manage environment variables
  • Handle ctrl-C, ctrl-D, and ctrl-\ inputs as bash does

Built-in commands:

  • 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

Subject

For more information about the project, read the subject file.