Consider a file.txt file with below values
one,two
three,four
five,six
six,seven
red,tree
Need a shell script command to perform below activity
- For loop in which the loop should be continuously executed with as many number of lines the file.txt has
- In each loop execution, the respective line should be considered a input for the execution.
For example, in first loop execution, "one" should be stored in a variable and "two" should be stored in another variable so that it will use the variable values in execution
Input1="one"
Input2="two"
Similary for second line execution, "three" should be stored in a variable and "four" should be stored in another variable like below
Input1="three"
Input2="four"
input2
you can create a third var to collect it all:while IFS=, read -r input1 input2 garbage; do
– jesse_b Oct 07 '17 at 22:25