I am trying to do a simple division computation between two integers that will result in a float. I do not want to use bc. This approach works for me for a different purpose with slightly different syntax but I am not quite sure where I am messing up. I am positive that the variables are getting assigned correctly, but I have an error once I try to do the division, and nothing actually gets assigned to the variable. Can anyone help?
Thanks in advance!
rate=`awk '{ shared = "'"${tempRatioArray[0]}"'"; total = "'"${tempRatioArray[1]}"'";\ printf "%3.0f\t", shared/total }' | awk '{print}'`