Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pipex

A 42 school project that recreates the behavior of a shell pipe (|) between two commands, implemented in C using fork, pipe, dup2 and execve. The bonus part supports multiple pipes and here_doc-style input.

What it does

Given a file, two commands and an output file, pipex runs the equivalent of:

< infile cmd1 | cmd2 > outfile

It creates a pipe and a child process for each command, redirects standard input/output accordingly, and executes each command using the system PATH.

Build

make        # builds pipex
make bonus  # builds pipex_bonus (multiple pipes + here_doc)
make clean  # removes object files
make fclean # also removes the executables
make re     # rebuilds everything (mandatory + bonus)

Usage

./pipex infile cmd1 cmd2 outfile

Bonus (multiple commands and/or here_doc):

./pipex_bonus infile cmd1 cmd2 ... cmdN outfile
./pipex_bonus here_doc LIMITER cmd1 cmd2 outfile

Constraints

  • Follows the 42 Norm
  • Compiles without errors or warnings (-Wall -Wextra -Werror)
  • Relies on libft, ft_printf and get_next_line as internal libraries

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages