nnn/plugins/hexview

16 lines
296 B
Plaintext
Raw Normal View History

2019-03-23 02:14:34 +00:00
#!/usr/bin/env sh
# Description: View a file in hex
2020-06-10 17:03:59 +00:00
# Dependencies: hx (https://github.com/krpors/hx)/xxd and $PAGER
2019-03-23 02:14:34 +00:00
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
if ! [ -z "$1" ]; then
2020-06-10 17:03:59 +00:00
if which hx >/dev/null 2>&1; then
hx "$1"
else
xxd "$1" | $PAGER
fi
2019-03-23 02:14:34 +00:00
fi