Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mvpee/42-minishell

This project is about creating a simple shell. Yes, your own little bash. You will learn a lot about processes and file descriptors.
https://github.com/mvpee/42-minishell

19 42 bash minishell pipe pipeline pipex processing redirection shell

Last synced: 29 days ago
JSON representation

This project is about creating a simple shell. Yes, your own little bash. You will learn a lot about processes and file descriptors.

Awesome Lists containing this project

README

        


:shipit: 42-minishell


GitHub code size in bytes
Code language count
GitHub top language
GitHub last commit


About
ยท
Running
ยท
Features

# ๐Ÿ’ก About
>As beautiful as a shell

This project is about creating a simple shell. Yes, your own little bash. You will learn a lot about processes and file descriptors.

## ๐Ÿš€ Running
>You need to install readline
```
sudo apt-get update
sudo apt-get install libreadline-dev
```
```bash
make run
```
It will automatically compile the project and run it.
```bash
./minishell
```
Will launch the previously compiled project with `make` and run it.

------------

## ๐Ÿ“œ Features

- **History**
-- Working history

- **`\`**
-- Supports escaping characters with backslashes for proper command interpretation

- **`'` `"`**
-- Supports proper parsing of single and double quotes for string handling

- **Redirections**
-- Supports input (`<`), here-doc (`<<`), output (`>`), and append (`>>`) redirections

- **Environnemts variables**
-- Supports retrieving, setting, and expanding environment variables

- **`$?`**
-- Displays the exit status of the last executed command

- **Signals**
-- Handles signals like CTRL-C (`interrupt`), CTRL-D (`EOF`), and CTRL-\ (`quit`)

- **Builtins**
-- `echo` with -n option
-- `cd` with relative, absolute, and `- ($OLDPWD)` paths
-- `pwd`
-- `export`
-- `unset`
-- `env`
-- `exit`

- **Others**
-- *`$SHLEVEL`*
Increments `SHLVL` by one. Sets it to one if `SHLVL` is invalid (not between 1 and 999)
-- *`$PWD`*
Updates `PWD` to reflect the current directory after a `cd` command or if no `PWD` is present in the environment
-- *`$OLDPWD`*
Updates `OLDPWD` after a `cd` command or if no `OLDPWD` is present in the environment
-- *Prompt*
A beautiful, colorful prompt that displays the current `PWD` at the beginning



---

This group project was done by [MVPee](https://github.com/MVPee) and [Nour Echaara](https://github.com/noureh10)