Giter Club home page Giter Club logo

simple_shell's Introduction

Table of Contents

Simple Shell Project

This is a simple UNIX command interpreter that can execute commands both interactively and from a file.

Installation

To use the Simple Shell project, simply clone the repository from GitHub by running the following command in your terminal:

git clone https://github.com/MHRasmy/simple_shell.git

Once you have cloned the repository, navigate to the project directory by running:

cd simple_shell/

Compile the program by running:

gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o shell

Usage

To start the Simple Shell, run the following command in your terminal:

./shell

This will start the Simple Shell and you will see the prompt: #cisfun$ For example if you want to list the files and directories in the current directory use ls like this:

#cisfun$ ls

write any commands to execute it. This will list the files and directories in the current directory.

You can also execute commands from a file by running:

./shell [filename]

For example, if you have a file called commands that contains a list of commands, you can run:

./shell commands

This will execute each command in the file.

Note that this shell doesn't support pipeline redirection.

Files

  • shell.h: contains all function prototypes and standard libraries.
  • shell.c: contains the main function that runs the shell.
  • builtin.c: contains the functions that execute built-in commands, e.g., cd, exit.
  • env.c: contains functions to handle environment variables.
  • execute_command.c: contains functions to execute commands shell.
  • parse_input.c: contains functions to parse input commands.
  • print.c: contains functions for printing output.
  • prompt.c: contains functions to interpret shell commands;
  • run_commands_from_file.c: contians functions to interpret commands from a file.
  • _free.c: free memory allocated during runtime.
  • strings.c: contains string manipulation functions.

Contributing

Contributions to the Simple Shell project are welcome! To contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch with your changes: git checkout -b <branch-name>
  3. Make your changes and test them thoroughly.
  4. Commit your changes: git commit -m "my commit message"
  5. Push your changes to your fork: git push origin <branch-name>
  6. Create a pull request for your changes.

simple_shell's People

Contributors

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