I have a file like:available_space:1232334343capacity:123456432total_space:1232323232I want to calculate capacity/total_space so I need to calculate    123456432/1232323232I can imagine I need to use something like:cat my_file | awk -F:'FNR==2 {print$2}' But cannot write the division itself, I'm not quiet sure about the syntax. So how I can do that?
divide second field of n.th line of a file
linux;shell script;awk
According to your initial approach, the crucial lines are the 2nd and 3rd line only:awk -F':' 'NR==2{ c=$2 }NR==3{ print c/$2 }' my_file0.100182