Possible Duplicate:
using bash: write bit representation of integer to file
I need to write the size of a file into a binary file. For example:
$ stat -c %s in.txt
68187
$ stat -c %s in.txt >> out.bin
Instead of writing 68187 as a string to out.bin, i want to write it as a 4 bytes integer to out.bin.