Skip to content
numorbPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👾 minishell

A tiny, Bash-inspired shell in C. Built for 42 school. Fast and simple!

Features

  • Execute commands via PATH or absolute/relative paths
  • Quoting + expansion: single quotes, double quotes, $VAR, $?
  • Redirections: <, >, >>, << (heredoc, no history update)
  • Pipes: cmd1 | cmd2 | ...
  • Builtins: echo -n, cd, pwd, env, export, unset, exit
  • Signals: Ctrl-C (new prompt on new line), Ctrl-D (exit), Ctrl-\ (ignored)
  • Error handling and exit status mimic bash

Repo layout

minishell/
├─ libft/              # utility library (built via its own Makefile)
├─ src/                # lexer, parser, executor, builtins, env, signals
├─ Makefile            # cc with -Wall -Wextra -Werror (no relink)
├─ README.md
├─ minishell.h         # main project header
└─ readline.supp       # valgrind suppressions for readline

Build & Run

make            # build ./minishell
./minishell     # run

Prerequisites

  • Unix-like OS (Linux/macOS)
  • C compiler (C99) + GNU Make

Examples

echo "hello, shell"
ls -l | grep \.c$
cat < in.txt | grep pattern > out.txt
A=world echo "hello $A"

Restrictions

  • One global variable only
  • No global data structures
  • No leaks (valgrind-friendly)
  • No forbidden constructs (ternary, for, VLAs, switch, etc.)
  • Functions: <= 25 lines, <= 5 vars, <= 4 params, 80 cols, 4-char tabs
  • Makefile targets: all, clean, fclean, re

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages