aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/hexview
blob: ce17a60d39ef39a2260c7a7298338b50e6aa88f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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