/ft_shell

School project: A simple interactive shell mimicking bash with an AST

Primary LanguageCDo What The F*ck You Want To Public LicenseWTFPL

ft_sh

minishell, 21sh and 42sh are school projects at 42 Paris campus.

42 is a private, non-profit and tuition-free Computer Science school based on peer-to-peer learning and hands-on projects.
All programs written in C follow 42 style guideline.

A minimalist interactive shell mimicking bash.

demo

Table of content

Disclaimer

This project is a school assignment. It was done for learning purposes and is thus not intended for production.
Don't copy. Learn.

This code is not the one that was turned in for minishell. It aims to evolve to 21sh and 42sh.

Requirements

This program was developed on Debian Linux. It runs on Debian and Ubuntu.

  • gcc
  • make

Dependencies

Installation

  1. Clone the repository and its dependencies:
$ git clone --recursive https://github.com/matboivin/ft_sh
  1. Change it to your working directory and run:
$ make install && make

Usage

$ ./ft_sh

Debug mode

Each time an input is received, this mode displays the tokens, draws the AST and displays the command table.

Ensure you ran make install.

$ make debug
$ ./ft_sh

AST gif

wandre mode

wandre will insult the user when they type a wrong command.

To wake up wandre, type !wandre in the ft_sh, and !stopit_wandre to deactivate it.

./ft_sh 
┌─[ft_sh]─[~/path/to/ft_sh]
└──╼ !wandre
Warning /!\ The wandre mode is activated! Type '!stopit_wandre' to deactivate

    wandre: hi! :)

┌─[ft_sh]─[~/path/to/ft_sh]
└──╼ !stopit_wandre
wandre mode deactivated

    wandre: bye :)

wandre mode

Inspired by the bash-insulter.

For more wandre, click here.

Acknowledgements

School project done at 42 Paris.

License

See LICENSE for more information.