Giter Site home page Giter Site logo

simple_shell's Introduction

Introduction:

The simple shell project is a project for students of alx africa school and that project is the final project for the basics of c programming language , shell commands.The simple shell project is a simulation for the real shell of linux and it works with the same way which the real shell works with.

Usage:

In order to run this program, Clone This Repo https://github.com/mokhtarmramadan/simple_shell.git compile it with: gcc 4.8.4 -Wall -Werror -Wextra -pedantic *.c -o hsh run it with ./hsh command

How to use it:

in order to use the sell program you will see a text which is: sash you type any command you want beside that word

Examples of commands which you can use:

  • ls command: you can use that command to list all files and directories in your folder or directory
  • env command: Displays the environment variable
  • exit [exitstatus] Exit from the program with exitstatus value. 0 by default.

Files of simple shell:

  • shell.c: That is the main file of the project it has main code of the project which is:
    • code of the promot which has the word sash
    • code of getline function which get the input from the user
    • code of check_getline function which will check some important points:
      1. check if the getline function succeed or not
      2. check if the buffer array which has the input of the user has any spaces
      3. check if the command is env it will print the environment variable
    • code of arguments which are exist in any command for example ls -l or touch Mo.c
    • code of execute system call which will execute any command
  • print_env.c: It will print the environment in form of key = value
  • check_getline.c:
    1. check if the getline function succeed or not
    2. check if the buffer array which has the input of the user has any spaces
    3. check if the command is env it will print the environment variable
    4. check if the input of the user is exit it will exit the program
  • check_getline.c:
    1. check if the getline function succeed or not
    2. check if the buffer array which has the input of the user has any spaces
    3. check if the command is env it will print the environment variable
    4. check if the input of the user is exit it will exit the program
  • check_space.c: Check if the input is only spaces without any letters or words if that function will find any letter it will return 1
  • contributors : Ahmed Elsharkwi Mokhtar M. Ramadan

simple_shell's People

Contributors

mokhtarmramadan avatar ahmed-elsharkwi avatar

Stargazers

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