I need to read a file (a list) and assign the value to a variable (for each line), I'm looping until the end of the file. My problem is, I want to assign 2 separate variables from the list. The process I'm using is:
awk '{print $3}' file1 > file2
awk '{print $4}' file1 > file3
cat file2 | while read var1
do
cat file3 | cut -c2 | while read var2
do
if [[ "$var1" = "L" && "$var2" = "e" ]] then
echo "Good Match" $var1
elif [[ "$var1" = "T" && "$var2" = "t" ]] then
echo "Good Match" $var1
else
echo "No Match"
fi
done
done
It seems like my results are 2 running twice (reading the var2 twice), meaning the test runs separately for both tests.. I need to link up the variable lists in order to test both conditions at the same time (or dependant on one another). TIA.