MyProgram < MyTestCases
Assume we have a simple program called ToUpper (or ToUpper.exe on Windows), that's implemented like this:
#define BUFFER_SIZE 512
while (fgets(buffer, BUFFER_SIZE, stdin) != NULL)
for (int i = 0; i < BUFFER_SIZE; i++)
buffer[i] = toupper(buffer[i]);
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.