-
-
Save robertfairley/a5526069410e16d28f40d689f450c2f4 to your computer and use it in GitHub Desktop.
Shorthand for POSIX `hexdump` standard output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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