Giter VIP home page Giter VIP logo

myshell's Introduction

myShell

myShell is a simple Unix-like shell written in C that supports several built-in functions, background jobs, listing jobs, pipes, I/O redirection, and environment variables for both built-in functions and executable programs.

Features

  • Built-in functions:

    • cd: Change the current directory.
    • exit or quit: Exit the shell.
    • export: Set and manage environment variables.
    • echo: Display messages with support for variable substitution.
    • pwd: Print the current working directory.
    • kill: Send signals to processes.
  • Background jobs: You can run commands in the background by appending & to the command.

  • Job management: List and manage background jobs.

  • Pipes: Execute commands with pipes (e.g., command1 | command2).

  • I/O redirection: Redirect input and output for both built-in and external commands.

  • Environment variables: Set and use environment variables for your shell sessions.

Building and Running

To build the myShell project, you can use the provided Makefile:

make quash

To run the shell, execute:

./quash or make quash_test

To check for memory leaks using Valgrind, execute:

make quash_valgrind

To clean the executable file:

make clean

Usage

Simply start myShell by running the quash binary. You can enter commands with various features like background execution, pipes, I/O redirection, and environment variables.

Example usage:

$ ./quash
[QUASH]$ export MY_VARIABLE=my_value
[QUASH]$ echo $MY_VARIABLE
my_value
[QUASH]$ ls | grep .txt
file1.txt
file2.txt
[QUASH]$ program1 &
Background job started: [1] 1234 program1 &
[QUASH]$ jobs
[1] 1234 program1 &

Contributors

Bhavik Goplani & Suhaan Syed

License

This project is licensed under the MIT License - see the LICENSE file for details.

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.