nnn/plugins/hexview

16 lines
293 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
2020-11-22 14:39:14 +00:00
if [ -n "$1" ]; then
if type hx >/dev/null 2>&1; then
2020-06-10 17:03:59 +00:00
hx "$1"
else
xxd "$1" | $PAGER
fi
2019-03-23 02:14:34 +00:00
fi