Skip to content
workaniPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

68 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐚 Minishell

A lightweight Bash-compatible shell built in C

100/100 Success Score

🧠 System Architecture

Minishell Architecture Flowchart

Executor-oriented logic flow (Design by workani)

Minishell is built around a recursive execution tree that cleanly separates parsing from execution. This architecture enables unlimited pipe depth while keeping process control predictable and robust.

Execution flow

  1. Lexing and Parsing: User input is tokenized and transformed into an Abstract Syntax Tree (AST).
  2. Tree Traversal: The execution engine walks the AST, resolving pipes, redirections, and built-in commands.
  3. Process Orchestration: Processes are forked, signals are configured, and I/O is redirected before handing control to execve.

✨ Supported Features

Command execution

  • External commands via PATH using execve.
  • Built-ins executed in-process when required.
  • Correct exit status propagation ($?).

Pipelines

  • Unlimited pipe depth using an AST-based executor.
  • Proper file descriptor management.
  • Built-ins and external commands mixed safely.

Redirections

  • <, >, >>, << (heredoc with delimiter handling).
  • Redirections resolved per AST node.

Quoting & expansion

  • Single ' and double " quotes with Bash-like behavior.
  • $VAR and $? expansion.
  • Correct expansion order.

Signals & interaction

  • ctrl-C resets prompt.
  • ctrl-D exits.
  • ctrl-\ ignored.
  • Isolated signal handling for parent and children.

Built-ins

  • echo -n, cd, pwd, export, unset, env, exit.

🛠️ Credits

  • workani (Backend & Stability)

    • Project architecture and initial research.
    • Core execution loop: pipes, forks, and process management.
    • Memory safety and leak patching.
  • mbondare (Parser & Signals)

    • Lexer and parser implementation.
    • Signal handling and interactive prompt.
  • Joint Effort

    • Redirections, executor integration, and fixing edge cases.

🚀 Usage

Build:

make

Run:

./minishell

🧪 Testing

Test Results

You can launch the verification suite shown above by following these steps:

  1. Clone repository:

    git clone https://github.com/LucasKuhn/minishell_tester
  2. Run:

    cd minishell_tester
    ./tester

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages