|
1 | 1 | # 42_minishell
|
2 | 2 | Repository of the project minishell from 42 Porto.
|
| 3 | + |
| 4 | +<!--  --> |
| 5 | + |
| 6 | +## Table of contents |
| 7 | + |
| 8 | +- [Sources and Acknowledgments](#sources-and-acknowledgments) |
| 9 | +- [Introduction](#introduction) |
| 10 | +- [Usage](#usage) |
| 11 | +- [Example of usage](#example-of-usage) |
| 12 | + |
| 13 | +## Sources and Acknowledgments |
| 14 | +I would like to share the key resources that helped me to construct this project. My sincere thanks go out to everyone who has shared their knowledge freely with the community. |
| 15 | + |
| 16 | +- [Minishell: Building a mini-bash](https://m4nnb3ll.medium.com/minishell-building-a-mini-bash-a-42-project-b55a10598218) - By [MannBell](https://m4nnb3ll.medium.com/) |
| 17 | +- [Shell Program Explained - Playlist](https://www.youtube.com/watch?v=ubt-UjcQUYg) - By [hhp3](https://www.youtube.com/@hhp3) |
| 18 | +- [What Happens When You Type a Command in Your Terminal](https://www.youtube.com/watch?v=2P7fcVHxA9o) - By [warpdotdev](https://www.youtube.com/@warpdotdev) |
| 19 | +- [Chapter 5. Writing Your Own Shell](https://www.cs.purdue.edu/homes/grr/SystemsProgrammingBook/Book/Chapter5-WritingYourOwnShell.pdf) - By Gustavo Rodriguez-Rivera and Justin Ennen,Introduction to Systems Programming: a Hands-on Approach (V2015-2-25) |
| 20 | +(systemsprogrammingbook.com) |
| 21 | +- [Unix terminals and shells](https://www.youtube.com/playlist?list=PLFAC320731F539902) - By [Brian Will](https://www.youtube.com/@briantwill) |
| 22 | +- [Bash Reference Manual](https://www.gnu.org/software/bash/manual/bash.html) - By Free Software Foundation, Inc |
| 23 | +- [Write a shell in C](https://brennan.io/2015/01/16/write-a-shell-in-c/) - By [Stephen Brennan](https://brennan.io/) |
| 24 | + |
| 25 | +And I would like to thank by peers from 42 Porto, who helped me a lot during all the process of this complex project. Thank you all. Sharing knowledge make us better. |
| 26 | +Special thanks to [Isabella Miranda](https://github.com/bellamiranda), my partner throughout this project, who co-constructed this minishell with me. |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## Introduction |
| 31 | + |
| 32 | +This Project is about to recreate your own implementation of a shell based on bash shell. |
| 33 | +[What is a shell](https://www.datacamp.com/blog/what-is-shell?dc_referrer=https%3A%2F%2Fwww.google.com%2F) |
| 34 | + |
| 35 | +We needed to recreate some specifics behaviours of bash shell: |
| 36 | +- Display a prompt when waiting for a new command; |
| 37 | +- Have a working history. |
| 38 | +- Search and launch the right executable (based on the PATH variable or using a |
| 39 | +relative or an absolute path). |
| 40 | +- Implement redirections: |
| 41 | +- Implement pipes (| character) and Pipeline. |
| 42 | +- Handle environment variables ($ followed by a sequence of characters) which |
| 43 | +should expand to their values. |
| 44 | +- Handle $? which should expand to the exit status of the most recently executed |
| 45 | +foreground pipeline |
| 46 | +- Handle ctrl-C, ctrl-D and ctrl-\ which should behave like in bash. |
| 47 | +- Implements some builtins |
| 48 | +For the complete list of requiremets and limitations, read the [subject](subject/en.subject.pdf). |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## Usage |
| 53 | +1 - In your terminal, clone the repository from github |
| 54 | +``` |
| 55 | + git clone [email protected]:amauricoder/42_minishell.git |
| 56 | +``` |
| 57 | + |
| 58 | +2 - In your terminal, use 'make' to compile the project |
| 59 | +``` |
| 60 | + make |
| 61 | +``` |
| 62 | + |
| 63 | +This will compile an executable program called minishell. |
| 64 | +3 - Execute ./minishell without any argument |
| 65 | +``` |
| 66 | + ./minishell |
| 67 | +``` |
| 68 | + |
| 69 | +## Example of Usage |
| 70 | +**Click on the image below to watch on Youtube an exaple of usage of this project** |
| 71 | + |
| 72 | +[](https://www.youtube.com/watch?v=urz76d7-Gq4) |
0 commit comments