Giter Site home page Giter Site logo

pipex's Introduction

Pipex

This project serves as an introduction to interprocess communication and error management conforming to POSIX standards.

The mandatory part of the project asks us to execute and redirect input output of two Unix programs in C, simulating a bash command as in the example below:

< filein cmd1 | cmd2 > fileout

The bonus part of the project asks us to handle an indefinite number of pipes, as well as user input as the infile, as in the examples below:

< file1 cmd1 | ... | cmdx > fileout

or, with user input:

<< limiter cmd1 | ... | cmdx > fileout


What i learned?

This project gives us a detailed view of things we already used in a daily basis. How the file descriptors and stdIO work in depth and how to redirect them to wherever you want.

We also have to asks the operating system information about files and update system variables accordingly.

This opens us many avenues, breaking away from the constraints of our C program, being now able to ask anything we want to know about our own system, or even in the web, and utilize that information without interrupting our running program.

My badge

Pipex badge

My grade

Pipex grade

Requirements

  • linux system with GCC and bash (it doesn't work in zsh due to how the quotes are handled)

How to use

Clone the repository:

git clone --recurse-submodules https://github.com/VLN37/pipex

Compile the program with:

make

Run the program in the format below. Some examples are:

./pipex .gitignore "tr a b" "tr b c" "tr c d" outfile

./pipex EOF "tr a b" "tr b c" outfile

./pipex .gitignore "ping 8.8.8.8" "grep ms" outfile

Or any unix command you want!

License

This project is licensed under the MIT terms, available here

pipex's People

Contributors

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