I have a C program and the inputs are given through command line. Now I want to pass the inputs from a text file. There are two inputs,
b, written line by line like this:
a b 2 423 4 56.9 7 83.5
Now I want to call this txt file in a loop and pass each
b value line by line so that the output of the C program is generated for each
To do so I want to write a shell script which will call the txt file in read mode and after getting the data it will call the C program and then the C program will do the rest including the output.
As I am new to this shell scripting I am confused about how to open a text file and then read data line by line and store them in some variable in the shell script.
Please suggest how can I open the text file in read mode and then read data (which may not be always integers) and store them in some other variables.