GithubHelp home page GithubHelp logo

shell's Introduction

OurShell

Implementation of a basic LINUX shell in C.

Basic Information

  1. As a project work of our Operating System curriculum we have implemented this basic shell program for Linux / Unix like operating system. The program is written entirely in C language. The project description can be found in the link: https://www.isical.ac.in/~mandar/os/projects.txt

  2. Following functionalities have been implemented so far

    1. program runs in an infinite loop in which it prints a command prompt, accepts a command, executes the command, and prints the prompt for the next command.
    2. Running jobs in the foreground and background
    3. simple input/output redirection (>, <)
    4. Simple pipes (|)
    5. Handling user interrupt signal (SIGINT)
    6. Execute both internal commands (ls, pwd, cd etc.) and external commands (using execvp system call)
    7. Command line editing (with TAB completion)
    8. Command history (typing "history" will give entire command history), Uparrow and Downarrow key for command history navigation
  3. Functionalities yet to be implemented

    1. "echo" command
    2. Simple shell variable substitution

Installation and Execution Guidelines

  1. We have used GNU readline and history library in this program. If these libraries are not on your system please install the same. Complete installation guideline is given in the following link: (https://tiswww.case.edu/php/chet/readline/rltop.html)

  2. Place the file "Submission_Shell.tar" in suitable location of your filesystem and extract the same.

  3. There shall be following four files in the extracted directory

    1. OurShell.c: C source code of our Shell program
    2. run.sh: Shell script to compile and execute the source code
    3. functiona_dependency.pdf: Functional dependency graph which explains various caller-callee relationship between the functions inside the program
    4. README.txt: The one you are currently reading

(4) Open the extracted directory in terminal and run the follwoing command once. This will give execution permission to the shellscript.

	$ chmod +x run.sh

(5) The run using the following command in terminal:

	$ ./run.sh

References and Acknowledgement

We are indebted to Prof. Mandar Mitra ( https://www.isical.ac.in/~mandar/ ) for his guidance and support.

Following is the list of references from where we have obtained useful informations pertaining to our project:

  1. man pages of following system calls (The list is not exhaustive) wait, dup2, fork, execvp, chdir, signal

  2. GNU readline library documentation (https://tiswww.case.edu/php/chet/readline/readline.html)

  3. GNU history library documentation (https://tiswww.case.edu/php/chet/readline/history.html)

  4. A very basic shell implemented by Stephen Brennan. (https://brennan.io/2015/01/16/write-a-shell-in-c/). We have taken few basic ideas from this reference.

shell's People

Stargazers

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