Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell

A small, Bash-like shell implemented in C (42 project).
It provides a prompt with history, command parsing, pipes & redirections, environment variable expansion, and the standard built-ins.


Features

  • Prompt & history (GNU Readline)
  • Lexer/Parser with quotes, tokenization, and env expansion ($VAR, $?)
  • Pipes & redirections: |, <, >, >>, heredoc << (with quoted/unquoted delimiter rules)
  • PATH resolution for external commands
  • Signals tuned for interactive use:
    • Ctrl-C (SIGINT): returns to prompt, exit code 130
    • Ctrl-\ (SIGQUIT): ignored at prompt
    • Ctrl-D: clean exit on empty line
  • Built-ins (in-process, affect shell state):
    • echo (supports -n)
    • cd
    • pwd
    • export
    • unset
    • env
    • exit

Build & Run

Prerequisites

  • GNU Readline development headers (libreadline-dev / readline)
  • make and a C compiler
git clone https://github.com/andrijajovanovic98/minishell
cd minishell
make
./minishell

Result

minishellscore

Our result with tester: https://github.com/zstenger93/42_minishell_tester:

To test it, just compile it with the "make tester" command

Screenshot from 2024-09-19 17-00-56

About

POSIX-like minishell in C: lexer/parser, pipelines & redirections, heredoc, env vars, builtins.

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages