Minishell is a shell written in C as a team project of the 42 Madrid common core (grade: 100/100). It provides a basic command-line interface where users can execute commands and interact with the operating system, mimicking the behavior of bash.
- Command Execution: Runs external programs from
PATHand the built-insecho,cd,pwd,export,unset,envandexit. - Redirection: Handle input (
<,<<) and output (>,>>) redirections. - Pipes: Chain multiple commands using pipes (
|). - Environment Variables: Manage environment variables with
exportandunset, and expand them with$. - Signal Handling:
Ctrl+C,Ctrl+DandCtrl+\behave as they do in bash. - Command History: Previous commands with the arrow keys, through readline.
The parsing logic is a critical component of Minishell. The following diagram illustrates how the command line input is processed:
- GCC or Clang
- Make
- Readline library
- Clone the repository:
git clone https://github.com/VolmerES/Minishell.git
- Navigate to the project directory:
cd Minishell - Compile the project:
make
Run the shell:
./minishellExecute commands:
minishell$ ls -lRedirection:
minishell$ grep "error" < log.txt > errors.txtPipes:
minishell$ ps aux | grep minishellEnvironment Variables:
minishell$ export MY_VAR="Hello World"
minishell$ echo $MY_VAR- Luis David Díaz (
ldiaz-ra) · @davidiaz1251 - Juan Bautista Delorme (
jdelorme) · @VolmerES · Portfolio · LinkedIn
