Skip to content

Instantly share code, notes, and snippets.

@SwayamInSync
SwayamInSync / shell_pipe.c
Last active November 5, 2024 14:37
Implementing a Shell Pipe in C within 100 lines
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <string.h>
#define TEMP_FILE1 "temp_pipe1.txt"
#define TEMP_FILE2 "temp_pipe2.txt"
#define MAX_COMMANDS 10