leading zero
This commit is contained in:
parent
da18dc225e
commit
c6eb3de0d1
|
@ -391,11 +391,11 @@ function domain_to_hex_string {
|
||||||
do
|
do
|
||||||
characters=$(echo -n "$segment" | wc -c)
|
characters=$(echo -n "$segment" | wc -c)
|
||||||
hexnum=$(echo "obase=16; $characters" | bc)
|
hexnum=$(echo "obase=16; $characters" | bc)
|
||||||
if [ ${hexnum} -lt 2 ]; then
|
echo -n "|"
|
||||||
echo -n "|0${hexnum}|$segment"
|
if [ $(echo -n "$hexnum" | wc -c) -lt 2 ]; then
|
||||||
else
|
echo -n "0"
|
||||||
echo -n "|$hexnum|$segment"
|
|
||||||
fi
|
fi
|
||||||
|
echo -n "$hexnum|$segment"
|
||||||
ctr=$((ctr + 1))
|
ctr=$((ctr + 1))
|
||||||
segment=$(echo "$domain" | awk -F '.' -v value="$ctr" '{print $value}')
|
segment=$(echo "$domain" | awk -F '.' -v value="$ctr" '{print $value}')
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue