Code Monkey home page Code Monkey logo

cshell's Introduction

Cshell

A shell implemented in C. Written as a part of Operating Systems (CS39002) coursework.

Cshell_about

Functionalities

The following functions have been written explicitly in C.

  • cd - Change directory

  • pwd - Present Working directory

  • mkdir

    - Make a directory (Alerts if already exists)

  • rmdir

    - Remove the directory (Alerts if no such file or directory)

  • ls - List contents of pwd

images/ls

  • ls -l - List the contents in long listing format

images/ls_l

  • cp - Copy contents of file1 to file2; only if file1 was more recently modified. Create file2 if not present already.

  • exit - Exit the shell ; also works for z

  • Supports running the execuables (predominanatly, ./a.out and scripting commands, like touch, cat, python notif.py )

  • Any path added to your $PATH folder will work. [Refer to function runprocess in shell.c]

  • Support background execution such as python notif.py & - returns its PID.

  • Input from and output to files, such as ./d < in.txt and ./inc > in.txt supported. (Both can work simultaneously.)

  • Support piping upto 2 levels - such as ./inc | ./d and ./inc | ./d | ./t

Execution

make clean
make
./Cshell

Output : images/exec

The test cases are present in tests folder.

run.c creates a child process to execute shell.c in a gnome-terminal, suited for debuggging. In case the terminal session is to be viewed in the continuing session, execution is as :

make clean
make
./myshell

Known issues

  • gcc and grep don't work for some freaking reason. Most of the other commands like cat, touc, gedit, atom work but these 2 seem to hold a grudge against me.

  • support piping with system calls.

cshell's People

Contributors

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