Welcome to the Minishell project! This project is part of the 42 school curriculum, designed to help you understand and implement a basic shell. In Minishell, you will create a simplified shell that can interpret and execute basic commands.
The main objectives of the Minishell project are as follows:
-
Command Line: Implement a command line that can read and interpret user input.
-
Built-in Commands: Implement built-in commands such as
echo
,cd
,pwd
,export
,unset
,exit
andenv
. -
Executable Commands: Implement the ability to execute external commands.
-
Redirection and Pipes: Support input/output redirection and pipes.
-
Environment Variables: Implement the ability to set and use environment variables.
-
Error Handling: Properly handle errors, such as command not found or incorrect command syntax.
To use the Minishell program, follow the format below:
./minishell
This will launch the Minishell program, and you can then enter commands interactively.
Example:
./minishell
$ echo "Hello, Minishell!"
Hello, Minishell!
Minishell supports various built-in commands and external commands. Here are some examples:
echo
: Display a message or the value of a variable.cd
: Change the current directory.pwd
: Print the current working directory.env
: Display the environment variables.export
: Display or add the environment variables.unset
: Remove the environment variables.- External commands: Execute external programs.
It also supports basic signals like ctrl-C, ctrl-\ and ctrl-D.
To build the Minishell program, use the provided Makefile:
make
This will generate the minishell
executable.
Here are some resources that may be helpful for completing the Minishell project: