On 02/12/2018 09:07 AM, Dr. David Alan Gilbert wrote:

Is xxd now considered a common enough tool for portable scripts? I've
always liked xxd for manual use, but scripted with 'od'.

This script isn't part of a normal build or make check or anything, so
jumping through hoops to make it portable for the mythical other person
who might ever run it seems OTT, especially since xxd is very common,
and I'm not sure how much I'd bet on the portability of od's output
format either.

Relying on xxd is okay given your arguments, but od IS portable (it is required by POSIX, and if you stick to the basics that POSIX documents, things are pretty consistent between implementations). I will grant, however, that a portable use of od has a much longer command line (with the options you need to turn on for saner output, because who reads octal these days) than xxd giving you hex by default.

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to