This project helped you? Give it a 🌟!
Version: 6. Bonus included.
Compliant with the new rules in version 6.1. about using global variables only for signals.
Built with the latest bash version: GNU bash, version 5.2.21(1)-release (x86_64-apple-darwin19.6.0).
Made by Florent & Ulysse
To keep the GitHub repository tidy and to avoid displaying library code, the lib directory is archived. Follow the steps below to set up and run the project:
- Decompress the Libraries:
tar xzf lib.tar.gz && rm -rf lib.tar.gz
If needed, to re-archive:tar czf lib.tar.gz lib/ && rm -rf lib/
- Install readline library via homebrew:
brew install readline
- Compile the Project:
make
- Run the Project:
./minishell
- Fidelity: built directly on the bash manual and some POSIX standards.
- Robustness: the Recursive descent parser allows to handle complex commands.
- Extensibility: thanks to the Abstract Syntax Tree execution, it is easy to add new features.
- Performance: to avoid unnecessary search, binaries paths are cached in memory (see
/src/get_bin_path.c
). We also use recursion for parsing and execution. - Security: robust design, all system calls checked.
- Documentation: parts of the code is documented with doxygen style. The
/docs/
directory include EBNF-like grammar, adapted bash manual and some other resources. - Debugging: tokens from the lexer and ast nodes from the parser can be printed in
json
format (see/src/debug.c
) and displayed here. - Bonuses:
- Parenthesis are implemented as subshells for easier testing.
- Wildcard are working for simple subdirectories (e.g.
ls src/*
).
- Newline and semicolon separators are not implemented; therefore, only one command per input line is supported. New lines in user input can lead to undefined behavior.
- Known bugs:
(>out)
: return a syntax error but shouldn't.ls random_dir/*
: display well the error but also exit the minishell.
resources.md
bash_manual_for_minishell.md
grammar.md
: EBNF-like grammarnotes_for_evaluation.md
: Implementation Choices + KO tests and reasonssubject.md
+subject_prompt_for_llm.md
- Learn what bash, a POSIX shell, and a terminal are, and understand the differences between these concepts.
- Read the entire bash manual (it's shorter than it looks) or our truncated version in
/docs/bash_manual_for_minishell.md
. - "bash manual > bash testing". Of course I highly recommend to test bash to understand it, but often taking a test instead of using the manual as a reference can be misleading.
- Use AST, it's a bit more complicated at first glance, but it will make your life much easier later on.
- USE TESTERS !!!
We use the two testers below. The docs/Notes_for_evaluation.md
details each KO test and reasons (most of them are considered out of scope).
/mpanic
: [549 OK]/42_minishell_tester
: [2935 OK]