Mirror of my 42 Minishell Project
  • C 98.4%
  • Makefile 1.6%
Find a file
TreezZ d090be4a81
Merge parse_cmd branch into main
Merge pull request #4 from 42-Minishell-Spablob3-TreezZ-Project/parse_cmd
2026-02-26 15:18:42 +00:00
.supps Added suppresion for memleak testing without readline interference. 2025-12-16 14:24:35 +00:00
lib Updated libft, which fixes the segfault. 2026-01-07 15:42:53 +00:00
src Merge branch 'parse_cmd' into export 2026-02-26 15:15:46 +00:00
.gitmodules Readded libft with edits for correct paths on project. 2025-11-21 12:34:31 +00:00
echo.txt Empty prompt or prompt with just spaces no longer segfaults. 2026-02-23 16:09:54 +00:00
LICENSE Initial commit 2025-11-20 11:53:07 +00:00
Makefile Added suppresion for memleak testing without readline interference. 2025-12-16 14:24:35 +00:00
README.md Added README with TODO list. 2026-02-24 12:40:36 +00:00

This project has been created as part of the 42 curriculum by grui-ant and joapedro.

$> 42-Minishell 🖥️

A project most commonly known as "Mini Hell".

If we're able to do this project, we can do anything. Or so they say.

Description

We made our own, actually usable, Unix Shell! And you can try it out yourself! Fully written in C, this Unix Shell includes a lot of the features found on the Bourne Again SHell, which we used as our reference.

Features:

  • Fully working history of past commands (as of the start time of the program);
  • Starting/running programs from the shell;
  • Basic redirections: This includes <, >, <<, and >>;
  • Pipes;
  • Environment variables, as well as setting and unsetting new ones;
  • Handling of signals via CTRL-C, CTRL-D;
  • A handful of built-in commands: echo, cd, pwd, export, unset, env, exit;
  • Partially statically linked library: we use our own C Library for some functions, the 42-Libft.

Instructions

Building

You will need to compile this program yourself, as no binaries are provided.
This project was was made with Ubuntu 22.04 as the target platform, so this guide will assume you are on Ubuntu.
However, you should be able to install the equivalent packages and build on your distro of choice.

Prequisites:

Install the following dependencies:

WE STILL NEED TO CHECK THIS:

sudo apt install clang gcc git libxext-dev libbsd-dev make xorg zlib1g-dev

Clone this repository using Git, cd into it, and pull all dependencies:

git clone https://github.com/42-Minishell-Spablob3-TreezZ-Project/42-Minishell.git cd 42-Minishell && git submodule update --init --recursive

Once that's done, run GNU Make to build the source code into a executable binary:

make

The make clean and make fclean flags are also available to clean up the files created during compilation, as well as the binary, from the repository.

Instructions

Once the project is compiled, you can start using the Minishell by running this on your terminal, while on the same directory you compiled it on: ./minishell

And that's it! You're using it! You can now use it like you would use any sh-compatible Unix Shell. You can additionally add it to your terminal emulator as the default shell.

If you're feeling lazy, you can set your current shell to run it on startup by adding this to your .zshrc or .bashrc: /path/to/minishell/directory/minishell

Resources

TODO LIST: Resources Exit/execution/error status codes Unset failure error message Replace printf's with perror or write 2

License

This project, including the 42-Libft Library, is licensed under the GNU GPL-2.0-or-later. This means you are free to clone this repository, study, modify, and use this code for your own private use. If you make modifications to it, and wish to distribute binaries of your modified version however, you must release the source code under the same terms.