bash - CentOS, Convert ipV6 short to long form -
i have started bash scripting , there small problem have solve go on:
i'm getting ipv6 address in format: 1080::8:800:200c:417a
now want convert short long ipv6 form like: 1080:0:0:0:8:800:200c:417a
is there regex expression or similar convert that?
i working on docker container runs on centos 8.3.
it isn't regex, 'something similar' , job: (tested python3.5.1)
>>> import ipaddress >>> x = '1080::8:800:200c:417a' >>> y = ipaddress.ip_address(x) >>> y.exploded '1080:0000:0000:0000:0008:0800:200c:417a' >>>
Comments
Post a Comment