Minishell
As the name implies, this project is about creating a simple shell in C, taking bash as a reference. Impementation of clasic bash written completely from scratch with Yusuf Anıl Turgut as part of 42 Ciriculum.
- This custom shell has most of the features from original bash like custom enironment, builtins, pipes, multiple redirections, logical operators and parenthesis, signal and error handling.
- It works by geting input from user. Then dividing it into tokens. Then parsing it into varios data structures and executing.
GETTING STARTED
Prerequisites
- GCC compiler
- Make utility
- GNU readline
Building
$ git clone https://github.com/badi361/Minishell
$ cd minishell && make
$ ./minishell
FEATURES
Command execution
- The shell supports executing external commands, built-in commands, and pipeline commands.
- The shell supports input/output redirection using the < and > characters.
Signal handling
-
The shell handles the following signals:
-
SIGINT (Interrupt signal)
-
SIGQUIT (Quit signal)
Environment variables
- The shell supports creating, modifying, and deleting environment variables using the export and unset built-in commands.
Command history
- The shell supports command history using the readline library.
Built-in commands
-
The shell supports the following built-in commands:
-
echo - displays a message
-
cd - changes the current directory
-
pwd - prints the current working directory
-
export - creates or modifies an environment variable
-
unset - deletes an environment variable
-
env - prints the environment variables
Acknowledgments
-
This project was inspired by the Unix shell, and was built using the following resources:
-
The readline library documentation
-
The Bash shell documentation