Suppose I've set a bash variable to some fractional value (e.g. x=1.5
). Now, I want to write the value of x
to a file (e.g. my_file
) - but not as text; rather, I want to write a 32-bit IEEE-754 floating point value.
Can I do this with bash and standard(ish) Unix command-line tools?