Skip to content

The objective of this project is for you to create a simple shell. Yes, your own little bash or zsh. You will learn a lot about processes and file descriptors.

License

Notifications You must be signed in to change notification settings

paozer/minishell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The minishell project aims for students to recreate a simplified yet useable shell. Introduced/refined concepts include signals, processes, file descriptors, environment variables, Termcap library...

This project is subject to 42's norm which restricts naming conventions, function and line lenghts and more. Some weird sections may therefore be the result of said norm.

The final version of the project was rated 109/115 by three fellow students. This minishell was a team effort from pminne and myself.

Features

subject requirements

  • builtins: echo (with -n), cd (only relative/absolute paths), pwd/export/unset/env/exit (w/o options)
  • display a prompt while waiting for input
  • ; separates commands like in bash
  • ' and " act like in bash except for multiline commands
  • <, > and >> act like in bash except for file descriptor aggreation
  • | act like in bash
  • environment variables and $? act like in bash
  • ctrl-C, ctrl-D and ctrl-\ act like in bash

subject bonus part

  • line edition
  • left/right cursor movement
  • up/down arrows for command history and subsequent line edition
  • goto start/end of a line w/ home/end keys

additional features

  • variable declaration w/o export ($ my_var=my_value)
  • ctrl-L to clear the screen
  • the prompt displays the current directory name and git information if applicable
  • cd implicitly by entering the desired directory name

Installation

Our minishell should play nicely on MacOS and Linux. Copy paste the following command in your shell and execute it.

git clone https://github.com/paozer/minishell && cd minishell && make && ./minishell

Resources

About

The objective of this project is for you to create a simple shell. Yes, your own little bash or zsh. You will learn a lot about processes and file descriptors.

Topics

Resources

License

Stars

Watchers

Forks