Skip to content

Instantly share code, notes, and snippets.

@robertfairley
Created May 18, 2018 19:54
Show Gist options
  • Save robertfairley/a5526069410e16d28f40d689f450c2f4 to your computer and use it in GitHub Desktop.
Save robertfairley/a5526069410e16d28f40d689f450c2f4 to your computer and use it in GitHub Desktop.
Shorthand for POSIX `hexdump` standard output
#!/usr/bin/env bash
##################################################
# #
# Shorthand for a hex dump of a file on POSIX #
# if the program exists on your system #
# #
##################################################
FILE=$1
usage() {
echo "usage: hex <filename>"
}
if [[ $# -lt 1 ]]; then
usage
else
hexdump -C -n128 $FILE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment