Skip to content

CourantEnCourant/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

235 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by weizhang and fdong.

Minishell

Description

Minishell is a simple shell written in C. It is a subset of bash --posix.

Features

  • Display a prompt and maintain a working history
  • Search and launch executables based on PATH or relative/absolute paths
  • Handle single quotes ' and double quotes "
  • Redirections: <, >, >>, << (heredoc)
  • Pipes |
  • Environment variable expansion ($VAR, $?)
  • Signal handling: ctrl-C, ctrl-D, ctrl-\ behave like in bash
  • Logical operators &&, || with parentheses for priorities
  • Built-in commands: echo -n, cd, pwd, export, unset, env, exit

Instructions

Build

make        # Build the minishell executable
make bonus  # Build the minishell executable
make clean  # Remove object files
make fclean # Remove object files and the executable
make re     # Rebuild from scratch

Run

./minishell

Test

make test

Valgrind

valgrind --suppressions=readline.supp --show-leak-kinds=all --leak-check=full ./minishell

Resources

AI Usage

AI tools were used during this project for the following purposes:

  • Code review -- checking for bugs, edge cases, and norm compliance
  • Design discussions -- discussing architecture choices (e.g. Pratt parsing vs recursive descent, AST design)
  • Writing the README -- drafting and formatting this document
  • Understanding system calls -- getting explanations for fork, execve, pipe, dup2, waitpid, sigaction, etc.

All code was written and understood by the team. AI was not used to generate shell logic or implementation code.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors