Skip to content
arif7esatPublic

About

Custom UNIX Shell Implementation in C | AST-based Lexer/Parser & POSIX Process Management

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

minishell — Custom UNIX Shell Implementation (C)

⚠️ Notice on Source Code Availability: The source codes for this project are currently hosted on the highly restricted internal servers (Vogsphere) of the 42 Network. Full source code migration to this public repository is scheduled and will be completed soon. Below is the architectural documentation and technical constraints of the project.

⚙️ System Architecture & Lexer/Parser Design

This project is a comprehensive implementation of a custom UNIX shell from scratch. The core engineering focus was on parsing complex command-line inputs and managing underlying system processes, directly reflecting the foundational principles of Operating System development and low-level execution logic.

Core Engineering Features

  • Abstract Syntax Tree (AST): Architected a custom lexer and parser in C to tokenize inputs and build an AST, enabling the accurate evaluation of operator precedence, pipes, and complex execution logic.
  • POSIX Process Management: Engineered robust process trees utilizing fundamental UNIX system calls (fork, execve, waitpid) to manage parent-child execution states seamlessly.
  • IPC & I/O Redirection: Implemented inter-process communication (IPC) through pipes and managed complex file descriptor routing (dup2) for input/output redirection.

🛡️ Signal Handling & Robustness

  • Developed robust signal handling mechanisms (SIGINT, SIGQUIT) to ensure the shell reacts intuitively without crashing, mirroring the behavior of bash.
  • Engineered strict memory management protocols to prevent leaks during child process terminations and parsing errors.
  • Valgrind tested: All heap blocks were freed -- no leaks are possible.

Developed as part of the 42 Network Common Core Curriculum.

About

Custom UNIX Shell Implementation in C | AST-based Lexer/Parser & POSIX Process Management

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors