Skip to content

L3awdMan/MiniDevil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

125 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by zotaj-di, baelgadi.

Logo

Description

MiniDevil is a POSIX inspired shell written in C as part of the 42 school minishell project.
It reads commands from the terminal, tokenizes & parses them into an AST (Abstract Syntax Tree) then executes the tree: handling pipes, redirections, environment variables and more, just like bash.

Features

➤ Mandatory

  • Interactive prompt with command history (readline)
  • PATH based executable search and absolute OR relative path execution
  • Single and double quote handling:
    • ' prevents all interpretation
    • " allows for $ expansion
  • Redirections:
    • < (input)
    • > (output)
    • >> (append)
    • << (heredoc)
  • Pipes (|) connecting STDOUT to STDIN across commands
  • Environment variable expansion ($VAR, $? ...)
  • Signal handling:
    • CTRL C (new prompt)
    • CTRL D (exit)
    • CTRL \ (ignored)
  • Builtins: echo, cd, pwd, export, unset, env, exit

➤ Bonus

  • && and || operators
  • Parentheses () for subshell
  • Wildcard * globbing (in the current directory)

Instructions

➤ Requirements

  • GCC or CC compiler
  • GNU Make
  • readline library (libreadline-dev on Debian/Ubuntu)

➤ Build

# Mandatory part
make

# Bonus part
make bonus

➤ Run

./minishell

# UI Mode (extra, not in subject)
./minishell --ui

➤ Clean

make clean    # remove object and dependency files
make fclean   # clean + remove binary
make re       # full rebuild

Architecture

➤ Mandatory

Mandatory pipeline

➤ Bonus

Bonus pipeline

Further information is provided in the documentation.

Documentation

➤ Doxygen

The mandatory part is fully documented with Doxygen.

You can generate it directly:

make doc
open doc/html/index.html

Or follow this link

➤ More documentation

Resources

➤ AI usage

AI tools (Claude) were used during this project for:

  • Debugging assistance and code review
  • Better understand core concepts and some edge cases
  • Acting as a rubber duck colleague (making sure the Doxygen comments and pages were understandable and accurate)
  • Greatly improved documentation by helping correct and refine it (Doxyfile & Doxygen xml/css/shell script)
  • Helping structure the bonus architecture in an efficient way

Authors

About

42 School Minishell Project - Simple Small Belzebuth Shell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors