I have a C executable that takes in 4 command line arguments.
program <arg1> <arg2> <arg3> <arg4>
I'd like to create a shell script that continually runs the executable with arguments supplied by text files. The idea would be something like this:
./program "$(< arg1.txt)" "$(< arg2.txt)" "$(< arg3.txt)" "$(< arg4.txt)"
Where the arguments supplied for run n
would be on line n
of each of the files. When I tried doing this, the printf() calls were interfering with each other or some other funny business was going on. I would also be open to a script that takes only one file where the arguments are delimited in some way.