Minishell is 42-cursus project that mimics bash shell. This project is designed to help us understand the problems encountered before when windows did not exists yet. It is ideal for students to learn how it works and to have a great foundation of coding. The program runs in a loop and waits for a prompt from the user. Parse the line and build an abstract syntax tree (AST). Run the command using the AST.
-
History: Store command history and allow users to cycle through it using arrow keys.
-
Pipes and Redirection: Support pipes
|and input/output redirection (<,>,<<,>>) including heredoc. -
Signal Handling: Handle signals such as Ctrl+C (SIGINT) and Ctrl+D (SIGQUIT).
-
Environment Variables: Enable setting, modifying, and using environment variables.
-
The following builtins are implemented
echowith option-ncdwith only a relative or absolute pathpwdwith no optionsexportwith no optionsunsetwith no optionsenvwith no options or argumentsexitwith no options
-
Clone the repository:
git clone git@github.com:janrau9/minishell.git cd minishell -
Install dependencies: install readline package using
brew install readlineon MacOS, orsudo apt-get updateandsudo apt-get install libreadline-devon Ubuntu/Debian. -
Compile:
make./minishell