Git Product home page Git Product logo

cshell's Introduction

C Shell

Developed on git repository here under folders Assignment2 & Assignment3. Refer for commit history

  • Computer Systems Engineering - 1 (Assignment 2 & 3)
  • By Kishan Sairam Adapa - 2018101026

Features

  • All commands present in system's path work. This is done by using execvp.
  • Directory from which shell is invoked is made home directory i.e, ~.
    • Home directory can be set to directory in which the executable is present.
    • This is done by doing these in main.c
      • Uncommenting line 42 to 50
      • Commenting line 53
  • Some commands are implemented on own, they are
    • Built ins
      • cd
      • ls
      • pwd
      • echo
    • Process related
      • pinfo
    • Job related
      • jobs
      • kjob
      • overkill
  • Processes are made background when & is used
  • Pipes and Redirection are handled

Running Shell

  • Run make in directory in which codes are present to generate executable main.out
  • Run ./main.out to invoke shell
  • Dependency: This shell implemented uses readline library which is not part of standard. Which needs to be installed in case make fails

Description of Files

Compiling

  • Makefile

Header files

  • cd.h
    • cd
  • cronjob.h
    • cronjob
  • echo.h
    • echo
  • itoa.h
    • b10itoa
      • Conversion of base 10 integers to strings
      • Used to convert integers into strings for passing through pipes
  • jobs.h
    • jobs
    • kjob
    • fg
    • bg
  • ls.h
    • ls
  • pinfo.h
    • pinfo
    • get_state
      • Stores current state of process in passed string given its pid
      • Used for updating data structure in which jobs are stored
  • prompt.h
    • storePromptString
      • Stores what prompt to print in a string which is passed as parameter
      • Used to implement prompt using readline library
  • run_command.h
    • run_cmd
      • Given correct parameters it runs the command passed through parameters in foreground
  • signal_handlers.h
    • ctrlD
      • Handler for SIGQUIT (Ctrl + D)
    • ctrlC
      • Handler for SIGINT (Ctrl + C)
    • ctrlZ
      • Hander for SIGTSTP (Ctrl + Z)
    • sigchld_handler
      • Handler for SIGCHLD (Triggered whhen a child exits)

Implementation files (Contain Implemntation of functions in respective header files)

  • cd.c
  • cronjob.c
  • echo.c
  • itoa.c
  • jobs.c
  • ls.c
  • pinfo.c
  • prompt.c
  • run_command.c
  • signal_handlers.c

Shell program file - main.c

  • Implements C Shell by using system headers and headers mentioned here

cshell's People

Contributors

kishansairam9 avatar

Stargazers

Nikhil Agrawal avatar

Watchers

James Cloos avatar  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.