An open API service indexing awesome lists of open source software.

https://github.com/nicolasgasco/42_minishell

42 group project. A simple, Bash-inspired shell. Done by @adel-cor and @ngasco.
https://github.com/nicolasgasco/42_minishell

Last synced: 7 months ago
JSON representation

42 group project. A simple, Bash-inspired shell. Done by @adel-cor and @ngasco.

Awesome Lists containing this project

README

          

# Minishell
> The objective of this project is for you to create a simple shell. Yes, your little bash or zsh. You will learn a lot about processes and file descriptors.

This is a group project done with [@adelcor](https://github.com/adelcor).

The shell must:
- interpret quotes correctly
- expand environment variables, including `$?`
- detect syntax errors
- have a prompt with a working history
- execute builtins, such as `echo`, `cd`, `pwd`, `export`, `unset`, `env`, and `exit`
- interpret simple and double quotes
- execute redirections (`<`, `>`, `<<`, `>>`)
- execute pipes
- Catch `ctrl-C`, `ctrl-D`, and `ctrl-\` signals

## Run the program

### Unix
Clone the repository and open it
```
# You might need to run this on MacOs
brew install readline

make
./minishell
```

## Examples

- \>\> redirection

![Screenshot of >> redirection example](https://res.cloudinary.com/ngasco/image/upload/v1649785877/42/minishell/Screenshot_from_2022-04-12_19-49-10_lyhc3p.png "Screenshot of >> redirection example")

- Here doc

![Screenshot of Here doc](https://res.cloudinary.com/ngasco/image/upload/v1649785877/42/minishell/Screenshot_from_2022-04-12_19-45-50_xtmsur.png
"Screenshot of Here doc")

- Echo

![Screenshot of echo examples](https://res.cloudinary.com/ngasco/image/upload/v1649785877/42/minishell/Screenshot_from_2022-04-12_19-45-13_immcih.png
"Screenshot of echo examples")

- Export and unset

![Screenshot of export and unset examples](https://res.cloudinary.com/ngasco/image/upload/v1649785877/42/minishell/Screenshot_from_2022-04-12_19-47-39_isuenb.png
"Screenshot of export and unset examples")

- Export and unset

![Screenshot of export and unset examples](https://res.cloudinary.com/ngasco/image/upload/v1649785877/42/minishell/Screenshot_from_2022-04-12_19-47-39_isuenb.png
"Screenshot of export and unset examples")

- Pipe examples

![Screenshot of pipe example](https://res.cloudinary.com/ngasco/image/upload/v1649786722/42/minishell/Screenshot_from_2022-04-12_20-05-03_rcbuoq.png
"Screenshot of pipe example")