Minishell
MiniShell is a minimalistic shell interpreter, supporting features like basic command execution, environment variable handling, command chaining, redirections, pipes, subshells, and here documents.
Install / Use
/learn @LeaYeh/MinishellREADME
<i>🌊</i>rash Minishell | @42Vienna
The Creative Abort Shell
<br> <br>This project goes beyond merely crafting a new shell from scratch; it endeavors to emulate the Bash source code and the GNU Bash POSIX manual while incorporating principles from compiler parsing. By referencing these authoritative sources, the project aims to meticulously implement a shell interpreter. Moreover, it documents the entire journey from ground zero to the creation of a personalized shell, serving as a valuable resource for future learners seeking insights into shell development.
Table of Contents
- Support Features
- DevOPS Spirit
- Embrace Development Consistency with Docker
- How to Re-use Our CI/CD Framework For Your Own Minishell
- Basic cowork flow and git command
- Things Before the Implementation
- Implementations
- How to test with Valgrind
Support Features
| Category | Module | Function | Requirement | Status |
|------------|-------------|------------------------|----------------------------------------------------------------------------------------------------------|--------|
| Frontend | Lexer | Tokenizing | Tokenize user input into token list. | ✅ |
| | | | Support PIPE \|. | ✅ |
| | | | Support logical AND &&. | ✅ |
| | | | Support logical OR \|\|. | ✅ |
| | | | Support sequential operator ;. | 🛇 |
| | | | Support left and right parentheses () for SUBSHELL. | ✅ |
| | | | Support WORD representing basic words. | ✅ |
| | | | Recognize ASSIGNMENT_WORD = for local variable assignments. | ✅ |
| Frontend | Parser | Syntax Analysis | Analyze syntax of token list and report syntax errors based on Shift-Reduce algorithm with predefined grammar rules and then output as command table list. | ✅ |
| Frontend | Expander | Brace Expansion | Perform brace expansion to generate multiple strings based on expressions enclosed in braces {}. | 🛇 |
| | | Tilde Expansion | Perform tilde expansion to replace ~ with the current user's home directory path. | 🛇 |
| | | Parameter Expansion | Perform parameter expansion to replace variables and special parameters (optionally enclosed in braces {}) in a string. | ✅ |
| | | Command Substitution | Perform command substitution to replace command output in a string. | 🛇 |
| | | Arithmetic Expansion | Perform arithmetic expansion to evaluate mathematical expressions enclosed in $(()). | 🛇 |
| | | Process Substitution | Perform process substitution to use the output of a command as a file or input to another command. | 🛇 |
| | | Word Splitting | Perform word splitting to split a string into separate words based on spaces, tabs, and newlines. | ✅ |
| | | Wildcard Expansion | Perform filename expansion (globbing) in the current directory to generate filenames matching a specified pattern. | ✅ |
| | | Quote Removal | Remove quotes from strings to interpret them as literal values. | ✅ |
| Backend | Builtins | cd | Implement cd with relative and absolute paths. | ✅ |
| | | echo | Implement echo with option -n. | ✅ |
| | | env | Implement env with no options or arguments. | ✅ |
| | | exit | Implement exit with no options. | ✅ |
| | | export | Implement export with no options. | ✅ |
| | | pwd | Implement pwd with no options. | ✅ |
| | | unset | Implement unset with no options. | ✅ |
| Backend | Redirection | IO Redirection | Redirect STDIN with input redirection by < operator. | ✅ |
| | | | Redirect HEREDOC with input redirection by << operator. | ✅ |
| | | | Redirect STDOUT with output redirection by > operator. | ✅ |
| | | | Redirect STDOUT append with output redirection by >> operator. | ✅ |
| | | Subshell Redirection | Implement redirections and pipes between subshell groups (\|). | ✅ |
| | | Pipe Redirection | Redirect STDIN/STDOUT by pipe(). | ✅ |
| Backend | Assignment | Local Assignment | Assign variables local to the current shell environment or for the duration of a command following the assignment. | 🛇 |
| Cross-end | Signals | Signal Handling | Handle ctrl-C as SIGINT mirroring bash's behavior. | ✅ |
| | | | Handle ctrl-D as EOF mirroring bash
Related Skills
openhue
339.3kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
339.3kElevenLabs text-to-speech with mac-style say UX.
weather
339.3kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
