UNIX: How to run a program with a file as an input
问题 I'm writing a bash script called 'run' that tests programs with pre-defined inputs. It takes in a file as the first parameter, then a program as a second parameter. The call would look like ./run text.txt ./check for example, the program 'run' would run 'check' with text.txt as the input. This will save me lots of testing time with my programs. right now I have $2 < text.txt > text.created So it takes the text.txt and redirects it as input in to the program specified, which is the second