My program takes three options ./program a b c INPUT > OUTPUT (a,b,c are options).
I have a list of option combinations:
cat list_of_combinations
1 2 3
4 8 3
1 5 7
9 5 6
I want to execute program using those four different combinations. For example:
./program 1 2 3 INPUT >> OUTPUT
./program 4 8 3 INPUT >> OUTPUT
./program 1 5 7 INPUT >> OUTPUT
I already tried this:
while read COMBO; do
echo $COMBO |
./program - INPUT >> OUTPUT
done < list_of_combinations
And this:
while read COMBO; do
./program $COMBO INPUT >> OUTPUT
done < list_of_combinations
My question is:
How to execute program/command while using a string of variables as options?
Edit
I wouldn't have any problems if there was only one character as variable. What I mean by that:
Program takes only one option:
./program a INPUT > OUTPUT
cat VARIABLES
1
15
78
while read VARIABLE; do
./program $VARIABLE INPUT > OUTPUT
done < VARIABLES
But when there are several options (string of characters), for example ./program a b INPUT > OUTPUT I am getting error.
list_of_combinations?./program $COMBO INPUT >> OUTPUTshould work as long as the arguments cannot themselves contain spaces.