/minishell

A bash-like Unix shell with support for all the IO stuff.

Primary LanguageC

minishell

A bash-like Unix shell written in C

demo

Features

  • Dynamic prompt
  • History
  • PATH handling
  • Environment variables setting and expanding
  • Getting exit code with $?
  • String literal support (', ")
  • Bash-like syntax
  • Pipes
  • IO redirections (>, <, >>)
  • Heredoc (<< EOF)
  • Builtins:
    • echo [-n]
    • cd [-]
    • pwd
    • export
    • unset
    • env
    • exit
  • Readline
    • You can use your Ctrl+A Ctrl+E Alt-F Alt+B Ctrl+W all you want.

Installation

  • Install required readline library and headers

e.g. installation for Ubuntu:

sudo apt install libreadline8 libreadline-dev
  • clone it:
git clone https://github.com/3lswear/minishell
  • build it
cd minishell && make

What I've learned from this project

  • IO redirection sometimes is pure magic
  • Writing shells is hard
  • Bash is in many places terrible and inconsistent but it's a de-facto standard and we have to live with it.

Team

This is a team project coded by: