GithubHelp home page GithubHelp logo

pipex's Introduction

pipex

This project is about handeling pipes!

Coded in


The project:

Basics:

  • The program has to behave like this shell command:
< infile cmd1 | cmd2 > outfile
  • The program gets executed the following way:
./pipex "infile" "cmd1" "cmd2" "outfile"
  • The program only works for UNIX-like operating systems.

Functioning:

  • The program pipes the contents of the "infile" into the first command "cmd1".
  • The first command gets executed, the results get piped into the second command "cmd2".
  • The second command gets executed and the output is written to "outfile". All existing contents of the "outfile" are overwritten (If the program has no output, "outfile" will be empty").
  • The "outfile" will get overwritten!

Other functionality:

  • In addition to the basic functioning of the project, you can insert as many commands as you want into the project:
./pipex "infile" "cmd1" "cmd2" "..." "cmdn" "outfile"

Here_doc:

  • The program can also simulate the following shell command:
cmd << LIMITER | cmd1 >> outfile
  • For this the program has to be executed the following way:
./pipex here_doc "LIMITER" "cmd" "cmd1" "outfile"
  • If the program is called with here_doc as first parameter, the User can input text into the command line, once a line is the same as specified, the program stops reading and executes the commands.
  • In addition, with here_doc, the "outfile" will not be overwritten, but the results will be appended to it.

Installation and Usage

  1. Clone the repository:
git clone https://github.com/itseugen/pipex
  1. Enter the directory and build the program:
cd pipex
make

Optional: Clean object files:

make clean
  1. Create a input file (the program needs an existing input file, if the output file is missing it will be created):
touch input.txt
  1. Run the program like explained above, you need at least for arguments. Example:
./pipex "input.txt" "grep Hello" "wc -w" "output.txt"

This project is part of my studies at 42 Heilbronn

pipex's People

Contributors

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