This project aims to create a minimal C shell capable of executing some basic Unix commands.
💡 About the project | 📝 Explanation | ⚙️ How to use | 🏆 Credits
This project is part of 42's curriculum and aims to create a basic shell in C, capable of executing some basic Unix commands. In this project we learned more about dealing with reading and interpreting command line commands, managing processes, and manipulating files and directories. After completing the project we gained a good understanding of the dynamics of Unix shells.
-
Minishell is a C language program that simulates a shell, which is a command-line interface that allows the user to execute commands and programs on the operating system. When running Minishell, the user can enter commands such as
ls
,cd
,echo
,pwd
,exit
,cat
,grep
, redirection (<
,>
) and heredocs (<<
), which will be executed by the program. -
It's built around an infinite loop that reads user inputs line by line. It interprets each line as a command to be executed and parses the input to identify the command name and its arguments.
-
Minishell is also responsible for managing processes. When the user enters a command that needs to create a new process, Minishell is responsible for creating that process and executing the program associated with it. Minishell is also capable of handling interruption signals, such as CTRL+C, and redirecting input and output to files.
- Clone this repository
git clone https://github.com/jpedr0c/42_minishell.git
- In the project directory, compile the program using the following command
make
- Run Minishell
./minishell
- If you want to remove the object files generated during compilation
make clean
- If you want to remove the object files and executable generated during compilation
make fclean