---
## âšī¸ About Project
> The purpose of this project is to create a simple bash-like shell.
**minishell** is a minimal bash-like shell implementation written in C. It provides essential shell functionality including command execution, piping, input/output redirection, and built-in commands.
### Key Features
- **Command Execution**: Execute external programs with argument parsing and path resolution.
- **Pipelines**: Connect multiple commands using the pipe operator (`|`).
- **Redirections**: Support for input (`<`), output (`>`), and append (`>>`) file redirections.
- **Built-in Commands**: `cd`, `echo`, `env`, `exit`, `export`, `pwd`, `unset`.
- **Environment Variables**: Access and manage shell environment variables.
- **Interactive Shell**: Read-Evaluate-Print Loop (REPL) powered by GNU Readline.
- **Quote Handling**: Proper handling of single and double quotes for literal strings.
### Development
The codebase adheres to **Norminette v4** standards and uses a modular architecture separating parsing, execution, and built-in command logic. Build artifacts are automatically generated; refer to `AGENTS.md` for detailed development guidelines.
For detailed info, refer to this project [subject](docs/en.subject.pdf).
## đ Getting Started
### Prerequisites
- GCC compiler
- Make utility
- Unix-like system (Linux, macOS, WSL)
### Install prerequisites
- APT
```bash
sudo apt install build-essential libreadline-dev
```
- Pacman
```bash
sudo pacman -Sy base-devel readline-devel
```
## đ§ Build
1. **Clone the repository:**
```bash
git clone https://github.com/sdevsantiago/minishell.git
cd minishell
```
2. **Compile the project:**
```bash
make # Full compilation
```
3. **Clean build files:**
```bash
make clean # Remove object files
```
#### Available Make Targets
| Command | Description |
|---------|-------------|
| `make` | Compiles all |
| `make all` | Same as `make` |
| `make clean` | Remove object files (*.o) |
| `make fclean` | Remove object files and binaries |
| `make re` | Clean and rebuild everything |
## đ¨âđģ Usage
### Basic Usage
1. **Execute the shell**
```bash
./minishell
```
2. **Interact with it like if it was bash**
```bash
echo "Hello, World!"
...
cat groceries.txt | grep tomatoes
...
echo "Greetings $USER!" > greetings.txt
```
## đ Norminette
The code strictly complies with 42's **Norminette v4**:
```bash
norminette *.c *.h
```
More info in the official [Norminette](https://github.com/42school/norminette) repository.
## đââī¸ Special thanks
- [lrcouto](https://github.com/lrcouto) and [ayogun](https://github.com/ayogun) for creating and publishing, respectively, the [42-project-badges](https://github.com/ayogun/42-project-badges) repository.
- [gcamerli](https://github.com/gcamerli) for creating the [42unlicense](https://github.com/gcamerli/42unlicense) repository.
## âī¸ License