https://github.com/vidal-m/microshell
the lastest version of my microshell
https://github.com/vidal-m/microshell
42minishell c ecole42 examrank4
Last synced: 5 months ago
JSON representation
the lastest version of my microshell
- Host: GitHub
- URL: https://github.com/vidal-m/microshell
- Owner: Vidal-m
- Created: 2025-05-03T13:21:57.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-05-03T14:23:35.000Z (5 months ago)
- Last Synced: 2025-05-03T14:32:19.567Z (5 months ago)
- Topics: 42minishell, c, ecole42, examrank4
- Language: C
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#42Exam-rank-04
# microshellSmall shell (terminal) that executes simple commands with support for pipes (`|`) and separators (`;`). Project developed in 42 Luanda to understand the fundamentals of processes, `fork`, `execve`, `pipe` and `chdir`.
---
## ๐ง Objective
Implement a **microshell** capable of:
- Execute commands with multiple arguments
- Support chained commands with `;`
- Support `|` pipes
- Handle the built-in `cd` command
- Manage basic runtime errors and directories---
## โ๏ธ Compilation
```bash
cc -Wall -Wextra -Werror microshell.c -o microshell
```๐งช Usage
Executing simple commands
bash
Copy
Edit
./microshell ls -l ; echo Hello
Execution with pipes
bash
Copy
Edit
./microshell ls -l | grep microshell
๐ cd command behavior
bash
Copy
Edit
./microshell cd nonexistent_folder
Exit:vbnet
Copy
Edit
error: cd: cannot change directory to folder_inexistente
โ Error handling
cd with invalid argumentscommands that do not exist or fail to execute
fork or pipe failures are ignored in a simplified way (according to the project scope)
๐ง Implemented functions
exec_it โ Execute commands with execvecd โ Own implementation of the cd command
ft_strlen โ Helper function to count the length of strings
main โ Handles parsing, fork, pipe, and execution control