Skip to content

Mini Shell is a lightweight command-line shell built in C, designed to mimic the core functionality of Unix shells like bash or sh. It allows users to execute commands, manage processes, and interact with the system using a custom terminal interface.

Notifications You must be signed in to change notification settings

samar12lassoued/Mini-Shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini Shell

A minimal command-line shell written in c. It can execute basic commnds like ls, pwd, etc.

Features

  • Read user input in a REPL (Read_Eval_Print Loop)
  • Tokenize input using space as delimiter
  • Execute commands via execvp()
  • Graceful exit ith the exit command

Project Structure

.
├── include
│   ├── executor.h         # Declaration of command execution functions
│   └── parser.h           # Declaration of input parsing functions
├── Makefile               # Build instructions
├── README.md              # Project documentation
└── src
    ├── executor.c         # Implementation of command execution
    ├── main.c             # Shell entry point and REPL loop
    └── parser.c           # Input tokenization logic

Getting Started

Build & Run

  • Clone the repository
  • Run make to build the project
  • Launch the shell: ./mini-shell

Example Usage

mini-shell> ls
mini-shell> pwd
mini-shell> echo Welcome to mini-shell !
mini-shell> exit

Feature Roadmap && TODO

Feature Status
➕ Input redirection (<) ⬜ Planned
➕ Output redirection (>, >>) ⬜ Planned
➕ Pipelines ⬜ Planned
➕ Command history (arrow keys) via GNU Readline ⬜ Planned
➕ Background process execution (sleep 5 &) ⬜ Planned
➕ Environment variable expansion (echo $HOME) ⬜ Planned

Diagram explaining the interaction between shell and system calls

alt text

About

Mini Shell is a lightweight command-line shell built in C, designed to mimic the core functionality of Unix shells like bash or sh. It allows users to execute commands, manage processes, and interact with the system using a custom terminal interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published