https://github.com/vinicius-rio/42-formation-lvl2-8.minishell
Project 8: MiniShell - Eighth project for the formation of software engineers at school 42 São Paulo.
https://github.com/vinicius-rio/42-formation-lvl2-8.minishell
Last synced: about 1 month ago
JSON representation
Project 8: MiniShell - Eighth project for the formation of software engineers at school 42 São Paulo.
- Host: GitHub
- URL: https://github.com/vinicius-rio/42-formation-lvl2-8.minishell
- Owner: vinicius-rio
- License: mit
- Created: 2022-07-26T04:40:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-26T04:56:36.000Z (almost 3 years ago)
- Last Synced: 2025-05-09T05:32:04.522Z (about 1 month ago)
- Language: C
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
42-formation-lvl2-8.minishell
### _Project 8: MiniShell - Eighth project for the formation of software engineers at school 42 São Paulo._
- This project is about creating a simple shell.
## _Useful links_
- https://www.geeksforgeeks.org/making-linux-shell-c/
- https://www.notion.so/Minishell-Materials-7bbd45a806e04395ab578ca3f805806c
- https://www.cs.purdue.edu/homes/grr/SystemsProgrammingBook/Book/Chapter5-WritingYourOwnShell.pdf## _How to use_
- Clone the repository:
```
git clone [email protected]:Vinicius-Santoro/42-formation-lvl2-8.minishell.git
```
- Run the command to turn abstract files into object files:
```
make all
```
- Run the generated file and enjoy the minishell.
```
./minishell
```## _How the project works_
Our minishell works as follows.
- Analysis and treatment of everything that was passed on the terminal.
- After the treatment, the arguments are tokenized, that is, each item is added to a node of a linked list (everything that arrives at this node is 100% OK).
- Checks if the node content is a builtin or an external command (the command is executed).### _Project general fluxogram_
```mermaid
graph TD;
main-->readline_loop;
readline_loop-->do_command;
do_command-->parse_line;
parse_line-->parse_loop;
parse_loop-->invalid_syntax_error;
parse_loop-->parse_quotes;
parse_loop-->parse_redirects;
parse_loop-->parse_variables;
parse_loop-->parse_split;
parse_line-->cmd_split;
parse_line-->tokenizer;
do_command-->exec_command;
exec_command-->check_if_built_in;
check_if_built_in-->yes;
yes-->exec_built_in;
exec_built_in-->echo_built_in;
exec_built_in-->pwd_built_in;
exec_built_in-->export_built_in;
exec_built_in-->env_built_in;
exec_built_in-->exit_built_in;
exec_built_in-->unset_built_in;
exec_built_in-->cd_built_in;
check_if_built_in-->no;
no-->child_command;
no-->parent_command;```