Skip to content

Welhox/MiniBash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniBash

A UNIX shell that emulates BASH behavior. Created in collaboration with @Kirkram.

Minishell Demo


📌 Table of Contents


🛠️ About the Project

MiniBash is a lightweight UNIX shell that mimics BASH behavior. It supports:

  • Command execution with arguments
  • Pipes (|) to chain commands
  • Redirections (<, <<, >, >>)
  • Environment variable handling ($VAR)
  • POSIX signal handling

The project was divided into two main parts:


✨ Features

✔️ Command Execution – Supports absolute & relative paths
✔️ Pipes (|) – Execute multiple commands in a single line
✔️ Redirections (<, <<, >, >>) – Handle file input/output
✔️ Environment Variables ($VAR) – Expand shell variables
✔️ Signal Handling – Manage CTRL+C, CTRL+D, CTRL+\
✔️ Built-in Commands – Custom implementations of key shell commands


🔧 Built-in Commands

We implemented the following BASH built-in commands:

Command Description
cd Change the working directory
pwd Print the current directory
export Set environment variables
unset Remove environment variables
env Display all environment variables
echo Print text to the terminal
exit Exit the shell

Other commands are executed using the execve() system call.


⚙️ Installation & Compilation

📥 Clone the Repository

git clone https://github.com/Welhox/MiniBash.git
cd MiniBash

🛠️ Install Dependencies

Ensure you have the readline library installed before compiling:

On Debian-based systems (Ubuntu):

sudo apt install libreadline-dev

On MacOS (Homebrew):

brew install readline

🔨 Compile the Project

make

This will generate the minishell executable.


🖥️ Usage

Run MiniBash by executing:

./minishell

You can now enter commands just like in BASH!


👥 Contributors

About

A mini BASH shell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published