I'm relatively new in bash coding. I wrote a little script, that is a lopp through a txt file.
while read element1 element2 element3; do
if [ $element3 -lt 0.049 ]
then
operation
else
operation
fi
done < /path/file.txt
I am aware that the code above doesn't work for floats.
I would like to use one of the element of the txt file in an if statement, but this specific element is a decimal number.
I have also seen an example using awk, but I didn't understand it because using awk requires to change the code in non-familiar way to me.
So, is there a simple line of code to compare decimal numbers in if statements?