I have a program that waits for 'get', and then waits for multiple file inputs (either on the same line or one by one). 'quit' is then used to end input. My files reside in a folder "test_files/" in a different directory. What I want is for the script to input every file from my folder into my program.
Right now I have:
{ echo "get"; echo "file1.txt file2.txt ... fileN.txt quit"; } | ./program But what I want is something like this:
echo "get" | ./program for N in {files in folder} do echo "fileN.txt" | ./program done echo "quit" | ./program
for files in test_files/*; do ./program < files; done?{ echo get; ls; echo quit; } | ./program?C, if you are asking for a shell script to do the work. Edit the question and take off the tag. Or if it's C, then show the code you have. It's impossible to help you if you don't show the code you have written.