Git Product home page Git Product logo

42sp-pipex's Introduction

42 Cursus

pipex

pipex Logo

The pipex project aims to provide a program that emulates the behavior of the Unix shell command pipex, allowing users to redirect the output of one command as the input to another, similar to using pipes in the command line.

Description

The project pipex challenges students to recreate the functionality of the Unix shell command pipex, emphasizing the mastery of low-level programming concepts and a deep understanding of Unix system calls. As part of the curriculum, this project is designed to enhance students' skills in handling file descriptors, processes, pipes, and command execution, while adhering to the 42's pedagogical philosophy of peer-to-peer learning and project-based education.

Features

  • Input redirection from a file
  • Output redirection to a file
  • Command chaining with pipes
  • Error handling for invalid input

Installation

Before proceeding with the installation, make sure you have the following dependencies:

  • A Unix-like operating system (Linux, macOS, etc.)
  • GCC compiler

Follow the steps below to test the project:

  1. Clone the repository to your local machine:
git clone [email protected]:beatrizdile/42sp-pipex.git
  1. Compile the project:
make
  1. To compile the project with bonus:
make bonus
  1. Run the program with the following syntax:
./pipex infile cmd1 cmd2 outfile
  • infile: Input file to read data from.
  • cmd1: First command to execute.
  • cmd2: Second command to execute.
  • outfile: Output file to write results to.

Examples

./pipex input.txt "grep keyword" "sort -r" output.txt

Test Bonus

  1. To test the first part of the bonus, use three or more commands:
./pipex input.txt "grep keyword" "sort -r" "wc -l" output.txt
  1. To test the second part of the bonus, run:
./pipex here_doc "grep keyword" "sort -r" "wc -l" output.txt

In the second part of the bonus instead of using an already existing file as input, you use "here_doc" to write the input text yourself.

42sp-pipex's People

Contributors

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