Skip to content
/ pipex Public

Simplified version of the shell command-line construct

Notifications You must be signed in to change notification settings

inno-aca/pipex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pipex

The pipex project is part of the 42 school curriculum, challenging students to implement a simplified version of the shell command-line construct < file1 cmd1 | cmd2 > file2. This project aims to improve understanding of file descriptors, processes, and the concept of pipes in Unix-like operating systems.

Overview

The pipex program is designed to take two commands as arguments and execute them in a way that mimics the behavior of the shell command < file1 cmd1 | cmd2 > file2. Key features include:

  • Piping: Connects the standard output of the first command to the standard input of the second command using pipes.
  • Redirection: Redirects the standard input or output to specified files as indicated in the command line.
  • Multiple processes: Spawns and manages multiple child processes to execute the given commands in sequence.
  • Here documents: Supports the use of here documents as input for the first command.

Usage

  1. Clone the project:
git clone https://github.com/seungwonme/pipex.git
  1. Navigate to the project directory:
cd pipex
  1. Compile the executable:
make
  1. Run the program with the desired command-line arguments:
./pipex infile cmd1 cmd2 ... cmdn outfile
# It will execute the following command:
< infile cmd1 | cmd2 | ... | cmdn > outfile

./pipex here_doc <limiter> cmd1 cmd2 ... cmdn outfile
# It will execute the following command:
<< <limiter> cmd1 | cmd2 | ... | cmdn > outfile

Example:

./pipex infile "ls -l" "cat -e" "grep pipex" outfile
  • To clean up object files:
make clean
  • To delete all build files:
make fclean
  • To clean and rebuild the executable:
make re

About

Simplified version of the shell command-line construct

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published