Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pipex

Pipex is a C project from the 42 curriculum that simulates shell pipe behavior. It executes multiple commands in sequence, connecting them via pipes, and handles input/output redirection between files, replicating shell functionality like < infile cmd1 | cmd2 | ... | cmdn > outfile. The project reinforces process creation, fork(), execve(), and pipe management.

Features

  • Executes multiple commands connected with pipes
  • Handles input and output file redirection
  • Graceful error handling for command not found or invalid files
  • Focuses on C process management and inter-process communication

Build & Run

  1. Clone the Module Directory
git clone https://github.com/Yuxin29/pipex.git pipex
cd pipex
  1. Compile using the Makefile:
make
# Generates the executable pipex
  1. Run the program:
./pipex infile "cmd1" "cmd2" ... "cmdn" outfile
 Example:
./pipex input.txt "grep hello" "wc -l" output.txt

Project Structure

include/
├── pipex.h
src/
├── cmd.c
├── helper.c
├── pipe.c
Makefile
README.md

About

A C program that mimics the behavior of shell pipelines, handling multiple commands and input/output redirections.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages