mxafi / minishell

A school project at Hive Helsinki, recreating a simple version of bash.
2 stars 1 forks source link

Minishell

Minishell is a simplified version of bash developed as part of the main curriculum for Hive Helsinki. It provides basic shell functionality, including executing commands, managing environment variables, and handling input/output redirection.

Table of Contents

Features

Requirements

Requirements:

  1. Using an Intel-based MacOS system, can work on other systems using some tweaks.
  2. Readline installed using brew in ~/.brew/opt/readline directory.
  3. Any C toolchain installed ( clang, gcc, ... ).
  4. GNU Make installed.

Installation

To use Minishell, follow these steps:

  1. Clone the repository:

git clone https://github.com/mxafi/minishell.git

  1. Change to the project directory:

cd minishell

  1. Compile the source code using make:

make

  1. Run the Minishell executable:

./minishell

Usage

Minishell provides a command-line interface where you can enter commands and execute them. It supports various features and built-in commands similar to bash.

Here are some examples of how to use Minishell:

$ ls -l              # Execute the "ls" command with the "-l" option
$ echo Hello World   # Print "Hello World" to the console
$ cd /path/to/dir    # Change directory to "/path/to/dir"
$ export VAR=123     # Set the environment variable "VAR" to "123"

For more details on supported commands and features, please refer to the Supported Commands section.

Supported Commands

Minishell supports the following built-in commands:

Additionally, Minishell can execute external commands by searching for them in the directories listed in the PATH environment variable.

Contributing

Contributions are welcome! If you would like to contribute to Minishell, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make the necessary changes and commit them.
  4. Push your changes to your forked repository.
  5. Submit a pull request to the main repository.

Please ensure that your code follows the project's coding style and conventions.