/Minishell

The objective of this project is to create a minimalist shell.

Primary LanguageC

πŸ’»Minishell 42cursus projectπŸ’»

Minishell-Screenshot

About

The objective of this project is to create a minimalist shell.

πŸ”¨ Usage

Make && ./minishell
Screen.Recording.2023-03-23.at.00.05.19.mov

Project Structure

.
β”œβ”€β”€ πŸ“includes/
β”‚   └── minishell.h
β”œβ”€β”€ πŸ“libft/
β”‚   └── libft.a
β”œβ”€β”€ πŸ“srcs/
β”‚   β”œβ”€β”€ πŸ“builtins/
β”‚   β”‚   └── *.c
β”‚   β”œβ”€β”€ πŸ“execution/
β”‚   β”‚   └── *.c
β”‚   β”œβ”€β”€ πŸ“parsing/
β”‚   β”‚   └── *.c
β”‚   └── πŸ“utils/
β”‚       └── *.c
└── Makefile

πŸ“– Features

Buildtins

Command Option
echo -n
cd only with a relative or absolute path
pwd none
export none
unset none
env none
exit none

Redirections

  • < must redirect the input.
  • > must redirect the output.
  • << must receive a delimiter and read the given input until a line containing the delimiter. However, the history does not have to be updated!
  • >> must redirect the output to append mode.

Signals

ctrl-C, ctrl-D and ctrl-\ should work as in bash.

In interactive mode:

  • ctrl-C displays a new prompt on a new line.
  • ctrl-D exits the shell.
  • ctrl-\ does nothing

Pipe

| The output of each command in the pipeline is connected to the input of the next command by a pipe.

Quotes

  • Do not interpret unclosed quotation marks or special characters, such as \ (the backslash) or ; (the semicolon).
  • ' (single quote) which should prevent the shell from interpreting the metacharacters characters present in the sequence between quotes.
  • " (double quote) which should prevent the shell from interpreting the metacharacters characters present in the sequence between quotes except the $ (dollar sign).