#!/bin/bash
#
# RJP 5.8.2026 hexdumb reader
# simple human readable hextumb reader
#
yad --center --width=500 --height=50 --text-align=center --title=$"Open file for seeing hexdumb as human readable?" --text=$"Open file for seeing hexdumb as human readable"
if [ $? = 0 ];
then
FILE=`yad --text=$"Choose file" --title=$"Choose file" --button=OK:0 --file --height=500 --width=500`

hexdump -C $FILE|cut -c 62-77 > /tmp/hexdump0.txt

cat /tmp/hexdump0.txt | tr -d '\n' > /tmp/hexdump.txt
sleep 0,2
xdg-open /tmp/hexdump.txt
exit 0
fi
sleep 30
cd /tmp && rm hexdump0.txt hexdump.txt
