I have two numbers in test.txt file, I would like a way to divide the second number by the first number and assign the result to a variable or file in a bash script that I can use. I have used
awk "NR==1" test.txt to get number1 displayed on command line but inside of script, I have tried
awk "NR==2" test.txt / awk "NR==1" test.txt and all of the quote / bracket combinations of such. The command line use gives num2/num1 as result, not the result of division or gives syntax error. I am using Debian Linux as OS.
test.txt file contains
I want the second number divided by the first
The numbers will change from time to time and I want a script that will process the numbers.