I wrote a program that prints a message, awaits a user input and prints a message again. The simple example below illustrates that. The program is launched with 'prog | tr 'a-z' 'A-Z'. Only the last print should be handled by 'tr 'a-z' 'A-Z'.
int main ()
{
char name[99];
printf ("Your name: ");
scanf ("%98s", name);
printf ("Your name is: %s\n", name);
return 0;
}
I 've tried a lot with pipe, dup, dup2, but nothing has worked so far. Has anyone an idea how to solve my problem?