My problem is that I need to create a file with this exact bytes: 48, 00, 49, 00
.
I cannot use C, perl, other scripting language (the target is an embedded
I needed to write binary files from hex using busybox within an old Android shell. This printf
with a redirect worked in my use case.
Write the binary data in hex:
# busybox printf '\x74\x65\x73\x74' > /sdcard/test.txt
Display the result in hex:
# busybox hexdump -C /sdcard/test.txt
00000000 74 65 73 74 |test|
00000004
Display the result in ascii:
# cat /sdcard/test.txt
test