Code Monkey home page Code Monkey logo

minishell's Introduction

logo

Creating a simple version of Bash.

About the project

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.

Getting started

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.

Usage

logo

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).

Important learnings

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.

  1. Working together on a complex project, deciding on a stategy together and communicating about challenges
  2. Using Git and GitHub in a collaborative way
  3. Implementing our own hash table to store the environment variables
  4. Writing an elaborate tokenizer / parser that interprets user input in a way that can be used by an executer
  5. Preventing memory leaks in a large project
  6. Implementing signals
  7. Parent and child processes
  8. Linked lists
  9. File descriptors
  10. Exit codes and handling errors

Contact

See our profile pages for ways to contact us!

minishell's People

Contributors

fkoolhoven avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.