Giter Site home page Giter Site logo

minishell_on_c's Introduction

MiniShell

This program has been the final project for my Operating System course at university. It consists of programming a command interpreter (shell) for Linux. The shell should read lines from the standard input and execute commands. For reading from the standard input I've used stdio (fgets(3)).

  • It's input format for a command line will be:

    command arg1 arg2 ...

  • In this program has also been implemented pipes, so you will be able to execute a pipeline:

    cmd1 arg11... | cmd2 arg21 arg22... | cmd3 arg31... | ...

  • A command also could have an input/output redirection of both:

    cmd1 args... < fin / cmd1 args... > fout / cmd1 args... < fin > fout

  • Implemented background:

    cmd1 args | cmd2 args... | ... &

  • Implemented environment variables:

    cmd=ls
    arg=/tmp is equivalent to ls /tmp
    $cmd $arg

  • Additional functions:

    • For lines that aren't using input/output redirection or bg, if the line ends with "HERE{". In this case, the command will use as stdin the lines written by the user until the line is "}". Example: (wc -l will return 2, as there is 2 lines as input for cat command)

      cat | wc -l HERE{
      una y
      otra lin.
      }

    • Command ifok/ifnot, will execute the command written after it, if the previous command exit status is SUCCESS/FAILURE. Example: (if directory /tmp exists, ls -l will be executed)

      test -e /tmp
      ifok ls -l /tmp

    • Globbing

minishell_on_c's People

Contributors

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