The objective of this project is for us to create a simple shell. Yes, out own little bash or zsh. We will lear a lot about processes and file descriptors and This project was one of the most challenging yet indulging projects of the 42 curriculum that I have faced so far, when you have to deal with many test cases and when you get to learn many things, from software architecture, system calls, file descriptors… to team coordination, management, and work distribution
- Ponmpt display
- Command history(up and down arrows)
- System executables available from the environment(ls, cat, grep ... etc.)
- Local executable(./minishell)
- Builtin commands :
echo
(with option -n)cd
(with ~ (tilde) flag, - (prev. dir), absalute and relative paths)pwd
(with no options)export
(with no options)unset
(with no options)exit
(with exit number)env
(with no options or arguments)
- Pipes
|
with redirect output from one command to input for the next - Redirections:
>
redirects output>>
redirects output in append mode<
redirects input<< DELIMETER
Heredoc displays a new prompt, reads user input untill reachinig DELIMETER, redirects user input to command input (does not update history)
- Environment variables (i.e.
$USER
or$VAR
) that expand to their values.$?
expands to the exit status of last executed foreground pipeline.
- User keybord signals:
Ctrl+C
displays new prompt line in interactive mode (Parent process), in non-interactive mode (child process) interupts process with the signalSIGINT
and updates exit_status to 131.Ctrl+D
exits any kind of process (if the prompt is empty)Ctrl+\
does nothing in interactive mode (parent process) and in non-interactive mode (child process) sends the signalSIGQUIT
to interupt non-interactive process.
Note
Minishell does not support \
, ;
, &&
, ||
, or wildcards
-
>
(rederction of output) -
>>
(redirection of output in append mode) -
<<
(HEREDOC) -
|
(PIPES) -
export
(EXPORT) -
unset
(UNSET)
Tip
For more test cases you can clone the repo and run the program 🤫
Clone the repository:
git clone https://github.com/YusuCoder/minishell.git
Go to the root folder run following commands:
make
./minishell
Minishell is a hands-on project designed to deepen your understanding of Unix shell behavior and system-level programming. By creating this simplified shell, you gain practical experience with core concepts such as process management, file descriptors, and system calls. This project not only reinforces your knowledge of how shells operate but also provides a solid foundation for tackling more advanced shell features and system programming challenges in the future.