#include #include int main() { FILE *fp = popen("ls", "r"); if (!fp) { perror("error"); exit(10); } while (1) { int c = fgetc(fp); if (c == EOF) break; fputc(c, stdout); } }