Skip to content
Snippets Groups Projects
Commit 71cb693f authored by Bob Mottram's avatar Bob Mottram
Browse files

Fix hex string

parent c218eaa7
No related branches found
No related tags found
No related merge requests found
......@@ -389,7 +389,8 @@ function domain_to_hex_string {
segment=$(echo "$domain" | awk -F '.' -v value="$ctr" '{print $value}')
while [ ${#segment} -gt 0 ]
do
hexnum=$(echo "obase=16; $segment" | bc)
characters=$(echo -n "$segment" | wc -c)
hexnum=$(echo "obase=16; $characters" | bc)
if [ ${hexnum} -lt 2 ]; then
echo -n "|0${hexnum}|$segment"
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment