Skip to content
Melow-codePublic

About

Shell in C that reproduces bash behavior. Lexer, parser, pipes, redirections, heredocs, signals and built-ins.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

239 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by saouissi, rpinheir

Description

Minishell is a 42 group project where the main goal is to build a simplified shell, in comparison with bash. In global we must execute programs from PATH variable, code ourselves built-ins programs like cd, echo or env. Within the scope, we manage pipes, redirections, Posix signals like SIGINT (CTRL+C), build history based on recent inputs. There is also a environment cloning where we must manage environment variables, and so also using '$?' to get the exit status of the most recent execution and be able to expand variables with character '$'.

There is also a less visible task is to build, how we manage the prompt (the user inputs). The manner we've decided to do is the following: Input -> readline() -> lexer -> tokens -> parser -> struct with linked lists -> execution. Technical details will be listed later.

Minishell project

Instructions

To build the project:

make

To run it you can either:

make run

or

./minishell

This will launch the program and will run until you close it (Ctr+D, exit, etc...)

Feel free to test with those examples:

ls -la
cat README.md | grep "Instructions"
cat << eof > here.log | cat here.log | grep "$USER"
USER
$USER
eof

Resources

Minishell 42 Guides

Parsing/Lexer Theory

Videos

Others:

About

Shell in C that reproduces bash behavior. Lexer, parser, pipes, redirections, heredocs, signals and built-ins.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages