https://github.com/ombhd/minishell_42
Simple shell that behaves like bash
https://github.com/ombhd/minishell_42
1337school 42born2code bash shell
Last synced: 7 months ago
JSON representation
Simple shell that behaves like bash
- Host: GitHub
- URL: https://github.com/ombhd/minishell_42
- Owner: ombhd
- Created: 2020-12-10T12:45:08.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-29T16:14:02.000Z (over 4 years ago)
- Last Synced: 2025-02-05T23:28:00.930Z (8 months ago)
- Topics: 1337school, 42born2code, bash, shell
- Language: C
- Homepage:
- Size: 1.25 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minishell_42
## Contributors- Omar BOUYKOURNE @su-omb : 42login => `obouykou`
- Yassin SLATI @sltyassin : 42login => `yslati`## Subject
[minishell_subject](https://github.com/su-omb/minishell42/blob/main/en.subject.pdf)
## How to use?
1. `make`
2. `./minishell`
3. Run your commands## Simple shell that behaves like bash and contains these commands built-in :
1. `echo` with option `-n`.
2. `cd` with only a relative or absolute path.
3. `pwd` without any options.
4. `export` without any options.
5. `unset` without any options.
6. `env` without any options and any arguments.
7. `exit` without any options.## and works with these delimiters :
- Semicolon `;` in the command separates commands like in bash.
- Single quotes `'` and double quotes `"` work like in bash except for multiline commands.
- Redirections `<` `>` `>>` work like in bash except for file descriptor aggregation.
- Pipes `|` work like in bash.
- Backslash `\` works like in bash.
- Environment variables (`$` followed by characters) work like in bash.
- `$?` works like in bash.
- `ctrl-C`, `ctrl-D` and `ctrl-\` have the same result as in bash.## Some Sources :
- [Unix Processes in C](https://www.youtube.com/watch?v=cex9XrZCU14&list=PLfqABt5AS4FkW5mOn2Tn9ZZLLDwA3kZUY)
- [Writing your own shell fundamentals](https://www.cs.purdue.edu/homes/grr/SystemsProgrammingBook/Book/Chapter5-WritingYourOwnShell.pdf)
- [Shell System Calls Signals](https://cdn.discordapp.com/attachments/769898609562746880/776363294013128734/Shells_SystemCalls_Signals.ppt)
- [How does copy-on-write work in fork?](https://stackoverflow.com/questions/27161412/how-does-copy-on-write-work-in-fork?rq=1)
- [ Building a Bash-like application](https://medium.com/@ssreehari/building-a-bash-like-application-e17122609be4)
- [ execve() linux man](https://linux.die.net/man/2/execve)
- [exit command status](https://www.cyberciti.biz/faq/linux-bash-exit-status-set-exit-statusin-bash/)## NB:
- Please, if you have other useful sources, you can post them in an issue here in GitHub, thanks in advance.
- Maybe you will find some special cases that doesn't work, please post an issue if there are any.