frigoclavis/scripts/hex2text

18 lines
202 B
Bash
Executable file

#!/bin/bash
if [[ -z $1 ]] ; then
echo "usage: $0 <string>"
exit 1
fi
STR=$1
sed 's/\\x/:/g' <<< $STR \
| tr ':' "\n" \
| while read B ; do
#echo $B
[[ -n $B ]] && printf "\x$B"
done
echo