-
Notifications
You must be signed in to change notification settings - Fork 0
Portability Notes
Stephen J. Kiernan edited this page Apr 21, 2026
·
1 revision
portable-hexdump is designed for maximum portability across Unix-like systems.
The script has been tested and verified to work with the following shells:
-
sh: Traditional Bourne shell and its variants. -
dash: The Debian Almquist Shell (minimalist and fast). -
bash: Bourne Again Shell. -
zsh: Z shell. -
ksh: Korn shell.
The script relies only on the following standard POSIX utilities:
-
sed: Used for parsing documentation and internal string manipulation. -
tr: Used to translate null bytes and newlines for safe shell variable handling. -
dd: Used for precise byte-by-byte reading and offset skipping. -
printf: Used for formatted hex and ASCII output.
To remain functional in rescue shells (like those found in initramfs or recovery partitions), the script avoids:
-
Bash-isms: No arrays, no
[[ ]]tests, and no non-standard parameter expansions. -
Gnu-isms: No reliance on GNU-specific extensions to
sedortr. -
External Tools: No reliance on
od,xxd, orawk.
-
File Arguments: Currently, the tool only reads from
stdin. File arguments are planned for a future release. -
Performance: Since the tool reads input byte-by-byte using
ddto ensure POSIX compliance without complex buffer logic, it is significantly slower than native C implementations likexxd. It is intended as a survival tool, not a high-volume data processor.
portable-hexdump • Copyright (c) 2024-2026 Stephen J. Kiernan