42 School Project | Made in 2024 - 2025
The Minishell
project involves reproducing a working Shell like program. It must behave exactly like GNU Bash, managing environnement variables, builtin commands, pipeline, heredocument, fd redirection, etc.... The program is executed with the following format:
./Minishell
It take no argument.
-
Source Files (
src/
):main.c
: Main program logic and entry point.memory/
: Memory managing functions.builtin/
: builtin commands functions.- Other supporting files for parsing, sorting, and utility functions.
-
Header File (
header/
):- Declarations of structures and function prototypes.
Compatibility Warning This project, Minishell, has primarily been developed and tested on a Linux Ubuntu system. It is essential to note that the project may encounter compatibility issues when executed on different operating systems. The utilization of Linux-specific features, libraries, or commands could lead to unexpected behavior on non-Linux platforms.
To ensure optimal performance and compatibility, it is recommended to run this project on a Linux environment, preferably Ubuntu. Attempting to execute the project on other operating systems may result in errors or unintended behavior.
Please consider this compatibility notice before proceeding with the compilation and execution of Minishell.
If you don't have Make
- Make
apt-get install build-essential make
Clone the repo
git clone https://github.com/Ocyn/Minishell.git
cd Minishell/
-
Makefile:
- The project includes a Makefile with the following rules:
NAME
,all
,clean
,fclean
, andre
.
- The project includes a Makefile with the following rules:
-
Compilation:
- Compile the project using the provided Makefile.
make
- Execution:
Run the program with file names and shell commands.
./minishell
- Expected Behavior:
The program should replicate the behavior of the specified shell command.
- Clean Up:
Clean up object files and executable.
make clean
Error Handling:
- The program incorporates error handling for various scenarios, such as failed system calls, file access issues, wrong command syntax, and unexpected behavior.
Cleanup:
- Ensures proper cleanup by closing file descriptors, waiting for child processes to finish, and freeing allocated memory.
The project must be written in C and adhere to the Norme. Functions should not terminate unexpectedly, and no memory leaks are tolerated. Error handling must be implemented sensibly. The program must handle pipes, input and output redirection, and execute shell commands. A Makefile must be provided for compilation. Detailed instructions and examples are provided in the project description.
Follow the provided instructions in the README file for successful compilation and execution of the program.