Skip to content
Maxwell Nana Forson edited this page Nov 14, 2023 · 2 revisions

MSH (Minimal Shell) - User Documentation

Overview

MSH is a minimalistic shell that provides a simple command-line interface for interacting with your operating system. This section will guide you through the process of downloading, building and using MSH on your system.

Table of Contents

  1. Prerequisites
  2. Download and Installation
  3. Basic Usage
  4. Advanced Features
  5. Troubleshooting

1. Prerequisites

Before using MSH, ensure you have the following prerequisites installed on your system:

2. Download and Installation

You have two options, either install it globally or use it from the projects folder

  1. Clone the Repository:

    git clone https://github.com/nanafox/simple_shell.git
    cd simple_shell
  2. Build MSH (Limited to the folder):

    make

    This command will compile the source code and generate the msh executable.

OR

  1. Install MSH(Globally):
    sudo bash install.sh
    This script will install msh on the system at /usr/bin/msh so you can access it from anywhere.
    If you used this method, you'll execute with msh, you don't need the full path.

3. Basic Usage

  1. Run MSH:

    ./msh
  2. Execute Commands: Enter commands directly into the shell prompt and press Enter to execute.

    ls -l
    cd /path/to/directory
    echo "Hello, MSH!"
  3. Exit MSH: To exit the shell, use the exit command.

4. Advanced Features

MSH supports several advanced features:

  • Alias Commands:

    alias cls='clear'
    alias md='mkdir'
    unalias cls
  • Logical Operators:

    command1 && command2
    command1 || command3
  • Environment Variables:

    setenv MY_VARIABLE my_value
    unsetenv MY_VARIABLE
  • File as Input:

    ./msh script.txt
  • Variable Expansion:

    echo "Process ID: $$"
    command
    echo "Exit Status: $?"
  • Command Separator (;):

    command1 ; command2
  • Custom Env

    env

5. Troubleshooting

If you encounter any issues or have questions, refer to the Issues section on the GitHub repository. Feel free to open a new issue if your problem hasn't been addressed.