Skip to content

eschirni/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minishell - As beautiful as a shell

Screenshot 2022-02-28 at 3 29 02 PM

Description of the subject

Thanks to Minishell, you’ll be able to travel through time and come back to problems people faced when Windows didn’t exist.

We have restrictions which functions we're allowed to use (see subject pdf). In addition we have to format our code according to the schools Norm

Full subject: minishell.pdf

Installation

  1. You might have to install the readline libary with brew install readline
  2. To create the execuatable run make
  3. To start the programm: ./minishell

What we've implemented

-Own functions: cd, pwd, env, exit, unset, export, echo (all other bash commands are implemented with execv)
-A working history: arrow key up/down
-Single and double Quotes
-Redirections: < (input), > (trunc), >> (append) and << (heredoc)
-Pipes: single and multible pipe(s), combination with redirections possible
-Environment Variables
-Signals: ctrl-C, ctrl-D and ctrl-\

Structure

1. Lexer: tokenization of the input string e.g. "CMD, ARGUMENT, PIPE, CMD, ARGUMENT, TRUNC, FILE"
2. Parser: filtering parser errors and quotes, redirects output for pipes and redirections, etc.
3. Executor: executes commands with arguments