#include #include #include #include #include #include int main() { int des[2]; pipe(des); pid_t pid = fork(); if (pid == -1) { printf("failed"); return 0; } else if (pid == 0) { char x; while (read(des[1], &x, 1)) { printf("%c%c%c%c",x,x,x,x); } } else { char xxx; while (read(0, &xxx, 1)) { write(des[0], &xxx, 1); if (xxx == 'h') break; } } return 0; }