xxd trailing spaces

David Timber mieabby at gmail.com
Sat Aug 15 13:18:15 UTC 2020


Compare the output of these two command:

dd if=/dev/zero bs=1 count=1 | busybox xxd -p | hexdump -C
dd if=/dev/zero bs=1 count=1 | xxd -p | hexdump -C

The bb version of xxd prints extra trailing spaces(0x20). So, if you
want to use the output of xxd command in your shell script, you'll
need to trim the string. Adding "-c1" solves the issue. I didn't fully
understand the code(hexdump-xxd.c), but I'm pretty sure it has
something to do with -c option.

Clearly, this is a different behaviour. If you think this a bug, here it is.

Thank you.


More information about the busybox mailing list