#include #include "newcalls.h" extern **environ; int main() { int fds[2]; _pipe(fds); int pid=_fork(); if(pid) { _close(fds[1]); _dup2(fds[0],0); // replace stdin with the read-end of pipe char *args[]={"grep",NULL}; _execve("/bin/grep",args,environ); } else { _close(fds[0]); _dup2(fds[1],1); // replace stdout with the write-end of our pipe char *args[]={"cat","hello.txt",0}; _execve("/bin/cat",args,environ); } }