#include #include // read, isatty // STDIN_FILENO int process_fp(FILE* fp) { char buffer[1]; while (read(0, buffer, sizeof(buffer)) > 0) { printf("%c", buffer[0]); } return 0; } int main(int argc, char** argv) { // if (!isatty(STDIN_FILENO)) { // check if stdin is coming from terminal or pipeline return process_fp(STDIN_FILENO); } else if(argc > 1){ printf("To do"); } return 0; }