A project made in accordance with the Minishell project which is part of the Codam Core Curriculum. This project was a collaboration between Felicia Koolhoven and Jagna Hendriks. We created our own simple version of bash, Jagna handling the executer, environment and signals and Felicia handling the tokenizer, expander and parser. Our Minishell contains several builtins, handles redirections (including heredocs), pipes, several signals. It expands environment variables (or attempts to) when it finds a $ but distinguishes between single (') and double (") quotes, not interpreting $ when it is between double quotes. This was the biggest collaborative project we had both worked on until that point.
Start by cloning the repository:
git clone https://github.com/fkoolhoven/Minishell
Go into the minishell directory and compile by using make:
make
Minishell has the GNU Readline library as a dependency. You may need to configure the Makefile for your particular machine/OS.
You can use Minishell like you would use Bash.
For example:
<< EOF grep "Hello world" | wc > outfile
will work the same as in Bash. Minishell handles <<, <, >, >> as redirections and | as pipe.
Minishell also has several builtins (see src/builtins) so
export var="Hello world"
will add var to the environment variables.
And because we also handle $, single and double quotes
echo "$USER" '$USER'
will output: [yourusername] $USER
Available signals:
- ctrl-C displays a new prompt on a new line
- ctrl-D exits the shell
- ctrl-\ does nothing
Minishell also has a working history (use the arrow keys).
We worked together for several weeks on this project and got a lot of practice in with things we were already familiar with + we were introduced to some new topics.
- Working together on a complex project, deciding on a stategy together and communicating about challenges
- Using Git and GitHub in a collaborative way
- Implementing our own hash table to store the environment variables
- Writing an elaborate tokenizer / parser that interprets user input in a way that can be used by an executer
- Preventing memory leaks in a large project
- Implementing signals
- Parent and child processes
- Linked lists
- File descriptors
- Exit codes and handling errors
See our profile pages for ways to contact us!