nnn/plugins/hexview

17 lines
295 B
Text
Raw Normal View History

2019-03-23 07:44:34 +05:30
#!/usr/bin/env sh
# Description: View a file in hex
2021-05-15 23:02:01 +05:30
#
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
2020-11-22 20:09:14 +05:30
if [ -n "$1" ]; then
if type hx >/dev/null 2>&1; then
2020-06-10 22:33:59 +05:30
hx "$1"
else
xxd "$1" | $PAGER
fi
2019-03-23 07:44:34 +05:30
fi