mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-27 09:48:36 -05:00
16 lines
296 B
Plaintext
16 lines
296 B
Plaintext
|
#!/usr/bin/env sh
|
||
|
|
||
|
# Description: View a file in hex
|
||
|
# Dependencies: hx (https://github.com/krpors/hx)/xxd and $PAGER
|
||
|
#
|
||
|
# Shell: POSIX compliant
|
||
|
# Author: Arun Prakash Jana
|
||
|
|
||
|
if ! [ -z "$1" ]; then
|
||
|
if which hx >/dev/null 2>&1; then
|
||
|
hx "$1"
|
||
|
else
|
||
|
xxd "$1" | $PAGER
|
||
|
fi
|
||
|
fi
|