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

leading zero

parent da18dc22
No related branches found
No related tags found
No related merge requests found
......@@ -391,11 +391,11 @@ function domain_to_hex_string {
do
characters=$(echo -n "$segment" | wc -c)
hexnum=$(echo "obase=16; $characters" | bc)
if [ ${hexnum} -lt 2 ]; then
echo -n "|0${hexnum}|$segment"
else
echo -n "|$hexnum|$segment"
echo -n "|"
if [ $(echo -n "$hexnum" | wc -c) -lt 2 ]; then
echo -n "0"
fi
echo -n "$hexnum|$segment"
ctr=$((ctr + 1))
segment=$(echo "$domain" | awk -F '.' -v value="$ctr" '{print $value}')
done
......
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