nnn/plugins/hexview

16 lines
296 B
Text
Raw Normal View History

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