How to print float value from binary file in shell?
I've binary file consisting double float (8 bytes) or just float (4 bytes) value which was generated in the following way: $ python -c $'from struct import pack\nwith open("file.bin", "wb") as f: f.write(pack("<d", 0.123))' $ xxd file.bin 00000000: b072 6891 ed7c bf3f .rh..|.? which I could print it back from Python via: $ python -c $'from struct import unpack\nwith open("file.bin", "rb") as f: print(unpack("<d", f.read(8)))' (0.123,) The same for 4-byte float, just change <d into <f (mentioned as float.bin later on). How do I print that value from the shell script using cleaner way (without