/* establishes a pipe between the OS and a program(e.g ls | uppercase) */ #include #include main() { int c; FILE *ifp; ifp = popen("ls", "r"); /* open a pipe to read the output of ls */ while ((c = getc(ifp)) != EOF) putchar(toupper(c)); pclose(ifp); }