Thanks for answers. bc was what i needed.
I do not know if publishing the result can use. In any case, this is the last piece of code for the emergency focal length of a photograph and print in decimal format. It should work for all cameras. Tested on 4 cameras of 3 different brands.
F="your_image.JPG" EXIF=$(exiv2 -pv "$F") FocalFractional=$( echo "$EXIF" | grep -E '[^ ]* *Photo *FocalLength '| grep -iohE "[^ ]* *$" ) Formula="scale=2; "$FocalFractional FocalDecimal=$( bc -l <<< "$Formula" ) echo $ FocalDecimal
source share