TL;DR;
MyProgram < MyTestCases
Assume we have a simple program called ToUpper (or ToUpper.exe on Windows), that's implemented like this:
#include <stdio.h>
#include <ctype.h>
#define BUFFER_SIZE 512
int main()
{
char buffer[BUFFER_SIZE];
while (fgets(buffer, BUFFER_SIZE, stdin) != NULL)
{
for (int i = 0; i < BUFFER_SIZE; i++)
buffer[i] = toupper(buffer[i]);
printf("%s", buffer);
}
printf("All done!\n");
return 0;
}
In this case, if you have a text file called MyText.txt, that you would like to turn all upper case, you could do it with the following command:
ToUpper < MyText.txt
and it will print all the upper-case characters to the screen.
If you want to save it in a file, you can do it like this:
ToUpper < MyText.txt > MyUppercaseText.txt
I hope this helps.