A simplified shell implementation written in C, inspired by bash. This is a 42 school project.
- Interactive prompt with user, shell level and color display
- Command execution with absolute/relative paths and
$PATHresolution - Pipes (
|) to chain commands - Redirections:
<,>,>>,<<(heredoc) - Environment variable expansion (
$VAR,$?) - Single and double quote handling
- Signal handling (
Ctrl+C,Ctrl+D,Ctrl+\) - Built-in commands:
echo(with-noption)cd(with relative/absolute path,~,..)pwdexportunsetenvexit
- macOS or Linux
gccmakereadlinelibrary (installed via Homebrew on macOS)
make # compile the project
make clean # remove object files
make fclean # remove object files and executable
make re # full recompile./minishell.
├── Makefile
├── includes/
│ └── minishell.h
├── src/
│ ├── Main/ # Entry point
│ ├── Builtin/ # Built-in commands (cd, echo, env, exit, export, pwd, unset)
│ ├── Lexer/ # Tokenization of input
│ ├── Parse/ # Command parsing, redirections, heredoc
│ ├── Envvar/ # Environment variable expansion
│ ├── Execute/ # Command execution, pipes, redirections
│ ├── Signals/ # Signal handling
│ ├── Get_input/ # Readline input and validation
│ ├── Cleanup/ # Memory management and freeing
│ ├── Lib_utils/ # Utility functions
│ └── init/ # Shell initialization
└── Libft/ # Custom C library (libft, ft_printf, get_next_line)
42 school project.