leading zero
This commit is contained in:
parent
da18dc225e
commit
c6eb3de0d1
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue