i have a file "test.txt" which has a list of numbers, like this
1
3
4
2
3
40
312
53
243
321
423
...etc
I also have an executable which is a sorting algorithm, for example heapsort. when i type ./heapsort it asks me for input untill i press CTRL+D.
How can i make that the ./heapsort input is test.txt?
I have a program "generate". so if i put ./generate 20 | ./heapsort it prints the ordered list. How can i make heapsort read from the text file created with ./generate 20 > test.txt