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

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

42 Project : minishell
https://github.com/pedrozappa/42_minishell

Last synced: 18 days ago
JSON representation

42 Project : minishell

Awesome Lists containing this project

README

        


# minishell

> As beautiful as a shell







___

Table o'Contents

* [About ๐Ÿ“Œ](#about-)
* [Features](#features)
* [Usage ๐Ÿ](#usage-)
* [Tests & Debug ๐Ÿงช](#tests--debug-)
* [References ๐Ÿ“š](#references-)
* [Shell/Bash](#shellbash)
* [Termios](#termios)
* [Readline](#readline)
* [Heredoc](#heredoc)
* [License ๐Ÿ“–](#license-)

# About ๐Ÿ“Œ

Minishell is a project that aims to create a simple UNIX command-line shell. This project introduces students to the world of shells by implementing a mini version of bash.

# Features
- Parse and execute basic shell commands;
- Search & launch the right executable from absolute or relative path;
- Command history;
- Handle built-in commands (`cd`, `echo`, `pwd`, `export`, `unset`, `env`, `exit`);
- Support for pipes (`|`) and redirections (`<`, `>`, `>>`, `<<`);
- Environment variable
- export variables;
- unset variables;
- expand environment variables;
- Signal handling (`Ctrl-C`, `Ctrl-D`, `Ctrl-\\`);

___

# Usage ๐Ÿ

Clone the repository and cd into it:
```sh
git clone https://github.com/PedroZappa/42_minishell.git 42_minishell
```

Build the program:
```sh
cd 42_minishell
make
```

Run the program:
```sh
./minishell
```

___

# Tests & Debug ๐Ÿงช

Run the following command and look at the `Test Rules ๐Ÿงช` & `Debug Rules ๏†ˆ` to get a comprehensive list of all available test/debug commands:
```sh
make help
```

> [!Note]
> If you use `tmux` you are in for treat ๐Ÿ˜
___
# References ๐Ÿ“š

## Shell/Bash
- [Bash Reference Manual](https://www.gnu.org/software/bash/manual/bash.html)
- [Writing your own shell](https://www.cs.purdue.edu/homes/grr/SystemsProgrammingBook/Book/Chapter5-WritingYourOwnShell.pdf)
- [Shell Command Language](https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html)
- [Exit Codes and Their Meanings - Discovery Cluster / Slurm - USC Advanced Research Computing](https://hpc-discourse.usc.edu/t/exit-codes-and-their-meanings/414/2)

## Termios
- [A Brief Introduction to Termios](https://blog.nelhage.com/2009/12/a-brief-introduction-to-termios/)
- [A Brief Introduction to Termios: termios(3) and stty](https://blog.nelhage.com/2009/12/a-brief-introduction-to-termios-termios3-and-stty/)

## Readline
- [The GNU Readline Library](https://tiswww.case.edu/php/chet/readline/rltop.html)
- [Programming with GNU Readline](https://web.mit.edu/gnu/doc/html/rlman_2.html)

## Heredoc
- [Bash Heredoc](https://linuxize.com/post/bash-heredoc/)

# License ๐Ÿ“–

This work is published under the terms of 42 Unlicense.

(get to top)